我将此命令存储在此变量中:
filelist=$(find $dir_name -size $sizeFileTmp -printf '%M %n %u %g %-s %Tb %Td %Tk:%TM %P\n')
echo "$filelist" | sort -rnk5 | awk '{printf "%s %s %s %s %6s %3s %2s %5s %s\n", $1, $2, $3, $4, $5, $6, $7, $8, $9}'
产生这个输出:
-rwx------ 1 juanpa juanpa 135838 Nov 04 20:47 sample.dir2/testdir2/subdir2/phones
-rwx------ 1 juanpa juanpa 135838 Nov 04 20:47 sample.dir2/testdir2/phones
-rwx------ 1 juanpa juanpa 135838 Nov 04 20:47 sample.dir1/testdir1/subdir1/phones
-rwx------ 1 juanpa juanpa 135838 Nov 04 20:47 sample.dir1/testdir1/phones
-rwx------ 1 juanpa juanpa 135838 Nov 04 20:47 sample.dir1/.phones
-rwx------ 1 juanpa juanpa 26615 Nov 04 20:47 sample.dir2/vimtutor
-rwx------ 1 juanpa juanpa 26615 Nov 04 20:47 sample.dir2/testdir2/vimtutor
-rwx------ 1 juanpa juanpa 26615 Nov 04 20:47 sample.dir2/testdir2/subdir2/vimtutor
-rwx------ 1 juanpa juanpa 26615 Nov 04 20:47 sample.dir1/vimtutor
-rwx------ 1 juanpa juanpa 26615 Nov 04 20:47 sample.dir1/testdir1/vimtutor
-rwx------ 1 juanpa juanpa 26615 Nov 04 20:47 sample.dir1/testdir1/subdir1/vimtutor
-rwx------ 1 juanpa juanpa 25557 Nov 04 20:47 sample.dir2/testdir2/subdir2/cdlist
-rwx------ 1 juanpa juanpa 25557 Nov 04 20:47 sample.dir2/testdir2/cdlist
-rwx------ 1 juanpa juanpa 25557 Nov 04 20:47 sample.dir2/cdlist
-rwx------ 1 juanpa juanpa 25557 Nov 04 20:47 sample.dir1/testdir1/subdir1/cdlist
-rwx------ 1 juanpa juanpa 25557 Nov 04 20:47 sample.dir1/testdir1/cdlist
-rwx------ 1 juanpa juanpa 25557 Nov 04 20:47 sample.dir1/cdlist
-rwx------ 1 juanpa juanpa 20558 Nov 04 20:47 sample.dir2/testdir2/subdir2/sample.txt
-rwx------ 1 juanpa juanpa 20558 Nov 04 20:47 sample.dir2/testdir2/sample.txt
-rwx------ 1 juanpa juanpa 20558 Nov 04 20:47 sample.dir2/sample.txt
-rwx------ 1 juanpa juanpa 20558 Nov 04 20:47 sample.dir1/testdir1/subdir1/sample.txt
-rwx------ 1 juanpa juanpa 20558 Nov 04 20:47 sample.dir1/testdir1/sample.txt
-rwx------ 1 juanpa juanpa 20558 Nov 04 20:47 sample.dir1/sample.txt
我的问题是我应该如何检查包含这些文件的文件夹是否没有写入和执行权限,然后突出显示这些行????
提前致谢