脚本:#!/bin/bashfor file in $(ls /home)do if [ -L "$file" ] then echo "$file is lianjie";elif [ -d "$file" ] then echo "$file is mulu";elif [ -f "$file" ] then echo "$file is putong"; elif [ -S "$file" ] then echo "$file is socket";else echo "$file is qita";fi done运行结果:abc is qita cde is qitajp is qitals -l 查看结果-rwxr-xr-x. 1 root root 0 6月 23 05:30 abclrwxrwxrwx. 1 root root 3 6月 23 05:30 cde -> abcdrwxr-xr-x. 2 root root 4096 6月 23 05:30 jp
- 2 回答
- 0 关注
- 1557 浏览
添加回答
举报
0/150
提交
取消