|
query,gold |
|
Count the number of files and directories in the entire testbed directory,find /testbed | wc -l |
|
Find all text files in the testbed directory and subdirectories and concatenate them into a single file,find /testbed -type f -name '*.txt' -exec cat {} ; > /testbed/concatenated_text_files.txt |
|
Find all directories in the testbed directory that have at least one Python script and list the number of Python scripts in each directory,"find /testbed -type d -exec sh -c 'echo -n ""{}: ""; ls -1 {}/*.py 2>/dev/null | wc -l' \;" |
|
Sort the lines of textfile1.txt in reverse alphabetical order and save the result to a new file,sort -r /testbed/dir1/textfile1.txt > /testbed/dir1/textfile1_reverse_sorted.txt |
|
Search for all files containing the word 'error' and sort them by size,find testbed/ -type f -exec grep -l 'error' {} + | xargs du -b | sort -n |
|
Find all symbolic links in testbed/ that point to files which were modified in the last 7 days,find testbed/ -type l -lname '*testbed/*' -mtime -7 -ls |
|
Get the total size of all files in testbed/ and save it to a file,find testbed/ -type f -printf '%s\n' | awk '{s+=$1} END {print s}' > total_size.txt |
|
Find all PNG files in testbed/ and convert them to JPEG with a quality of 90%,find testbed/ -name '*.png' -exec convert -quality 90 {} {}.jpg \; |
|
List all files in the directory /testbed/dir1 and sort them by size in human-readable format,ls -lhS /testbed/dir1 |
|
Count the number of lines in all text files under the directory /testbed/dir2,grep -rl . /testbed/dir2 | xargs wc -l |
|
Print the name and size of the 3 largest files in the directory /testbed/dir3,du -a /testbed/dir3 | sort -rn | head -n 3 |
|
Find all empty directories in the directory /testbed and delete them,find /testbed -type d -empty -delete |
|
Rename all files with extension .txt under the directory /testbed to have a .md extension instead,find /testbed -type f -name '*.txt' -exec rename .txt .md {} + |
|
Find all files modified in the last 2 hours and compress them into a tarball named archive.tar.gz in the directory /testbed,find /testbed -type f -mmin -120 -print0 | xargs -0 tar -czf /testbed/archive.tar.gz |
|
List all subdirectories of /testbed that are not named subdir1,ls -d /testbed |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|