Datasets:

Modalities:
Text
Formats:
csv
Languages:
English
ArXiv:
Libraries:
Datasets
pandas
License:
westenfelder commited on
Commit
a96a6bf
·
1 Parent(s): 2d03f7e
Files changed (3) hide show
  1. README.md +7 -0
  2. test.csv +301 -0
  3. train.csv +0 -0
README.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ ---
2
+ configs:
3
+ - config_name: train
4
+ data_files: "train.csv"
5
+ - config_name: test
6
+ data_files: "test.csv"
7
+ ---
test.csv ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nl,bash,bash2,difficulty
2
+ list files in the current directory,ls,ls -l,0
3
+ list all files in the current directory including hidden files,ls -a,ls -alh,0
4
+ list open files,lsof,lsof -P -i -n,0
5
+ create a copy of /testbed/hello.php named /testbed/hello-COPY.php,cp /testbed/hello.php /testbed/hello-COPY.php,cp /testbed/hello.php /testbed/hello-COPY.php -v,0
6
+ create a file /testbed/test.txt,touch /testbed/test.txt,> /testbed/test.txt,0
7
+ create a directory /testbed/test_dir,mkdir /testbed/test_dir,mkdir /testbed/test_dir -v,0
8
+ remove a file named does_not_exist.txt,rm does_not_exist.txt,unlink does_not_exist.txt,0
9
+ print hello world,echo hello world,echo -n 'hello world',0
10
+ print the current working directory,pwd,pwd .,0
11
+ print the current date and time,date,date -R,0
12
+ print the current user,whoami,id -un,0
13
+ remove a directory named fake_dir,rmdir fake_dir,rm -r fake_dir,0
14
+ print the current shell,echo $0,echo $SHELL,0
15
+ print environment variables,env,printenv,0
16
+ print the current user's home directory,echo $HOME,echo ~,0
17
+ print the current user's path,echo $PATH,printenv PATH,0
18
+ display the contents of the setup_nl2b_fs_1.sh file,cat setup_nl2b_fs_1.sh,nl setup_nl2b_fs_1.sh,0
19
+ display the first 5 lines of the setup_nl2b_fs_1.sh file,head -n 5 setup_nl2b_fs_1.sh,"sed -n '1,5p' setup_nl2b_fs_1.sh",0
20
+ display the last 5 lines of the setup_nl2b_fs_1.sh file,tail -n 5 setup_nl2b_fs_1.sh,tac setup_nl2b_fs_1.sh | head -n 5,0
21
+ print the tenth line of the setup_nl2b_fs_1.sh,sed -n 10p setup_nl2b_fs_1.sh,awk 'NR==10' setup_nl2b_fs_1.sh,0
22
+ print the path of the bash executable,which bash,type bash,0
23
+ display the shell history,history,history | cut -c 8-,0
24
+ print the system utilization stats,vmstat,vmstat -t,0
25
+ print the system uptime,uptime,uptime -p,0
26
+ print the system load averages,w,w -s,0
27
+ print running processes,ps,ps -e,0
28
+ print running processes in a tree format,pstree,pstree -p,0
29
+ print the system memory usage,free,free -h,0
30
+ print the system disk usage,df,df -h,0
31
+ print the kernel version,uname -a,uname -r,0
32
+ print the system hostname,hostname,hostname -f,0
33
+ print the system IP address,hostname -I,hostname -i,0
34
+ print the ip addresses of the system DNS servers,cat /etc/resolv.conf | grep nameserver,grep nameserver /etc/resolv.conf,0
35
+ display the network interfaces,ifconfig,ifconfig -a,0
36
+ display the routing table,route,route -n,0
37
+ show the last logged in users,last,last -a,0
38
+ print the last logged in users and show the full user and domain names,last -w,last -w -i,0
39
+ print the openssl version,openssl version,openssl version -a,0
40
+ base64 encode the string 'hello',echo 'hello' | base64,echo 'hello' | openssl enc -base64,0
41
+ base64 decode the string 'aGVsbG8=',echo 'aGVsbG8=' | base64 -d,echo 'aGVsbG8=' | openssl enc -base64 -d,0
42
+ print lines containing 'console' in the file setup_nl2b_fs_1.sh,grep 'console' setup_nl2b_fs_1.sh,awk '/console/' setup_nl2b_fs_1.sh,0
43
+ list the stats and timestamps of the file setup_nl2b_fs_1.sh,stat setup_nl2b_fs_1.sh,stat -t setup_nl2b_fs_1.sh,0
44
+ gzip the file /testbed/hello.php keeping the original file,gzip -k /testbed/hello.php,gzip --keep /testbed/hello.php,0
45
+ tar the file /testbed/hello.php to /testbed/hello.tar,tar -cf /testbed/hello.tar /testbed/hello.php,tar -cvf /testbed/hello.tar /testbed/hello.php,0
46
+ show apt information about the curl package,apt show curl,apt-cache show curl,0
47
+ list background jobs,jobs,jobs -p,0
48
+ print the current terminal type,echo $TERM,printenv TERM,0
49
+ display the current process priority,nice,nice,0
50
+ display the pid of the current shell,echo $$,pidof bash,0
51
+ time how long it takes to run the command echo 'hello',time echo 'hello',time echo 'hello',0
52
+ print the current user's groups,groups,groups,0
53
+ print the current user's id,id,id -u,0
54
+ list the cron tab,crontab -l,crontab -l,0
55
+ print the current user's umask,umask,umask -p,0
56
+ list cpu information,lscpu,cat /proc/cpuinfo,0
57
+ list memory information,lsmem,cat /proc/meminfo,0
58
+ print the installed ssh version,ssh -V,ssh -V,0
59
+ print the bash profile in the home directory,cat ~/.bashrc,nl ~/.bashrc,0
60
+ print the system's locale,locale,locale,0
61
+ list block devices,lsblk,lsblk -f,0
62
+ find all files larger than 100MB in the current dir,find . -size +100M -print,find . -size +100M,0
63
+ create a symbolic link to /testbed/hello.php named /testbed/link,ln -s /testbed/hello.php /testbed/link,ln -s /testbed/hello.php /testbed/link,0
64
+ change the ownership of /testbed/test.txt to user 'nobody',chown nobody /testbed/test.txt,chown nobody /testbed/test.txt,0
65
+ change the group of /testbed/test.txt to group 'nogroup',chgrp nogroup /testbed/test.txt,chgrp nogroup /testbed/test.txt,0
66
+ change permissions of /testbed/test.txt to read-only for everyone,chmod 444 /testbed/test.txt,chmod a=r /testbed/test.txt,0
67
+ "count the lines, words, and characters in setup_nl2b_fs_1.sh",wc setup_nl2b_fs_1.sh,wc setup_nl2b_fs_1.sh,0
68
+ print the lines in setup_nl2b_fs_1.sh sorted alphabetically,sort setup_nl2b_fs_1.sh,sort setup_nl2b_fs_1.sh,0
69
+ print the unique lines in setup_nl2b_fs_1.sh,uniq setup_nl2b_fs_1.sh,uniq setup_nl2b_fs_1.sh,0
70
+ display network statistics,netstat --statistics,netstat -s,0
71
+ display network interfaces,netstat -i,netstat --interfaces,0
72
+ display a calendar for the next 3 months,cal -3,cal -3,0
73
+ show running daemons and services,service --status-all,service --status-all,0
74
+ print the system boot time,who -b,uptime -s,0
75
+ print current swap usage,swapon --show,free -h | grep Swap,0
76
+ print a list of active kernel parameters,sysctl -a,sysctl --all,0
77
+ list the installed software packages,dpkg --get-selections,apt list --installed,0
78
+ list available shells,cat /etc/shells,cat /etc/shells,0
79
+ list all users on the system,getent passwd,cat /etc/passwd,0
80
+ list all groups on the system,getent group,cat /etc/group,0
81
+ extract the filename from this path '/usr/local/bin/my_script.sh',basename /usr/local/bin/my_script.sh,echo 'my_script.sh',0
82
+ perform a dns lookup for google.com,nslookup google.com,dig google.com,0
83
+ extract the directory from this path '/usr/local/bin/my_script.sh',dirname /usr/local/bin/my_script.sh,echo '/usr/local/bin/',0
84
+ send the message 'System maintenance in 10 minutes!' to all logged in users,wall 'System maintenance in 10 minutes!',echo 'System maintenance in 10 minutes!' | wall,0
85
+ print the file type of setup_nl2b_fs_1.sh,file setup_nl2b_fs_1.sh,file setup_nl2b_fs_1.sh,0
86
+ print the contents of setup_nl2b_fs_1.sh with lines wrapped to 40 characters,fold -w 40 setup_nl2b_fs_1.sh,fmt -w 40 setup_nl2b_fs_1.sh,0
87
+ print all system configuration variables,getconf -a,getconf -a,0
88
+ print the number of processors,nproc,nproc,0
89
+ print the max number of open file descriptors,ulimit -n,ulimit -n,0
90
+ print the max number of user processes,ulimit -u,ulimit -u,0
91
+ print the max cpu time,ulimit -t,prlimit --cpu,0
92
+ display the configured size of long integers,getconf LONG_BIT,getconf LONG_BIT,0
93
+ print the directory tree two levels deep,tree -L 2,find . -maxdepth 2 -print,0
94
+ print the number of times the word 'the' appears in setup_nl2b_fs_1.sh,grep -o 'the' setup_nl2b_fs_1.sh | wc -l,grep -o 'the' setup_nl2b_fs_1.sh | nl,0
95
+ print the number of files in the current directory,ls -a | wc -l,ls -al | wc -l,0
96
+ print first line of setup_nl2b_fs_1.sh,sed -n '1p' setup_nl2b_fs_1.sh,awk 'NR == 1 {print}' setup_nl2b_fs_1.sh,0
97
+ print the last line of setup_nl2b_fs_1.sh,sed -n '$p' setup_nl2b_fs_1.sh,awk 'END {print}' setup_nl2b_fs_1.sh,0
98
+ print lines 3 to 5 of setup_nl2b_fs_1.sh,"sed -n '3,5p' setup_nl2b_fs_1.sh",awk 'NR >= 3 && NR <= 5 {print}' setup_nl2b_fs_1.sh,0
99
+ print every other line of setup_nl2b_fs_1.sh,sed -n '1~2p' setup_nl2b_fs_1.sh,awk 'NR % 2 == 1 {print}' setup_nl2b_fs_1.sh,0
100
+ print the number of words in setup_nl2b_fs_1.sh,wc -w setup_nl2b_fs_1.sh,awk '{ total += NF } END { print total }' setup_nl2b_fs_1.sh,0
101
+ "find all empty files in the current directory, do not search sub directories",find . -maxdepth 1 -type f -empty,find . -maxdepth 1 -type f -empty -print,0
102
+ print lines in the file setup_nl2b_fs_1.sh that are less than 20 characters,awk 'length < 40' setup_nl2b_fs_1.sh,"grep -v '^.\{40,\}' setup_nl2b_fs_1.sh",1
103
+ print lines in the file setup_nl2b_fs_1.sh that contain the characters 'the',grep 'the' setup_nl2b_fs_1.sh,awk '/the/' setup_nl2b_fs_1.sh,1
104
+ print lines in the file setup_nl2b_fs_1.sh that contain the characters 'the' and 'a',grep 'the' setup_nl2b_fs_1.sh | grep 'a',awk '/the/ && /a/' setup_nl2b_fs_1.sh,1
105
+ display the sha512 digest of setup_nl2b_fs_1.sh,sha512sum setup_nl2b_fs_1.sh,openssl dgst -sha512 setup_nl2b_fs_1.sh,1
106
+ encrypt the file setup_nl2b_fs_1.sh using the aes-256-cbc algorithm with password 'password' and save it to out.enc,openssl enc -aes-256-cbc -in setup_nl2b_fs_1.sh -pass pass:password -out out.enc,openssl enc -aes-256-cbc -in setup_nl2b_fs_1.sh -pass pass:password -out out.enc,1
107
+ create a file named 'world.txt' with the text 'hello' inside,echo 'hello' > world.txt,echo 'hello' | dd of=world.txt,1
108
+ print the system's public ip address,curl ipinfo.io/ip,curl ifconfig.me/ip,1
109
+ "Calculate a list of duplicate md5 sum hashes for all the "".java"" files in the /testbed directory",md5sum /testbed/*.java | awk '{print $1}' | sort | uniq -d,"find /testbed -type f -name ""*.java"" -exec md5sum {} + | sort | uniq -w32 -d -c | sort -nr",2
110
+ Calculate the md5 sum of the md5 sum of all the files under /testbed/dir2/subdir2 sorted by filename,find /testbed/dir2/subdir2 -type f -print0 | sort -z | xargs -0 md5sum | awk '{print $1}' | md5sum,ls -1 /testbed/dir2/subdir2/* | sort | xargs md5sum | awk '{print $1}' | md5sum,2
111
+ "Calculate the md5 sum of the contents of the sorted list of files ""$FILES""",cat $(echo $FILES | tr ' ' '\n' | sort) | md5sum,"echo ""$FILES"" | tr ' ' '\n' | sort | xargs cat | md5sum",1
112
+ "Calculate the md5 sum of the sorted list of md5 sums of all "".py"" files under /testbed/dir1/subdir1",find /testbed/dir1/subdir1 -type f -name *.py -exec md5sum {} + | awk '{print $1}' | sort | md5sum,find /testbed/dir1/subdir1 -type f -name '*.py' -print0 | xargs -0 md5sum | awk '{print $1}' | sort | md5sum,2
113
+ "Calculate the total disk usage for each "".txt"" file on the /testbed directory and prepend the system host name to the output","find /testbed -name ""*.txt"" -exec du {} + | awk -v hostname=""$(hostname)"" '{print hostname, $0}'","find /testbed -name ""*.txt"" -exec du -h {} + | awk -v hostname=""$(hostname)"" '{print hostname, $0}'",2
114
+ Change permissions for all PHP files under the /testbed directory tree to 755 and print the number of files changed,"find /testbed -name ""*.php"" -exec chmod 755 {} \; -exec /bin/echo {} \; | wc -l","find /testbed -type f -name ""*.php"" -exec chmod 755 {} \; -print | wc -l",2
115
+ "Check if the current shell is running within a 'screen' process and print ""True"" or ""False""","pstree -s $$ | grep -q ""screen"" && echo ""True"" || echo ""False""","ps -o comm= $(pstree -sp $$ | awk -F '[^0-9]*' '{print $2}') | grep -q 'screen' && echo ""True"" || echo ""False""",2
116
+ "Print ""True"" if the contents of file /testbed/dir3/subdir1/subsubdir1/textfile3.txt is a subset of file /testbed/dir2/subdir1/textfile2.txt, otherwise print ""False""","comm -23 <(sort /testbed/dir3/subdir1/subsubdir1/textfile3.txt | uniq) <(sort /testbed/dir2/subdir1/textfile2.txt | uniq) | head -1 | grep -q '.' && echo ""False"" || echo ""True""","comm -23 <(sort /testbed/dir3/subdir1/subsubdir1/textfile3.txt | uniq) <(sort /testbed/dir2/subdir1/textfile2.txt | uniq) | grep -q '.' && echo ""False"" || echo ""True""",2
117
+ Compute the mean average of the word count of *.txt files in the /testbed directory,find /testbed -name '*.txt' -print0 | xargs -0 wc -w | awk 'END { print $1/(NR-1) }',"find /testbed -type f -name ""*.txt"" -exec wc -w {} + | awk '{total = $1} END {print total/(NR-1)}'",2
118
+ Compute the mean average of the word count of *.txt files smaller than 6 words in the /testbed directory,find /testbed -name '*.txt' -print0 | xargs -0 wc -w | awk '$1 < 6 {v += $1; c++} END {print v/c}',"find /testbed -name '*.txt' -print0 | xargs -0 wc -w | awk '$1 < 6 {v += $1; c++} END {print v/c, ""words""}'",2
119
+ "Copy all files with ""FooBar"" in the path under the '/testbed' directory to the '/testbed/dir3/subdir1/subsubdir1/tmp' directory.",find /testbed -path '*FooBar*' -print0 | xargs -0 -I{} cp -r {} /testbed/dir3/subdir1/subsubdir1/tmp,find /testbed -path '*FooBar*' -print0 | xargs -0 -I{} cp -R {} /testbed/dir3/subdir1/subsubdir1/tmp,2
120
+ "search for all .txt files in the /testbed directory, prints their paths, and then search within each file for the word ""another""","find /testbed -name ""*.txt"" \( -exec echo {} \; -o -exec true \; \) -exec grep another {} \;","find /testbed -type f -name ""*.txt"" -print -exec grep -H ""another"" {} \;",2
121
+ "Convert the first 16 characters in ""/testbed/textfile7.txt"" to a single hexadecimal value",head /testbed/textfile7.txt -c16 | od -tx1 -w16 | head -n1 | cut -d' ' -f2- | tr -d ' ',head -c 16 /testbed/textfile7.txt | od -An -tx1 | tr -d ' \n',2
122
+ "Copies all files under the /testbed folder like ""file.txt"" with ""FooBar"" in the path to the root of the current folder, preserving mode, ownership and timestamp attributes.","find /testbed -type f -path '*FooBar*' | xargs -i cp -p ""{}"" .","find /testbed -type f -path '*FooBar*' -exec cp --preserve=mode,ownership,timestamps {} ./ \;",2
123
+ "Copy all files and folders below the /testbed directory whose names contain ""FooBar"" to directory '/testbed/dir3/subdir1/subsubdir1/tmp'",find /testbed -name '*FooBar*' -print0 | xargs -0 -I{} cp -R {} /testbed/dir3/subdir1/subsubdir1/tmp,"find /testbed -name ""*FooBar*"" -exec cp -r {} /testbed/dir3/subdir1/subsubdir1/tmp \;",2
124
+ Count all the lines of all '*.c' files in /testbed directory recursively,"find /testbed -name ""*.c"" -print0 | xargs -0 cat | wc -l","find /testbed -name ""*.c"" -exec wc -l {} + | awk '{s+=$1} END {print s}'",2
125
+ Count all the lines of all files with names ending with 'php' in current directory and subdirectories recursively,find . -type f -name '*php' | xargs cat | wc -l,find . -type f -name '*.php' -exec wc -l {} + | awk '{s=$1} END {print s}',1
126
+ Count all the lines of all php files in the /testbed directory recursively,find /testbed/ -name '*.php' | xargs cat | wc -l,find /testbed/ -type f -name '*.php' | xargs cat | wc -l,1
127
+ Calculate the md5sum of all '*.py' files in /testbed folder and sub folders.,"find /testbed -type f -name ""*.py"" -exec md5sum {} +","find /testbed -type f -name ""*.py"" -print0 | xargs -0 md5sum",2
128
+ "Count the *.html files residing in the /testbed directory tree and containing string ""foo""","find /testbed -name ""*.html"" | xargs grep -l foo | wc -l","find /testbed -name ""*.html"" -exec grep -l foo {} + | wc -l",2
129
+ Count the number of files/directories with '.php' extension under /testbed directory tree and change the permissions to 755,"find /testbed -name ""*.php"" -exec chmod 755 {} \; -exec /bin/echo {} \; | wc -l",find /testbed -type f -name '*.php' -exec chmod 755 {} \; -print | wc -l,2
130
+ Count the number of lines in all files in the /testbed directory tree that match pattern '*file*',find /testbed/ -name '*file*' | sort | xargs wc -l,find /testbed -type f -name '*file*' -exec wc -l {} +,1
131
+ Count the number of regular files in directory tree ${DIRECTORY} that contain a vowel in their names,find ${DIRECTORY} -type f -print | sed -e 's@^.*/@@' | grep '[aeiouyAEIOUY]' | wc -l,"find ""${DIRECTORY}"" -type f -print | awk -F/ '{print $NF}' | grep -i '[aeiouy]' | wc -l",2
132
+ Count the number of files for each unique file extensions in the /testbed directory tree.,find /testbed -type f | sed -e 's/.*\.//' | sed -e 's/.*\///' | sort | uniq -c | sort -rn,find /testbed -type f | awk -F. '{if (NF>1) print $NF}' | sort | uniq -c | sort -nr,2
133
+ "Count the total number of lines in all ""*.gz"" files in the /testbed directory tree after decompression",find /testbed -type f -name '*.gz' | xargs zcat | wc -l,"find /testbed -type f -name ""*.gz"" -exec sh -c 'gunzip -c ""$0"" | wc -l' {} \; | awk '{s+=$1} END {print s}'",2
134
+ Counts all files in the /testbed folder and subfolders.,find /testbed -type f -exec ls -l {} \; | wc -l,find /testbed -type f | wc -l,1
135
+ Count lines in each *.php file sorted by file in /testbed directory.,find /testbed -name '*.php' -type f | sort | xargs wc -l,"find /testbed -type f -name ""*.php"" -exec wc -l {} + | sort",2
136
+ "Counts lines in each *.php file in /testbed directory, sorted by number of lines, descending.",find /testbed -name '*.php' -type f | xargs wc -l | sort -nr,"find /testbed -type f -name ""*.php"" -exec wc -l {} + | sort -rn",2
137
+ "Counts number of occurences of all ip addresses in '/etc/networks' file, and prints all addresses with number of occurences in a descending order.","grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' /etc/networks | sort | uniq -c | sort -nr","awk '{for (i=1; i<=NF; i++) if ($i ~ /([0-9]{1,3}\.){3}[0-9]{1,3}/) print $i}' /etc/networks | sort | uniq -c | sort -nr",2
138
+ Counts total number of only lines with alphanumeric symbols in all *.php files in the /testbed folder and subfolders.,find /testbed -name '*.php' | xargs cat | awk '/[a-zA-Z0-9]/ {i++} END{print i}',find /testbed -type f -name '*.php' -exec grep -H '.*[[:alnum:]].*' {} + | wc -l,2
139
+ Counts total lines in PHP and JS files in /testbed.,find /testbed -name '*.js' -or -name '*.php' | xargs wc -l | grep 'total' | awk '{print $1}',find /testbed -type f \( -name '*.php' -o -name '*.js' \) -exec wc -l {} + | awk '{s=$1} END {print s}',2
140
+ "Create an empty file ""abc.txt"" in each directory named ""dir1"" under testbed directory.","find /testbed -type d -name ""dir1"" -print | sed 's/$/\/abc.txt/g' | xargs touch","find testbed -type d -name ""dir1"" -exec touch {}/abc.txt \;",2
141
+ Create logs.tar.gz of all older than one day logs of Ubuntu,find /var/log/ -mtime +1 | xargs tar -czvPf /testbed/logs.tar.gz,find /var/log -type f -mtime +1 -exec tar -czvPf /testbed/logs.tar.gz {} +,2
142
+ "Delete files in ""/testbed/dir3/subdir1/subsubdir1/tmp"" that are older than 2 days",find /testbed/dir3/subdir1/subsubdir1/tmp -type f -mtime +2 -print0 | xargs -0 rm -f,find /testbed/dir3/subdir1/subsubdir1/tmp -type f -mtime +2 -delete,2
143
+ Display the 5 largest files in the /testbed directory and its sub-directories.,find /testbed -type f -exec du -b {} + | sort -rh | head -n 5,find /testbed -type f -print0 | xargs -0 du -b | sort -rn | head -n 5,2
144
+ Display the 5 smallest files in the /testbed directory and its sub-directories ignoring any empty files.,find /testbed -type f -size +0c -exec du -b {} + | sort -n | head -n 5,find /testbed -type f -size +0c -exec du -b {} + | sort -rh | tail -n 5,2
145
+ Display the 5 smallest files in the /testbed directory and its sub-directories.,find /testbed -type f -exec ls -s {} \; | sort -n | head -5,find /testbed -type f -exec du -b {} + | sort -n | head -n 5,2
146
+ Display the five biggest file sizes only in the /testbed directory,find /testbed -type f -maxdepth 1 -exec du -b {} + | sort -rh | head -n 5,ls -lS /testbed | grep '^-' | head -n 5,2
147
+ "Find .java files in the testbed directory tree that contain 'Hello', and print their names","find /testbed -name ""*.java"" -exec grep -Hin Hello {} + | cut -d "":"" -f 1 | xargs -I{} basename {}","find testbed -type f -name ""*.java"" -exec grep -l 'Hello' {} +",2
148
+ Print a list of all duplicate case insensitive filenames in the /testbed directory tree,find /testbed -type f | awk -F/ '{print $NF}' | sort -f | uniq -i -d,find /testbed -type f | awk -F/ '{print tolower($NF)}' | sort | uniq -d,2
149
+ "Print all unique file paths under ""testbed/dir1"" compared to ""testbed/dir2""",comm -23 <(find /testbed/dir1 | sed 's#/testbed/dir1/##' | sort) <(find /testbed/dir2 | sed 's#/testbed/dir2/##' | sort) | sed 's#^#/testbed/dir1/#',comm -23 <(find testbed/dir1 -type f | sed 's|testbed/dir1/||' | sort) <(find testbed/dir2 -type f | sed 's|testbed/dir2/||' | sort) | sed 's|^|testbed/dir1/|',2
150
+ Recursively finds all files containing text 'Hello' in /testbed and prints folder where they are placed.,grep -rl 'Hello' /testbed | xargs -I {} dirname {} | sort | uniq,find /testbed -type f -exec grep -l 'Hello' {} + | xargs -I {} dirname {} | sort | uniq,2
151
+ Prints total number of lines of all *.java files in /testbed folder and subfolders.,find /testbed -name '*.java' -print0 |xargs -0 wc -l|grep 'total' |awk '{ print $1 }',"find /testbed -name ""*.java"" -exec wc -l {} + | awk '{s=$1} END {print s}'",2
152
+ Create a symbolc link in the /testbed/dir3/subdir1/subsubdir1/FooBar to root folder,ln /testbed/dir3/subdir1/subsubdir1/FooBar -s /,ln -s /testbed/dir3/subdir1/subsubdir1/FooBar /,1
153
+ search for all the files in the folder /testbed/dir1 which have sticky bit set and have the permissions 553,find /testbed/dir1 -perm 1553,find /testbed/dir1 -type f -perm 1553,1
154
+ "search for php files in /testbed directory and search for ""world"" in all these files","find /testbed -name '*.php' -exec grep -iq ""world"" {} \; -print","find /testbed -name ""*.php"" -exec grep -H ""world"" {} \;",2
155
+ "Recursively finds all files with any cased text ""Hello"" in the '/system/folder1' folder, and precedes found string with its number in file.","grep -inr ""Hello"" /system/folder1",find /system/folder1 -type f -exec grep -inH 'hello' {} \;,1
156
+ "Recursively finds all files with whole word ""foo"" in the '/system', and precedes found string with its number in file.","grep -rnw /system -e ""foo""",grep -ronw '/system' -e 'foo',1
157
+ Recursively list contents of the '/system' directory in a tree-like format,tree /system,find /system -print | sed -e 's;[^/]*/;|___;g;s;___|; |;g',1
158
+ Recursively print all files and directories in the '/system/folder2' directory tree including hidden files,tree -a /system/folder2,find /system/folder2 -print | sed -e 's;[^/]*/;|___;g;s;___|; |;g',1
159
+ "Recursively prints all folders in the '/system' folder that contain files like ""*.out"".","find /system -type f -name ""*.out"" -print0 | xargs -0 -n1 dirname | sort -u","find /system -type f -name ""*.out"" -printf '%h\n' | sort -u",2
160
+ "Remove all ""*.txt"" files in the '/system' folder and answer ""y"" to any prompt",yes y | rm -r /system/*.txt,"find /system -maxdepth 1 -type f -name ""*.txt"" -exec rm -f {} \;",1
161
+ 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 -delete,2
162
+ "Recursively removes all empty folders under /system/folder3/temp, printing info message on each operation, and suppressing error messages if folder is not empty.",find /system/folder3/temp -type d -empty -exec rmdir -vp --ignore-fail-on-non-empty {} +,find /system/folder3/temp -type d -empty -print -delete 2>/dev/null,2
163
+ 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 ! -name '*.txt' -print -delete,2
164
+ Recursively rename all files under /system/folder2 replacing special with regular.,"find /system/folder2 -type f -name '*special*' ! -path '*/special/*' -execdir bash -c 'mv ""$0"" ""${0/special/regular}""' {} \;","find /system/folder1 -type f -name '*special*' -exec bash -c 'for f; do mv -- ""$f"" ""${f%/*}/${f##*/special/regular}""; done' _ {} +",2
165
+ "Recursively search for ""foo"" in the '/system' folder and write the output to the console followed by the number of matched lines","grep -r ""foo"" /system | tee >(wc -l)","grep -r ""foo"" /system | awk '{print} END {print NR}'",1
166
+ "Recursively search for all regular files below directory ""/system/folder3/"", and output the name of each, without any containing directories.",find /system/folder3/ -type f -exec basename {} \;,find /system/folder3/ -type f | xargs -n 1 basename,1
167
+ "Recursively unzip files to stdout in ""/system/folder2.tar.gz"" and search for ""special""","zcat -r /system/folder2.tar.gz | grep ""special""","tar -xzvf /system/folder2.tar.gz -O | grep ""special""",1
168
+ "Remove ""\r"" at the end of each line in ""system/folder3/temp/temp1/text1.txt"" and display the result as printable characters or backslash escapes",cat /system/folder3/temp/temp1/text1.txt | sed 's/\r$//' | od -c,cat system/folder3/temp/temp1/text1.txt | sed 's/\r$//' | od -c -An,2
169
+ Remove all *.doc files from the /system/folder1 tree,"find /system/folder1 -name '*.doc' -exec rm ""{}"" \;",find /system/folder1 -type f -name '*.doc' -delete,1
170
+ Remove all *.log files from the /system/folder1 tree,find /system/folder1 -name '*.log' -print0 | xargs -0 rm,find /system/folder1 -type f -name '*.log' -delete,2
171
+ Remove all *.txt files in '/system' directory but not in it's subdirectories,find /system -name '*.txt' -maxdepth 1 | xargs rm,find /system -name '*.txt' -maxdepth 1 -delete,1
172
+ 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 {} \;,find /system/folder3/backup_dbg -name '*.sql' -print -mtime +25 -delete,2
173
+ Remove all *.txt files under the /system/folder1 directory modified more than 5 minutes ago,"find /system/folder1 -mmin +5 -type f -name ""*.txt"" -delete","find /system/folder1 -mmin +5 -type f -name ""*.txt"" | xargs rm -f",2
174
+ "Remove all *.txt files, except ""keep.txt"", under /system/folder1 directory modified more than 5 minutes ago. Do not include subdirectories.","find /system/folder1 -maxdepth 1 -mmin +5 -type f -name ""*.txt"" ! -name ""keep.txt"" -delete","find /system/folder1 -maxdepth 1 -mmin +5 -type f -name ""*.txt"" ! -name ""keep.txt"" | xargs rm -f",2
175
+ "Remove all .sh files in the '/system/folder1' tree whose names begin with ""new""",find /system/folder1 -name 'new*.sh' -exec rm -f '{}' \;,find /system/folder1 -name 'new*.sh' -delete,2
176
+ "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 {} \;,"find /system -type f \( -name ""a.out"" -o -name ""*.o"" -o -name ""core"" \) -delete",2
177
+ Print the last five lines of /system/folder1/data.csv,"cat /system/folder1/data.csv | rev | cut -d, -f-5 | rev","tail -n 1 /system/folder1/data.csv | rev | cut -d',' -f1-5 | rev",2
178
+ "Remove all directories called ""temp"" from the /system directory tree","find /system -name ""temp"" -type d -delete","find /system -type d -name ""temp"" -exec rm -rf {} +",1
179
+ Remove all empty files in /system/folder3/temp and below,find /system/folder3/temp -type f -empty -print | xargs rm -f,find /system/folder3/temp -type f -empty -print -delete,2
180
+ Remove all files a.out and *.o in the /system directory tree that were modified less than 7 days ago,find /system \( -name a.out -o -name '*.o' \) -mtime -7 -exec rm {} \;,"find /system -type f \( -name ""a.out"" -o -name ""*.o"" \) -mtime -7 -delete",2
181
+ "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 {} \;,find /system/folder3/temp \( -name '.DS_Store' -or -name '._.DS_Store' -or -name '._*' -or -name '.TemporaryItems' -or -name '.apdisk' \) -delete,2
182
+ "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,echo '1/2 [3] (27/03/2012 19:32:54) word word word word 4/5' | sed 's/([^)]*)//g' | tr -c '0-9' ' ' | column -t,2
183
+ "Remove files text2, text3, text4 in directory /system/folder1",find /system/folder1 -name 'text[2-4]*' -exec rm {} \;,find /system/folder1 -name 'text[2-4]*' -delete,2
184
+ Remove files that are less than 1KB in size under /system directory,find /system -type f -size -1k -exec rm {} +,find /system -type f -size -1k -delete,1
185
+ "Remove files modified more than 31 days ago recursively from ""/system""",find /system -type f -mtime +31 -exec rm -f {} \;,find /system -type f -mtime +31 -delete,1
186
+ "Print ""/system/folder3/temp/temp1/text1.txt"" without newline characters.","paste -sd """" /system/folder3/temp/temp1/text1.txt",tr -d '\n' < /system/folder3/temp/temp1/text1.txt,1
187
+ Remove regular files in the /system directory tree,find /system -type f -exec rm {} +,find /system -type f -delete,1
188
+ Print which files differ between /system/folder1 and /system/folder2.,diff -qr /system/folder1 /system/folder2 | sort,diff -qr /system/folder1 /system/folder2,1
189
+ Print amount of space available on the file system containing path to the /system directory in megabytes.,df -m /system,df -m /system | grep / | tr -s ' ' | cut -d ' ' -f 4,1
190
+ Display the number of sub-directories under /system,find /system -type d | wc -l,tree -d /system | tail -n 1,1
191
+ "Archive all files in /system/folder1 directory modified in the last 60 days to ""/mytarfile.tgz"" with a time of 2023-01-01, owner of 0, and group of 0.",tar --mtime='2023-01-01' --owner=0 --group=0 -czf mytarfile.tgz `find /system/folder1 -mtime -60`,tar --mtime='2023-01-01' --owner=0 --group=0 -czvf mytarfile.tgz `find /system/folder1 -mtime -60`,2
192
+ Create a symbolc link in the /system/folder1 to root folder,ln /system/folder1 -s /,ln -s /system/folder1 /,1
193
+ "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","echo $(date +""%Y-%m-%d~%H:%M:%S"") ""1"" | tee -a /system/folder3/temp/empty.txt",2
194
+ "Concatenate all .txt files residing in the /system tree into a single file ""/system/folder3/temp/concat.txt""","find /system -name ""*.txt"" -not -name ""concat.txt"" -print -exec cat {} \; > /system/folder3/temp/concat.txt","find /system -type f -name ""*.txt"" -not -name ""concat.txt"" -print -exec cat {} \; > /system/folder3/temp/concat.txt",2
195
+ Compresses all the files in the /system folder with default depth to /backup using cpio.,find /system -depth -print | cpio -dump /backup,find /system -print | cpio -dump /backup,1
196
+ Copy all files in the /system directory except those containing 'text' to '/system/folder3/backup_dbg/backup'. Do not include subdirectories.,find /system -maxdepth 1 -type f ! -name '*text*' -exec cp {} /system/folder3/backup_dbg/backup \;,find /system -maxdepth 1 -print -type f ! -name '*text*' -exec cp {} /system/folder3/backup_dbg/backup \;,2
197
+ "Rename ""/system/folder3/temp/temp1"" to ""/system/folder3/temp/temp1_old""",mv /system/folder3/temp/temp1 /system/folder3/temp/temp1_old,cp -r /system/folder3/temp/temp1 /system/folder3/temp/temp1_old && rm -r /system/folder3/temp/temp1,2
198
+ "Dump ""/system/text1.txt"" as ASCII characters",od -t c /system/text1.txt,hexdump -C /system/text1.txt,1
199
+ "Create a compressed archive of /system/folder1 ""compress_folder1.tar.gz"" with a time of 2023-01-01, owner of 0, and group of 0.",tar --mtime='2023-01-01' --owner=0 --group=0 -zcf compress_folder1.tar.gz /system/folder1,tar --mtime='2023-01-01' --owner=0 --group=0 -zcvf compress_folder1.tar.gz /system/folder1,2
200
+ "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,curl -vo /system/textfile.txt http://example.com/textfile.txt,2
201
+ Search in /system downwards all files whose size is greater than 10 bytes.,find /system -size +10c -print,find /system -type f -size +10c,1
202
+ "Calculate the md5sum of each "".txt"" file under ""/system"" and sort the output.",find /system -type f -name '*.txt' -exec md5sum {} + | awk '{print $1}' | sort,"find /system -type f -name ""*.txt"" -exec md5sum {} + | sort",2
203
+ "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}',"grep ""$(hostname)"" /etc/hosts | awk '{print $1}'",2
204
+ Find files in /workspace directory modified within 30 days.,find /workspace -daystart -type f -mtime -30,find /workspace -type f -mtime -30,1
205
+ find files in the /workspace directory with pattern` *.c that larger than 1 Kilobytes,find /workspace -name '*.c' -size +1k -print,find /workspace -name '*.c' -size +1k,1
206
+ "Find files in the /workspace directory and sub-directories, that changed over an hour ago.",find /workspace -type f -cmin +60,find /workspace -type f -cmin +60 -print,1
207
+ "Find files in the /workspace directory and sub-directories, that were accessed over an hour ago.",find /workspace -type f -amin +60,find /workspace -type f -amin +60 -print,1
208
+ list all the drectories present in the /workspace directory and do not search in the sub directories.,find /workspace -maxdepth 1 -type d,find /workspace -maxdepth 1 -type d,1
209
+ list all the files in the /workspace directory which are of size 0 bytes.,find /workspace -empty,find /workspace -empty -print,1
210
+ list all zero-length files under the /workspace directory,find /workspace -empty -exec ls {} \;,find /workspace -type f -size 0,1
211
+ locate and remove large files (> 1 KB) in /workspace,find /workspace -type f -size +1k -delete,find /workspace -type f -size +1k -exec rm {} \;,1
212
+ List all the files in the /workspace directory which have only read permission to the group.,find /workspace -perm 400 -type f -exec ls -l {} \;,find /workspace -perm 400 -ls,1
213
+ List all the files in the /workspace directory which have permissions 777.,find /workspace -perm 777 -type f -exec ls -l {} \;,find /workspace -perm 777 -ls,1
214
+ List the details of all the text files in /workspace directory.,"find /workspace -name ""*.txt"" -exec ls -ld {} \;","find /workspace -name ""*.txt"" | xargs ls -ld",1
215
+ move all files in the /workspace folder to / and do not move the files in the sub folder,find /workspace -maxdepth 1 -type f -exec mv -t / {} +,find /workspace -maxdepth 1 -type f -exec mv {} / \;,2
216
+ Move files in /workspace accessed less than one day ago to directory /.,find /workspace -atime -1 -type f -exec mv {} / \;,find /workspace -type f -atime -1 -print0 | xargs -0 -I {} mv {} /,1
217
+ "print all filenames of files under /workspace/dir1 dir containing 'hello', case-insensitive",find /workspace/dir1 -type f -exec grep -il 'hello' {} \;,grep -ril 'hello' /workspace/dir1,2
218
+ print disk usage of files or folders in /workspace,du -sh /workspace,du -h /workspace,1
219
+ print the last word in /workspace/dir1/long.txt,tac /workspace/dir1/long.txt | awk 'NF{print $NF; exit}',awk '{ for (i=1; i<=NF; i++) last=$i } END { print last }' /workspace/dir1/long.txt,2
220
+ Print the 3 largest directories in /workspace.,du -a /workspace | sort -nr | head -n 3,find /workspace -exec du -h {} + | sort -rh | head -n 3,1
221
+ "prints first line of ""/workspace/dir1/long.txt""",head -n1 /workspace/dir1/long.txt,sed -n '1p' /workspace/dir1/long.txt,1
222
+ "prints the last non-empty line of ""/workspace/dir1/a.txt""",tac /workspace/dir1/a.txt | grep -m 1 '.',awk 'NF' /workspace/dir1/a.txt | tail -n 1,1
223
+ prune all the files in the /workspace directory,find /workspace -type f -delete,find /workspace -type f -exec rm -f {} +,1
224
+ search for all the files in the /workspace directory which have size greater than 1KB (approx) and less than 32KB(approx).,find /workspace -type f -size +1k -size -32k,find /workspace -type f -size +1k -size -32k -print,1
225
+ search for all the files in the /workspace folder and sort them in the order of their depth and display the file names,"find /workspace -type f | awk -F/ '{print NF, $0}' | sort -n","find /workspace -type f | awk -F/ '{print NF, $0}' | sort -n | cut -d' ' -f2-",2
226
+ Search for all the files in the /workspace folder which are bigger than 1KB and display the biggest file.,find /workspace -type f -size +1k -exec ls -ls {} + | sort -n | tail -1,find /workspace -type f -size +1k -exec ls -lh {} + | sort -k 5 -rh | head -n 1,2
227
+ search for text files in the /workspace folder which do not have write access to others,"find /workspace -type f \( -iname ""*.txt"" -not -perm -o=w \)","find /workspace -type f -name ""*.txt"" ! -perm -o=w",2
228
+ "Search for the directory ""mysql"" in the workspace directory.",find /workspace -name mysql -type d,"find workspace -type d -name ""mysql""",1
229
+ Print a list of all duplicate case insensitive filenames in the /workspace directory tree,find /workspace -type f | awk -F/ '{print $NF}' | sort -f | uniq -i -d,find /workspace -type f | awk -F/ '{print tolower($NF)}' | sort | uniq -d,2
230
+ Search for the file old2.txt in the /workspace folder and list its permissions and creation time.,find /workspace -name old2.txt | xargs ls -tl,find /workspace -name old2.txt -print0 | xargs -0 ls -tl,1
231
+ "search for the word ""hello"" in all the regular/normal files in the /workspace folder and display the matched file name","find /workspace -type f | xargs grep -l ""hello""",grep -rnw '/workspace' -e 'hello',1
232
+ Calculate the md5 sum of all files in the /workspace directory with the filename printed first,"find /workspace -type f -exec md5sum {} + | awk '{print $2 "" "" $1}'","find /workspace -type f -print0 | xargs -0 md5sum | awk '{print $2 "" "" $1}'",2
233
+ "Calculate the md5 sum of all files in directory tree ""/workspace""",find /workspace -type f -exec md5sum {} + | sort,find /workspace -type f -exec md5sum {} +,1
234
+ Count the number of unique 3 to 6 character file extensions are in the /workspace directory tree,find /workspace -type f -name '*.*' | awk -F. 'NF>1 {ext=tolower($NF); if (length(ext) >= 3 && length(ext) <= 6) print ext}' | sort | uniq -c | wc -l,"find /workspace -type f -name '*.*' | sed -n 's/.*\.//p' | awk '{print tolower($0)}' | grep -E '^[a-z]{3,6}$' | sort -u | wc -l",2
235
+ "Create a copy of the /workspace directory structure in the /usr directory,",find /workspace -type d -print|sed 's@^@/usr/@'|xargs mkdir -p,find /workspace -type d | cpio -pdm /usr,2
236
+ Display a long listing of the oldest file under '/workspace' directory tree,find /workspace -type f -printf '%T+ %p\n' | sort | head -n 1 | awk '{print $2}' | xargs ls -l,find /workspace -type f -exec stat --format '%Y %n' {} \; | sort -n | head -n 1 | cut -d' ' -f2- | xargs ls -l,2
237
+ Find the largest 2 directories under /workspace directory,find /workspace -type d -print0 | xargs -0 du | sort -n | tail -2 | cut -f2 | xargs -I{} du -sh {},find /workspace -type d -print0 | xargs -0 du | sort -n | tail -2,2
238
+ List all files with their paths that have identical content in /workspace directory,find /workspace -type f | xargs md5sum | sort | uniq -Dw32,find /workspace -type f -print0 | xargs -0 md5sum | sort | uniq -w32 -D,2
239
+ "Make directories for each unique file path in ""/workspace/files.txt""","cat /workspace/files.txt |xargs -I {} dirname ""{}""| sort -u | xargs -I{} mkdir -p ""{}""","cat /workspace/files.txt | xargs -I {} dirname {}| sort -u | xargs -I{} mkdir -p ""{}""",2
240
+ "Print the total disk usage in bytes of all files listed in ""/workspace/files.txt""",cat /workspace/files.txt | xargs du -b | tail -1 | awk '{print $1}',awk '{print $0}' /workspace/files.txt | xargs du -b | awk '{sum += $1} END {print sum}',2
241
+ Unhide all hidden files in the /workspace directory. Do not include subdirectories.,"find /workspace -maxdepth 1 -type f -name '.*' -exec sh -c 'mv ""$0"" ""${0%/\.*}/${0##*/.}""' {} \;","find /workspace -maxdepth 1 -type f -name '.*' -exec sh -c 'mv ""$1"" ""${1%/\.*}/${1##*/.}""' _ {} \;",2
242
+ "Count the number of differing lines in ""/workspace/dir1/long.txt"" and ""/workspace/dir1/terminate.txt""",diff /workspace/dir1/long.txt /workspace/dir1/terminate.txt | grep ^[\>\<] | wc -l,diff /workspace/dir1/long.txt /workspace/dir1/terminate.txt | grep '^>' | wc -l,2
243
+ "Count the number of differing lines in ""/workspace/dir1/terminate.txt"" and ""/workspace/dir1/long.txt"" with 0 lines of unified context",diff -U 0 /workspace/dir1/terminate.txt /workspace/dir1/long.txt | grep -v ^@ | wc -l,diff -U 0 /workspace/dir1/terminate.txt /workspace/dir1/long.txt | grep -v '^@' | wc -l,2
244
+ Counts lines in file /workspace/dir1/a.txt ignoring empty lines and lines with spaces only.,awk '!/^[[:space:]]*$/{++x} END{print x}' /workspace/dir1/a.txt,grep -v '^[[:space:]]*$' /workspace/dir1/a.txt | wc -l,2
245
+ "Create a symbolic link in directory ""~/newlinks"" for each file listed in ""/workspace/results.txt""",cat /workspace/results.txt | xargs -I{} ln -s {} ~/newlinks,cat /workspace/results.txt | xargs -I {} ln -s {} ~/newlinks,2
246
+ Delete all hidden files under /workspace,find /workspace -type f -name '.*' -delete,find /workspace -type f -name '.*' -exec rm -f {} \;,1
247
+ "Display a dump of ""/workspace/dir1/long.txt"" as floating point values of double size",od -t fD /workspace/dir1/long.txt,od -An -t fD /workspace/dir1/long.txt,1
248
+ Display differences between list of files in /workspace/dir1 and /workspace/dir2.,diff <(ls /workspace/dir1) <(ls /workspace/dir2),diff -qr /workspace/dir1 /workspace/dir2,1
249
+ Display the file size of file '/workspace/dir1/sum.c' in bytes,du -sb /workspace/dir1/sum.c | cut -f1,stat -c %s /workspace/dir1/sum.c,1
250
+ Display the last slash-separated part of each filename path in /workspace/dir1/file.txt,rev /workspace/dir1/file.txt | cut -d/ -f1 | rev,awk -F/ '{print $NF}' /workspace/dir1/file.txt,1
251
+ Display the sizes and filepaths of all files/directories in /workspace directory sorted in descending order of size,du /workspace -a -h | sort -hr,du -ah /workspace | sort -rh,1
252
+ Print percentage of the space used on the /workspace directory.,df -k /workspace | tail -1 | awk '{print $5}',df -h /workspace | awk 'NR==2 {print $5}',1
253
+ "Print the contents of ""/workspace/dir1/long.txt"" in reverse order",nl /workspace/dir1/long.txt | sort -nr | cut -b8-,tac /workspace/dir1/long.txt,1
254
+ "Create an empty file ""Icon"" in workspace/ with a carriage return character in the end of its name.",echo $'workspace/Icon\r' | xargs touch,"touch ""workspace/Icon""$'\r'",1
255
+ Create a symbolc link in the /workspace/dir1 to root folder,ln /workspace/dir1 -s /,ln -s /workspace/dir1 /,1
256
+ "Display permissions, user, group, and full path for each file in the /workspace directory tree",tree /workspace -p -u -g -f,find /workspace -type f -exec stat --format '%A %U %G %N' {} \;,1
257
+ Search for 'hello' case insensitively in all files under /workspace directory tree and show the matched lines with their filenames,"find /workspace -type f -print0 | xargs -0 grep -iH ""hello""",grep -ri 'hello' /workspace,2
258
+ Unpack all *.gz archives in the /workspace directory tree,find /workspace -name '*.gz' -print0 | xargs -0 gunzip,find /workspace -type f -name '*.gz' -exec gunzip {} +,2
259
+ "Uncompress ""/workspace/archive.tar.gz"" and extract the archive to ""/backup""",gzip -dc /workspace/archive.tar.gz | tar -xf - -C /backup,tar -xzvf /workspace/archive.tar.gz -C /backup,2
260
+ "Create a symbolic link to ""/workspace/dir1/terminate.txt"" named ""/workspace/test""",ln /workspace/dir1/terminate.txt /workspace/test,ln -s /workspace/dir1/terminate.txt /workspace/test,1
261
+ "Retrieve only build number of current kernel, ie. #104",uname -v | grep -o '#[0-9]\+',uname -r | awk -F'-' '{print $2}',1
262
+ Print reverse lookup for adress 127.0.0.1,dig -x 127.0.0.1,nslookup 127.0.0.1,1
263
+ "List file information of the full path of command ""grep""",ls -ald `which grep`,stat $(which grep),1
264
+ "Extract host name part from ""http://www.google.com""","echo ""http://www.google.com"" | cut -d'/' -f3","echo ""http://www.google.com"" | sed -E 's|https?://([^/]+).*|\1|'",1
265
+ "List environment variables and their values, escaping all semicolons with a backslash.",env | sed 's/;/\\;/g',"while IFS= read -r line; do echo ""${line//;/\\;}""; done < <(env)",1
266
+ Displays a tree of all process alongside their command line arguments.,pstree -a,"ps -eo pid,ppid,cmd --forest",1
267
+ "Create intermediate directories ""dir"" and ""subdir"" as required and create ""subsubdir""",mkdir -p dir/subdir/subsubdir,mkdir -p dir/subdir/subsubdir,1
268
+ "Print numbers 1 through 10 separated by "":""",yes | head -n10 | grep -n . | cut -d: -f1 | paste -sd:,"echo $(seq -s "":"" 1 10)",2
269
+ print all readline bindings,bind -P,bind -P,1
270
+ "list names of bind functions containing ""p""",bind -l | grep p,bind -l | egrep 'p',1
271
+ Save first IP address of domain 'google.com' in 'address' variable and display it,address=$(dig +short google.com | grep -E '^[0-9.]+$' | head -n 1) && echo $address,address=$(dig +short google.com | grep -m 1 '^[0-9]' | head -n 1) && echo $address,2
272
+ "Remove all characters except "";"" and digits from the string "" Hello world;876 """,echo ' Hello world;876 ' | tr -cd ';0-9',"echo "" Hello world;876 "" | sed 's/[^0-9;]//g'",1
273
+ "Remove leading and trailing spaces or tabs from "" Hello world! """,echo ' Hello world! ' | sed -e 's/^[ \t]*//' | sed -e 's/[ \t]*$//',"echo -n "" Hello world! "" | sed 's/^[ \t]*//;s/[ \t]*$//'",2
274
+ "Remove the last 3 characters from ""987654321""",echo 987654321 | rev | cut -c 4- | rev,"echo ""987654321"" | sed 's/...$//'",1
275
+ Print source of the file system containing current working directory.,df . | tail -1 | awk '{print $1}',df -P . | awk 'NR==2 {print $1}',1
276
+ "List all variables (names only) with names containing ""H"".",env | awk -F= '{if($1 ~ /H/) print $1}',env | grep '^[^=]*H[^=]*=' | awk -F= '{print $1}',1
277
+ Print a list of unique users who are logged in,who | cut -d' ' -f1 | sort | uniq,who | awk '{print $1}' | sort | uniq,1
278
+ ping 192.168.1.1,ping -w 1 192.168.1.1,ping -w 1 192.168.1.1,1
279
+ Print a line of 99 '=' characters,seq -s= 100|tr -d '[:digit:]',printf '=%.0s' {1..99},1
280
+ Count number of users logged in,who | awk -F' ' '{print $1}' | sort -u | wc -l,who | wc -l,1
281
+ "Displays calendar of a previous, current and next month for December of 2120 year.",cal -3 12 2120,cal -3 12 2120,1
282
+ "Extract, sort and print only group names from /etc/group.",cut -d: -f1 /etc/group | sort,cut -d: -f1 /etc/group | sort | uniq,1
283
+ Calculate the sum of all the numbers from 1 to 10,seq 10 | jq -s 'add',echo $(( (10 * (10 + 1)) / 2 )),1
284
+ Count the number of files and directories in the entire testbed directory,find /testbed | wc -l,find /testbed -print | wc -l,1
285
+ Print the number of python files in the testbed directory.,"find testbed -type f -name ""*.py"" | wc -l","find testbed -type f -name ""*.py"" -print | wc -l",1
286
+ 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,sort -r /testbed/dir1/textfile1.txt > /testbed/dir1/textfile1_reverse_sorted.txt,2
287
+ Search for all files containing the word 'Shell' in testbed.,find /testbed -type f -exec grep -l 'Shell' {} +,grep -r 'Shell' /testbed,1
288
+ Find all symbolic links in the testbed directory.,find /testbed -type l,find /testbed -type l -print,1
289
+ Get the total size of all files in testbed/ and save it to total_size.txt,du -sh testbed/ | awk '{print $1}' > total_size.txt,du -s testbed/ | awk '{print $1}' > total_size.txt,1
290
+ List all files in the directory /testbed/dir1 and sort them by size in human-readable format,ls -lhS /testbed/dir1,ls -lhS /testbed/dir1,1
291
+ Count the number of lines in files under the directory /testbed/dir2.,grep -rl . /testbed/dir2 | xargs wc -l,find /testbed/dir2 -type f -exec wc -l {} +,1
292
+ Print the name and size of the 3 largest files in the directory /testbed/dir3,find /testbed/dir3 -type f -exec ls -lhS {} + | sort -rh -k5 | head -n 3,find /testbed/dir3 -type f -exec ls -lhS {} + 2>/dev/null | sort -rh -k5 | head -n 3,2
293
+ 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,find /testbed -type f -mmin -120 -print0 | xargs -0 tar -czf /testbed/archive.tar.gz,2
294
+ List all subdirectories of /testbed that are not named subdir1,ls -d /testbed/*/ | grep -v /subdir1/,"find /testbed -mindepth 1 -maxdepth 1 -type d ! -name ""subdir1""",1
295
+ Search for all files that contain the string 'text file' under the directory /testbed,grep -r 'text file' /testbed,grep -rl 'text file' /testbed,1
296
+ Compute the MD5 hash of all files under the directory /testbed and store them in a file named hashes.txt in the same directory,find /testbed -type f -exec md5sum {} + > /testbed/hashes.txt,find /testbed -type f -exec md5sum {} + > /testbed/hashes.txt,2
297
+ Print the last 10 lines of the file /testbed/dir3/subdir1/subsubdir1/textfile3.txt,tail -n 10 /testbed/dir3/subdir1/subsubdir1/textfile3.txt,tail -n 10 /testbed/dir3/subdir1/subsubdir1/textfile3.txt,2
298
+ Print the line number and contents of all lines containing the string 'value3' in the file /testbed/dir1/subdir1/jsonfile1.json,grep -n 'value3' /testbed/dir1/subdir1/jsonfile1.json,grep -n 'value3' /testbed/dir1/subdir1/jsonfile1.json,2
299
+ Find all files in the directory /testbed that have been modified in the last 24 hours and print their path,find /testbed -type f -mtime -1 -print,find /testbed -type f -mtime -1,1
300
+ Search for all the files in /testbed directory and its subdirectories that contain the word 'Hello' and replace it with 'Hi' in-place.,"grep -rl ""Hello"" /testbed | xargs sed -i 's/Hello/Hi/g'",grep -rl 'Hello' /testbed | xargs sed -i 's/Hello/Hi/g',2
301
+ "Display the contents of textfile3.txt and textfile4.txt side by side, with line numbers and a separator between them.",paste <(nl /testbed/dir3/subdir1/subsubdir1/textfile3.txt) <(nl /testbed/dir1/subdir1/textfile4.txt),paste <(nl /testbed/dir3/subdir1/subsubdir1/textfile3.txt) <(nl /testbed/dir1/subdir1/textfile4.txt),2
train.csv ADDED
The diff for this file is too large to render. See raw diff