total 16
drwxr-xr-x 4 ubuntu1004 ubuntu1004 4096 2011-12-06 22:51 ./
drwxrwxrwt 14 root root 4096 2011-12-06 22:51 ../
-rw-r--r-- 1 ubuntu1004 ubuntu1004 0 2011-12-06 22:51 file1
-rw-r--r-- 1 ubuntu1004 ubuntu1004 0 2011-12-06 22:51 file2
-rw-r--r-- 1 ubuntu1004 ubuntu1004 0 2011-12-06 22:51 file3
drwxr-xr-x 2 ubuntu1004 ubuntu1004 4096 2011-12-06 22:51 folder1/
drwxr-xr-x 2 ubuntu1004 ubuntu1004 4096 2011-12-06 22:51 folder2/
ubuntu1004@ubuntu1004:/tmp/folder$ find . -type f
./file2
./file1
./file3
ubuntu1004@ubuntu1004:/tmp/folder$ find . -type f | xargs
./file2 ./file1 ./file3
ubuntu1004@ubuntu1004:/tmp/folder$ find . -type f | xargs ls -lh
-rw-r--r-- 1 ubuntu1004 ubuntu1004 0 2011-12-06 22:51 ./file1
-rw-r--r-- 1 ubuntu1004 ubuntu1004 0 2011-12-06 22:51 ./file2
-rw-r--r-- 1 ubuntu1004 ubuntu1004 0 2011-12-06 22:51 ./file3
ubuntu1004@ubuntu1004:/tmp/folder$ find . -type f | xargs rm -f
ubuntu1004@ubuntu1004:/tmp/folder$ ll
total 16
drwxr-xr-x 4 ubuntu1004 ubuntu1004 4096 2011-12-06 23:13 ./
drwxrwxrwt 14 root root 4096 2011-12-06 22:51 ../
drwxr-xr-x 2 ubuntu1004 ubuntu1004 4096 2011-12-06 22:51 folder1/
drwxr-xr-x 2 ubuntu1004 ubuntu1004 4096 2011-12-06 22:51 folder2/
ubuntu1004@ubuntu1004:/tmp/folder$ find . -type d | xargs rm -rf
rm: cannot remove directory `.'
ubuntu1004@ubuntu1004:/tmp/folder$ ll
total 8
drwxr-xr-x 2 ubuntu1004 ubuntu1004 4096 2011-12-06 23:14 ./
drwxrwxrwt 14 root root 4096 2011-12-06 22:51 ../
No comments:
Post a Comment