|
query,gold |
|
, |
|
, |
|
Recursively list contents of the '/system' directory in a tree-like format,tree /system |
|
Recursively print all files and directories in the '/system/folder2' directory tree including hidden files,tree -a /system/folder2 |
|
, |
|
,yes y | rm -r /system/*.txt |
|
Recursively removes all empty folders from the /system/folder3/temp folder.,find /system/folder3/temp -depth -type d -exec rmdir {} \; |
|
,find /system/folder3/temp -type d -empty -exec rmdir -vp --ignore-fail-on-non-empty {} + |
|
Recursively removes all files in the /system/folder1 folder but '*txt' files.,find /system/folder1 -type f -not -name '*txt' | xargs rm |
|
,find /system/folder1 -type f -exec rename 's/special/regular/' '{}' \; |
|
, |
|
,find /system/folder3/ -type f -exec basename {} \; |
|
, |
|
,cat /system/folder3/temp/temp1/text1.txt | sed 's/\r$//' | od -c |
|
Remove all *.doc files from the /system/folder1 tree, |
|
Remove all *.log files from the /system/folder1 tree,find /system/folder1 -name '*.log' -print0 | xargs -0 rm |
|
Remove all *.txt files in '/system' directory but not in it's subdirectories,find /system -maxdepth 1 -name '*.txt' -maxdepth 1 | xargs rm |
|
Remove all *.sql files in the '/system/folder3/backup_dbg' directory that were last modified more than 25 days ago,find /system/folder3/backup_dbg/*.sql -mtime +25 -exec rm -f {} \; |
|
Remove all *.txt files under the /system/folder1 directory modified more than 5 minutes ago,"find /system/folder1 -maxdepth 1 -mmin +5 -type f -name ""*.txt"" -delete" |
|
"Remove all *.txt files, except ""keep.txt"", under /system/folder1 directory modified more than 5 minutes ago","find /system/folder1 -maxdepth 1 -mmin +5 -type f -name ""*.txt"" ! -name ""keep.txt"" -delete" |
|
"Remove all .sh files in the '/system/folder1' tree whose names begin with ""new""",find /system/folder1 -name 'new*.sh' -exec rm -f '{}' \; |
|
"Remove all a.out, *.o, and core files under the '/system' directory",find /system \( -name a.out -o -name '*.o' -o -name 'core' \) -exec rm {} \; |
|
Remove all but 5 last comma-separated fields from each line in '/system/folder1/data.csv',"cat /system/folder1/data.csv | rev | cut -d, -f-5 | rev" |
|
"Remove all directories called ""temp"" from the /system directory tree","find /system -name ""temp"" -type f -delete" |
|
Remove all empty files in /system/folder3/temp and below,find /system/folder3/temp -type f -empty -print | xargs rm -f |
|
Remove all files 'a.out' and *.o in the /system directory tree that were modified more than 7 days ago,find /system \( -name a.out -o -name '*.o' \) -mtime +7 -exec rm {} \; |
|
"Remove all files and directories under '/system/folder3/temp' directory tree that match with one of the name patterns '.DS_Store', '._.DS_Store' , '._*', '.TemporaryItems' or '.apdisk'",find /system/folder3/temp \( -name '.DS_Store' -or -name '._.DS_Store' -or -name '._*' -or -name '.TemporaryItems' -or -name '.apdisk' \) -exec rm -rf {} \; |
|
Remove empty directories from directory tree /system,find /system -type d -empty -exec rm -r {} \; |
|
"Remove everything within parentheses and substitute all non digit characters with a space from ""1/2 [3] (27/03/2012 19:32:54) word word word word 4/5"" and format the output as a table",echo '1/2 [3] (27/03/2012 19:32:54) word word word word 4/5' | sed -e 's/(.*)//' -e 's/[^0-9]/ /g' | column -t |
|
"Remove files text2, text3, text4 in directory /system/folder1",find /system/folder1 -name 'text[2-4]' -exec rm {} \; |
|
Remove files from the /system directory that are owned by nobody,find /system -nouser -exec rm {} + |
|
Remove files that are greater than 1KB in size under /system directory,find /system -type f -size +1k -exec rm {} + |
|
"Remove junk files modified more than 31 days ago recursively from ""/system""",find /system -type f -mtime +31 -exec rm -f {} \; |
|
"Remove newline characters from ""/system/folder3/temp/temp1/text1.txt""","paste -sd """" /system/folder3/temp/temp1/text1.txt" |
|
Remove regular files in the /system directory tree,find /system -type f -print0 | xargs -0 -n1 echo rm | sh -x |
|
"Print summary of new/missing files, and which files differ between /system/folder1 and /system/folder2, sorted alphabetically.",diff -qr /system/folder1 /system/folder1 | sort |
|
Print amount of space available on the file system containing path to the /system directory in megabytes.,df /system -B MB | tail -1 | awk {'print $4'} | grep .[0-9]* |
|
Recursively find the latest modified file in the /system directory,find /system -type f | xargs ls -ltr | tail -n 1 |
|
"Display the number of sub-directories for all directories under /system directory tree, sort them according to the decreasing order of the number and show only the first 10 of them","find /system -type d -ls | awk '{print $4 - 2, $NF}' | sort -rn | head" |
|
"archive all files in /system/folder1 directory modified in the last 60 days to ""/mytarfile.tgz""",tar czvf mytarfile.tgz `find /system/folder1 -mtime -60` |
|
Create a symbolc link in the /system/folder1 to root folder,ln /system/folder1 -s / |
|
Remove files in the /system directory tree modified more than 31 days ago recursively,find /system -type f -mtime +31 -print0 | xargs -0 -r rm -f |
|
"Write the current date and time followed by "" 1"" to the console and append to ""/system/folder3/temp/empty.txt""","echo $(date) ""1"" | tee -a /system/folder3/temp/empty.txt" |
|
"Concatenate all .txt files residing in the /system tree into a single file ""/system/folder3/temp/empty.txt""","find /system -name ""*.txt"" -exec cat {} \; > /system/folder3/temp/empty.txt" |
|
compresses all the files in the /system folder with default depth to /backup,find /system -depth -print | cpio -dump /backup |
|
Copy all files in the /system directory except those containing 'text' to '/system/folder3/backup_dbg/backup'.,find /system -maxdepth 1 -type f -name '*text*' -exec cp {} /system/folder3/backup_dbg/backup \; |
|
"Rename ""/system/folder3/temp/temp1"" to ""/system/folder3/temp/temp1_old"" and backup to ""/system/folder3/temp/temp1_old.old"" if ""/system/folder3/temp/temp1_old"" exists",mv /system/folder3/temp/temp1 /system/folder3/temp/temp1_old -b -S .old |
|
"Dump ""/system/text1.txt"" as ASCII characters",od -t c /system/text1.txt |
|
"create a compressed archive of /system/folder1 ""compress_folder1.tar.gz"" with verbose output",tar -zcvf compress_folder1.tar.gz /system/folder1 |
|
"download content from ""http://example.com/textfile.txt"" and output to 'textfile.txt' in /system",curl http://example.com/textfile.txt -o /system/textfile.txt |
|
Search in /system downwards all files whose size is 10 bytes ( Characters ) .,find /system -size 10c -print |
|
"Calculate the md5sum of each "".txt"" file under ""/system"", sort the output, and calculate the md5sum of that",find /system -type f -name '*.txt' -exec md5sum {} + | awk '{print $1}' | sort | md5sum |
|
"Search for the system host name in ""/etc/hosts"" and print the IP address in the first awk field",more /etc/hosts | grep `hostname` | awk '{print $1}' |
|
|