text
large_stringlengths
242
1.17k
nl
large_stringlengths
13
387
bash
large_stringlengths
1
715
source
large_stringclasses
3 values
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove all *.swp files under current directory ensuring white space safety<|im_end|> <|im_start|>assistant find . -name "*.swp" -print0|xargs ...
Remove all *.swp files under current directory ensuring white space safety
find . -name "*.swp" -print0|xargs -0 rm
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all the files from root folder which have nogroup or noname and dispaly their details.<|im_end|> <|im_start|>assistant find / \ -ls<|im_e...
find all the files from root folder which have nogroup or noname and dispaly their details.
find / \ -ls
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all regular files under current directory tree and replace all '1.2.3.4' with '5.6.7.8' in these files modiying the files in-place<|im_en...
Find all regular files under current directory tree and replace all '1.2.3.4' with '5.6.7.8' in these files modiying the files in-place
find . -type f -exec sed -i "s/1\.2\.3\.4/5.6.7.8/g" {} \
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the full name of the current user<|im_end|> <|im_start|>assistant finger `id -un` | head -1 | cut -d: -f3-<|im_end|>
Print the full name of the current user
finger `id -un` | head -1 | cut -d: -f3-
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print a line of 100 '=' characters<|im_end|> <|im_start|>assistant head -c 100 < /dev/zero | tr '\0' '='<|im_end|>
Print a line of 100 '=' characters
head -c 100 < /dev/zero | tr '\0' '='
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user List the names of all files under current directory<|im_end|> <|im_start|>assistant find . -type f -exec basename {} \;<|im_end|>
List the names of all files under current directory
find . -type f -exec basename {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print amount of space available on the file system containg path to the current working directory human-readable.<|im_end|> <|im_start|>assist...
Print amount of space available on the file system containg path to the current working directory human-readable.
df -Ph $PWD | tail -1 | awk '{ print $3}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Replace all occurrences of 'previousword' with 'newword' in all regular files with '.cpp' extension under '/myprojects' directory tree and mod...
Replace all occurrences of 'previousword' with 'newword' in all regular files with '.cpp' extension under '/myprojects' directory tree and modify them in-place
find /myprojects -type f -name '*.cpp' -print0 | xargs -0 -n 1 sed -i 's/previousword/newword/g'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the contents of "/tmp/nums" as input to "addnums"<|im_end|> <|im_start|>assistant cat /tmp/nums | addnums<|im_end|>
Print the contents of "/tmp/nums" as input to "addnums"
cat /tmp/nums | addnums
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Move files from $sourcePath to $destPath that have not been modified in the last 10 days<|im_end|> <|im_start|>assistant find $sourcePath -typ...
Move files from $sourcePath to $destPath that have not been modified in the last 10 days
find $sourcePath -type f -mtime +10 -name "*.log" -exec mv {} $destPath \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print list of missing files in a Subversion repository.<|im_end|> <|im_start|>assistant svn status | grep '\!' | cut -d\ -f2-<|im_end|>
Print list of missing files in a Subversion repository.
svn status | grep '\!' | cut -d\ -f2-
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Ping every address from 192.168.0.1 to 192.168.0.254 with a timeout of 1 second and filter out no responses<|im_end|> <|im_start|>assistant ec...
Ping every address from 192.168.0.1 to 192.168.0.254 with a timeout of 1 second and filter out no responses
echo $ | xargs -P255 -I% -d" " ping -W 1 -c 1 192.168.0.% | grep -E "[0-1].*?:"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Counts lines in each *.php file.<|im_end|> <|im_start|>assistant wc -l `find . -name "*.php"`<|im_end|>
Counts lines in each *.php file.
wc -l `find . -name "*.php"`
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Search the current directory tree for regular files modified within the past 24 hours whose names do not end with ".DS_Store"<|im_end|> <|im_s...
Search the current directory tree for regular files modified within the past 24 hours whose names do not end with ".DS_Store"
find . -mtime -1 ! -name '.DS_Store' -type f -exec basename {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user run command 'bash --rcfile myfile' as user root<|im_end|> <|im_start|>assistant su -c 'bash --rcfile myfile'<|im_end|>
run command 'bash --rcfile myfile' as user root
su -c 'bash --rcfile myfile'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Calculate the md5 sum of all files in the current directory and formatting the output by removing parenthesis<|im_end|> <|im_start|>assistant ...
Calculate the md5 sum of all files in the current directory and formatting the output by removing parenthesis
find -maxdepth 1 -type f -exec md5sum {} \; | sed 's/[^(]*(\([^)]*\)) =/\1/'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system root user process disk I/O and send an alert if any process exceeds a certain disk I/O threshold during spec...
Create a script to monitor system root user process disk I/O and send an alert if any process exceeds a certain disk I/O threshold during specific hours.
#!/bin/bash threshold="100" current_hour=$(date +'%H') if [ "$current_hour" -ge "8" ] && [ "$current_hour" -le "18" ]; then processes=$(ps aux --sort=-%io | awk 'NR<=5{print $11}') while read -r process; do io_usage=$(iotop -b -n 1 | grep "$process" | awk '{print $10}') if [ "$io_usage" -gt ...
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user wait for a change in "target-directory" before returning<|im_end|> <|im_start|>assistant inotifywait -e attrib target-directory<|im_end|>
wait for a change in "target-directory" before returning
inotifywait -e attrib target-directory
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the current default full path of the "java" executable<|im_end|> <|im_start|>assistant echo "The current default java is $"<|im_end|>
Print the current default full path of the "java" executable
echo "The current default java is $"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a user is in a specific group.<|im_end|> <|im_start|>assistant #!/bin/bash user="your_username" group="your_group" if groups $user ...
Check if a user is in a specific group.
#!/bin/bash user="your_username" group="your_group" if groups $user | grep &>/dev/null '\b$group\b'; then echo "$user is in $group" else echo "$user is not in $group" fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system uptime and send an alert if it exceeds a certain duration.<|im_end|> <|im_start|>assistant #!/bin/bash thre...
Create a script to monitor system uptime and send an alert if it exceeds a certain duration.
#!/bin/bash threshold="1 day" uptime=$(uptime -p) if [[ "$uptime" > "$threshold" ]]; then echo "System uptime has exceeded 1 day: $uptime" | mail -s "High Uptime Alert" user@example.com fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all directories named "D" in the current directory tree and print their parents<|im_end|> <|im_start|>assistant find ./ -type d -name 'D'...
Find all directories named "D" in the current directory tree and print their parents
find ./ -type d -name 'D'|sed 's/D$//'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user display the names without extensions of all the data files in current folder and do not search in sub folders and which have not been changed ...
display the names without extensions of all the data files in current folder and do not search in sub folders and which have not been changed in the last 60 mins
find . -maxdepth 1 -name '*.dat' -type f -cmin +60 -exec basename {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print amount of space available on the file system containing path to the current working directory in megabytes.<|im_end|> <|im_start|>assist...
Print amount of space available on the file system containing path to the current working directory in megabytes.
df . -B MB | tail -1 | awk {'print $4'} | cut -d'%' -f1
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user create a symbolic link named "link" in directory named as value of the variable $2 to a file that named as result of the command `cd \`dirname...
create a symbolic link named "link" in directory named as value of the variable $2 to a file that named as result of the command `cd \`dirname $2\`; pwd`/`basename $2`
ln -s `cd \`dirname $2\`; pwd`/`basename $2` $1/link
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Finds all php processes running in system.<|im_end|> <|im_start|>assistant pstree | grep php<|im_end|>
Finds all php processes running in system.
pstree | grep php
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove filetype suffix from filename<|im_end|> <|im_start|>assistant echo $filename | rev | cut -f 2- -d '.' | rev<|im_end|>
Remove filetype suffix from filename
echo $filename | rev | cut -f 2- -d '.' | rev
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files inside all directories in maximum 2 levels down the /tmp/test directory and print the number of files in each directory and al...
Find all files inside all directories in maximum 2 levels down the /tmp/test directory and print the number of files in each directory and also print the file/directory paths
find /tmp/test/ -maxdepth 2 -mindepth 1 -type d | while read dir; do printf "%s : " "$dir"; find "$dir" -maxdepth 1 -type f | wc -l; find "$dir" -maxdepth 1 -type f ; done;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Prints long listing of content in a root folder, including hidden files, with human-readable sizes, and stores output to '/root/test.out' file...
Prints long listing of content in a root folder, including hidden files, with human-readable sizes, and stores output to '/root/test.out' file.
sudo ls -hal /root/ | sudo bash -c "cat > /root/test.out"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system CPU usage per process and generate reports on CPU utilization.<|im_end|> <|im_start|>assistant #!/bin/bash ...
Create a script to monitor system CPU usage per process and generate reports on CPU utilization.
#!/bin/bash touch /tmp/cpu_usage_report.txt while true; do ps -eo pid,%cpu,cmd --sort=-%cpu | head -n 11 >> /tmp/cpu_usage_report.txt sleep 3600 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all files ending with "js.compiled" in current folder<|im_end|> <|im_start|>assistant find . -type f -name "*.js.compiled"<|im_end|>
find all files ending with "js.compiled" in current folder
find . -type f -name "*.js.compiled"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print only name and login columns of the currently logged in users<|im_end|> <|im_start|>assistant finger -s | awk '{printf;}'<|im_end|>
Print only name and login columns of the currently logged in users
finger -s | awk '{printf;}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user files all files which expect directories and display count of them<|im_end|> <|im_start|>assistant find /usr/share \! -type d wc -l<|im_end|>
files all files which expect directories and display count of them
find /usr/share \! -type d wc -l
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Output lines 16224 to 16482 of 'file', not recommended with large files that contain many lines after the ones needed.<|im_end|> <|im_start|>a...
Output lines 16224 to 16482 of 'file', not recommended with large files that contain many lines after the ones needed.
awk 'NR==16224, NR==16482' file
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Mathematically sum all numbers in "file.txt"<|im_end|> <|im_start|>assistant cat file.txt | xargs | sed -e 's/\ /+/g' | bc<|im_end|>
Mathematically sum all numbers in "file.txt"
cat file.txt | xargs | sed -e 's/\ /+/g' | bc
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user search all jpg,png,jpefg files in the current folder and calculate the total size of them<|im_end|> <|im_start|>assistant find . \ -ls | awk ...
search all jpg,png,jpefg files in the current folder and calculate the total size of them
find . \ -ls | awk '{total += $7} END {print total}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find the sorted and unique parent directory paths appended with : of all the files that are executable by owner under ~/code directory without...
Find the sorted and unique parent directory paths appended with : of all the files that are executable by owner under ~/code directory without descending into hidden directories and redirect the output to the file ~/.codepath
find ~/code -name '.*' -prune -o -type f -a -perm /u+x -printf ':%h\n' |sort |uniq |tr -d '\n' > ~/.codepath
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Generate UUIDs for the files from the current directory tree<|im_end|> <|im_start|>assistant find -printf "%P\n"| sort | xargs -I '{}' bash -c...
Generate UUIDs for the files from the current directory tree
find -printf "%P\n"| sort | xargs -I '{}' bash -c 'echo $ {}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Replace "dummyvalue" with the system IP address in "filename"<|im_end|> <|im_start|>assistant sed -i s/'dummyvalue'/$(hostname -I | head -n1 |...
Replace "dummyvalue" with the system IP address in "filename"
sed -i s/'dummyvalue'/$(hostname -I | head -n1 | awk '{print $1;}')/g filename
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all the regular files in the current folder which have specific word in their name and force delete all these files and save the log to t...
find all the regular files in the current folder which have specific word in their name and force delete all these files and save the log to the file log_del.txt
find ./ -type f -name '*.r*' -print0 | xargs -0 rm -rf &> log_del.txt
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system memory usage trends and forecasts future memory usage based on historical data.<|im_end|> <|im_start|>ass...
Create a script that monitors system memory usage trends and forecasts future memory usage based on historical data.
#!/bin/bash while true; do sar -r | grep -v 'Average' | awk '{print $2,$4}' > /tmp/memory_usage.txt sleep 3600 predict_memory_usage sleep 3600 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system OpenStack instance status and migrate instances when CPU usage is unbalanced across nodes.<|im_end|> <|im_st...
Create a script to monitor system OpenStack instance status and migrate instances when CPU usage is unbalanced across nodes.
#!/bin/bash threshold="10" node_cpu=$(openstack compute service list --service nova-compute | grep 'enabled' | awk '{print $12}') max_cpu=$(echo "$node_cpu" | sort -n | tail -n 1) min_cpu=$(echo "$node_cpu" | sort -n | head -n 1) if [ $(($max_cpu - $min_cpu)) -gt "$threshold" ]; then openstack server migrate --liv...
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Returns the single most recent file in a directory and all subdirectories.<|im_end|> <|im_start|>assistant find $DIR -type f -exec stat --form...
Returns the single most recent file in a directory and all subdirectories.
find $DIR -type f -exec stat --format '%Y :%y %n' "{}" \; | sort -nr | cut -d: -f2- | head -n 1
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Save the list of files in the current directory tree whose names contain "2011" to /tmp/allfiles<|im_end|> <|im_start|>assistant find . -name ...
Save the list of files in the current directory tree whose names contain "2011" to /tmp/allfiles
find . -name '*2011*' -print0 > /tmp/allfiles
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system SSL certificate chain issues and alerts if any issues are found.<|im_end|> <|im_start|>assistant #!/bin/b...
Create a script that monitors system SSL certificate chain issues and alerts if any issues are found.
#!/bin/bash while true; do openssl s_client -connect localhost:443 2>/dev/null | awk '/verify return|depth/{print $1, $2, $3, $4, $5}' sleep 3600 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system SSH connection attempts and logs any failed attempts.<|im_end|> <|im_start|>assistant #!/bin/bash while ...
Create a script that monitors system SSH connection attempts and logs any failed attempts.
#!/bin/bash while true; do grep 'Failed password' /var/log/auth.log sleep 600 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Show all previously typed shell commands, waiting for user interaction after each page of output.<|im_end|> <|im_start|>assistant history | mo...
Show all previously typed shell commands, waiting for user interaction after each page of output.
history | more
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print disk of mount point "/pa/th"<|im_end|> <|im_start|>assistant mount | awk '$3 == "/pa/th" {print $1}'<|im_end|>
Print disk of mount point "/pa/th"
mount | awk '$3 == "/pa/th" {print $1}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Add "Line of text here" on top of each *.py files under current directory<|im_end|> <|im_start|>assistant find . -name \*.py | xargs sed -i '1...
Add "Line of text here" on top of each *.py files under current directory
find . -name \*.py | xargs sed -i '1a Line of text here'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user run command 'bash --rcfile <' as user root with a bash shell<|im_end|> <|im_start|>assistant su -s /bin/bash -c 'bash --rcfile <'<|im_end|>
run command 'bash --rcfile <' as user root with a bash shell
su -s /bin/bash -c 'bash --rcfile <'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Rename all "thumbs" directories to "thumb" in the current directory tree<|im_end|> <|im_start|>assistant find . -type d | awk -F'/' '{print NF...
Rename all "thumbs" directories to "thumb" in the current directory tree
find . -type d | awk -F'/' '{print NF, $0}' | sort -k 1 -n -r | awk '{print $2}' | sed 'p;s/\(.*\)thumbs/\1thumb/' | xargs -n2 mv
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Use ANSI escape codes to make "World" bold from input "Hello World!"<|im_end|> <|im_start|>assistant echo 'Hello World!' | sed $'s/World/\e[1m...
Use ANSI escape codes to make "World" bold from input "Hello World!"
echo 'Hello World!' | sed $'s/World/\e[1m&\e[0m/'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the IP addresses for the current host name<|im_end|> <|im_start|>assistant hostname -I | awk -F" " '{print $1}'<|im_end|>
Print the IP addresses for the current host name
hostname -I | awk -F" " '{print $1}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all the files in current directory of size smaller than 10KB.<|im_end|> <|im_start|>assistant find . -size -10k<|im_end|>
find all the files in current directory of size smaller than 10KB.
find . -size -10k
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user create and list filenames in the archive<|im_end|> <|im_start|>assistant tar cf - $PWD|tar tvf -|awk '{print $6}'|grep -v "/$"<|im_end|>
create and list filenames in the archive
tar cf - $PWD|tar tvf -|awk '{print $6}'|grep -v "/$"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Prints local machine's LAN IP address<|im_end|> <|im_start|>assistant ifconfig `ip route | grep default | head -1 | sed 's/\\\/\2/g'` | grep -...
Prints local machine's LAN IP address
ifconfig `ip route | grep default | head -1 | sed 's/\\\/\2/g'` | grep -oE "\b{3}[0-9]{1,3}\b" | head -1
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Replace " " with " $UID " in the output of "history"<|im_end|> <|im_start|>assistant history | sed "s/ / $UID /"<|im_end|>
Replace " " with " $UID " in the output of "history"
history | sed "s/ / $UID /"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove a leading "machine" from the system host name and save the result to variable "machnum"<|im_end|> <|im_start|>assistant machnum=$(hostn...
Remove a leading "machine" from the system host name and save the result to variable "machnum"
machnum=$(hostname | sed 's/^machine//')
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the path of all the network mounts<|im_end|> <|im_start|>assistant mount | sed -n -e "s/\/\/mynetaddr on \([^ ]*\).*$/\1/p"<|im_end|>
Print the path of all the network mounts
mount | sed -n -e "s/\/\/mynetaddr on \([^ ]*\).*$/\1/p"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to calculate the sum of all numbers from 1 to 100.<|im_end|> <|im_start|>assistant #!/bin/bash sum=0 for ((i=1; i<=100; i++))...
Create a script to calculate the sum of all numbers from 1 to 100.
#!/bin/bash sum=0 for ((i=1; i<=100; i++)); do sum=$((sum + i)) done echo "The sum of numbers from 1 to 100 is: $sum"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the 6th field (delimited by '/') from the paths specified by ~/bin/FilesDvorak/.* files/directories<|im_end|> <|im_start|>assistant find...
Print the 6th field (delimited by '/') from the paths specified by ~/bin/FilesDvorak/.* files/directories
find ~/bin/FilesDvorak/.* -maxdepth 0 | awk -F"/" '{ print $6 }'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Pushes current folder to the directory stack.<|im_end|> <|im_start|>assistant pushd $PWD<|im_end|>
Pushes current folder to the directory stack.
pushd $PWD
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the contents of all file* files under current directory with white space safety in file names<|im_end|> <|im_start|>assistant find . -na...
Print the contents of all file* files under current directory with white space safety in file names
find . -name "file*" -print0 | xargs -0 perl -ple ''
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a specific user exists and create it if it doesn't.<|im_end|> <|im_start|>assistant #!/bin/bash username="username" if ! id -u "$us...
Check if a specific user exists and create it if it doesn't.
#!/bin/bash username="username" if ! id -u "$username" >/dev/null 2>&1; then useradd -m "$username" fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user search all jpg,png,jpefg files in the current folder and calculate the total size of them<|im_end|> <|im_start|>assistant find . \( -iname "*...
search all jpg,png,jpefg files in the current folder and calculate the total size of them
find . \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) -ls | awk '{total += $7} END {print total}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Run the command 'true' with an empty environment variable doFirst<|im_end|> <|im_start|>assistant doFirst="" true<|im_end|>
Run the command 'true' with an empty environment variable doFirst
doFirst="" true
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Removes all files from current folder but 5 newest ones.<|im_end|> <|im_start|>assistant find . -maxdepth 1 -type f -printf '%T@ %p\0' | sort ...
Removes all files from current folder but 5 newest ones.
find . -maxdepth 1 -type f -printf '%T@ %p\0' | sort -r -z -n | awk 'BEGIN { RS="\0"; ORS="\0"; FS="" } NR > 5 { sub("^[0-9]*? ", ""); print }' | xargs -0 rm -f
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system process activity and logs any process creations or terminations.<|im_end|> <|im_start|>assistant #!/bin/b...
Create a script that monitors system process activity and logs any process creations or terminations.
#!/bin/bash while true; do ps -eo pid,ppid,cmd --sort=pid | awk 'NR==1{p=$1;next} $2!=p+1{print "Process with PID " p " terminated"} {p=$1}' ps -eo pid,ppid,cmd --sort=ppid | awk 'NR==1{p=$2;next} $2!=p+1{print "Process with PID " $1 " created"} {p=$2}' sleep 300 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Count the number of open files for PID "$PYTHONPID" every 2 seconds<|im_end|> <|im_start|>assistant watch "ls /proc/$PYTHONPID/fd | wc -l"<|im...
Count the number of open files for PID "$PYTHONPID" every 2 seconds
watch "ls /proc/$PYTHONPID/fd | wc -l"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Preprocess C++ file 'omnitest.cpp' and page interactively through the result.<|im_end|> <|im_start|>assistant g++ omnitest.cpp -E | less<|im_...
Preprocess C++ file 'omnitest.cpp' and page interactively through the result.
g++ omnitest.cpp -E | less
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Delete all shared memory and semaphores for the current user on linux<|im_end|> <|im_start|>assistant ipcs -a | nawk -v u=`whoami` '$5==u &&(|...
Delete all shared memory and semaphores for the current user on linux
ipcs -a | nawk -v u=`whoami` '$5==u &&(||){print "ipcrm -"$1,$2,";"}' | /bin/sh
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Gets IP addresses of all active network interfaces on host.<|im_end|> <|im_start|>assistant ifconfig | grep 'inet' | grep -v '127.0.0.1' | awk...
Gets IP addresses of all active network interfaces on host.
ifconfig | grep 'inet' | grep -v '127.0.0.1' | awk '{print $2}' | sed 's/addr://'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Recursively copies '$1' directory to '$2' directory.<|im_end|> <|im_start|>assistant cp -r $1 $2<|im_end|>
Recursively copies '$1' directory to '$2' directory.
cp -r $1 $2
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find files in a directory and exit the command if the syntax is correct or display invalid command if the syntax is wrong.<|im_end|> <|im_star...
find files in a directory and exit the command if the syntax is correct or display invalid command if the syntax is wrong.
find … -exec sh -c 'trap "echo \$?" EXIT; invalid_command "$0"' {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a specific process is running and display its PID if it is.<|im_end|> <|im_start|>assistant #!/bin/bash process_name="process_name" ...
Check if a specific process is running and display its PID if it is.
#!/bin/bash process_name="process_name" if pgrep -x $process_name >/dev/null; then pid=$(pgrep -x $process_name) echo "$process_name is running with PID: $pid" else echo "$process_name is not running" fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Format the filename and modification time of files starting with t as a table<|im_end|> <|im_start|>assistant stat -c 'File: %n Modified: %y' ...
Format the filename and modification time of files starting with t as a table
stat -c 'File: %n Modified: %y' t* | column -t
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files under current directory and print them by removing the leading ./ in their paths<|im_end|> <|im_start|>assistant find . -type f...
Find all files under current directory and print them by removing the leading ./ in their paths
find . -type f -exec bash -c 'f="{}"; echo "${f:2}"' \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files/directories under current directory with 'FooBar' in their paths and copy them to ~/foo/bar<|im_end|> <|im_start|>assistant fin...
Find all files/directories under current directory with 'FooBar' in their paths and copy them to ~/foo/bar
find . | grep "FooBar" |
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Rename all *.PNG files/directories to *48.png files/directories under current directory<|im_end|> <|im_start|>assistant find . -name '*.PNG' -...
Rename all *.PNG files/directories to *48.png files/directories under current directory
find . -name '*.PNG' -exec bash -c 'git mv {} $/$48.png' \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Displays process tree of 'pppd' process.<|im_end|> <|im_start|>assistant pstree -p `pgrep pppd`<|im_end|>
Displays process tree of 'pppd' process.
pstree -p `pgrep pppd`
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Write the output of "input_prog" to standard output and error on console and as input to command "my_editor"<|im_end|> <|im_start|>assistant i...
Write the output of "input_prog" to standard output and error on console and as input to command "my_editor"
input_prog 2>&1 | tee /dev/tty | my_editor
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all PHP files under current directory that contain only one line<|im_end|> <|im_start|>assistant find . -type f -name '*.php' -exec grep ...
Find all PHP files under current directory that contain only one line
find . -type f -name '*.php' -exec grep -Hcm2 $ {} + | sed -n '/:1$/{s///;p}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a specific file exists and is writable by the group.<|im_end|> <|im_start|>assistant #!/bin/bash file="/path/to/file" if [ -w "$fil...
Check if a specific file exists and is writable by the group.
#!/bin/bash file="/path/to/file" if [ -w "$file" ]; then echo "$file exists and is writable by the group" else echo "$file either does not exist or is not writable by the group" fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files under current directory matching the regex '.*\(\\?\|mod_jk\.log\)\.[0-9]+' in their paths<|im_end|> <|im_start|>assistant find...
Find all files under current directory matching the regex '.*\(\\?\|mod_jk\.log\)\.[0-9]+' in their paths
find -type f -regex '.*\(\\?\|mod_jk\.log\)\.[0-9]+'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all the html files in the current folder and search for a pattern in these files<|im_end|> <|im_start|>assistant find . | grep html$ | xa...
find all the html files in the current folder and search for a pattern in these files
find . | grep html$ | xargs grep <string-to-find>
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Monitor system disk activity every 5 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/bash for ((i=0; i<1...
Monitor system disk activity every 5 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<12; i++)); do sar -d 5 6 sleep 5 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove all the versioned-but-empty directories from a Subversion checkout under current directory<|im_end|> <|im_start|>assistant find . -name...
Remove all the versioned-but-empty directories from a Subversion checkout under current directory
find . -name .svn -type d | while read ss; do dir=$; test $ == 3 && echo "svn rm \"$dir\""; done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find regular files in the current directory that are writable by at least somebody<|im_end|> <|im_start|>assistant find -maxdepth 1 -type f -p...
Find regular files in the current directory that are writable by at least somebody
find -maxdepth 1 -type f -perm /222
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all files in home folder which have been modified exactly 1 day before<|im_end|> <|im_start|>assistant find ~ -mtime 1 -daystart<|im_end|...
find all files in home folder which have been modified exactly 1 day before
find ~ -mtime 1 -daystart
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Save number of lines in '/some/big/file' to 'LINES' variable<|im_end|> <|im_start|>assistant LINES=$<|im_end|>
Save number of lines in '/some/big/file' to 'LINES' variable
LINES=$
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system login attempts and send an alert if any brute force attempts are detected.<|im_end|> <|im_start|>assistant #...
Create a script to monitor system login attempts and send an alert if any brute force attempts are detected.
#!/bin/bash brute_force_attempts=$(grep -i 'failure' /var/log/auth.log | grep 'sshd' | wc -l) if [ "$brute_force_attempts" -gt 10 ]; then echo "Brute force login attempts detected." # Send alert here fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Get the total size in bytes of all files in the current directory tree<|im_end|> <|im_start|>assistant find . -type f | xargs stat --format=%s...
Get the total size in bytes of all files in the current directory tree
find . -type f | xargs stat --format=%s | awk '{s+=$1} END {print s}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system network interface multicast packets and alerts if any interface exceeds a certain threshold.<|im_end|> <|...
Create a script that monitors system network interface multicast packets and alerts if any interface exceeds a certain threshold.
#!/bin/bash threshold=100 while true; do sar -n EDEV 1 1 | grep -w '.*[0-9]' | awk '$(NF-2) > "$threshold" {print $1, $(NF-2)}' sleep 60 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Changes group ownership of 'logdir' to 'loggroup'.<|im_end|> <|im_start|>assistant chgrp loggroup logdir<|im_end|>
Changes group ownership of 'logdir' to 'loggroup'.
chgrp loggroup logdir
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system process file access and logs any attempts to access restricted files.<|im_end|> <|im_start|>assistant #!/...
Create a script that monitors system process file access and logs any attempts to access restricted files.
#!/bin/bash while true; do auditctl -a exit,always -F arch=b64 -S open -F exit=-EACCES -k file_access ausearch -k file_access | grep -i 'access denied' && echo "Restricted file access attempted" sleep 300 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Execute awk command '{ ...}' on compressed file "FILE"<|im_end|> <|im_start|>assistant zcat FILE | awk '{ ...}'<|im_end|>
Execute awk command '{ ...}' on compressed file "FILE"
zcat FILE | awk '{ ...}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Forcibly removes files '/tmp/stored_exception', '/tmp/stored_exception_line', '/tmp/stored_exception_source'<|im_end|> <|im_start|>assistant ...
Forcibly removes files '/tmp/stored_exception', '/tmp/stored_exception_line', '/tmp/stored_exception_source'
rm -f /tmp/stored_exception /tmp/stored_exception_line /tmp/stored_exception_source
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Pushes current folder to the directory stack.<|im_end|> <|im_start|>assistant pushd $<|im_end|>
Pushes current folder to the directory stack.
pushd $
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Replace the first occurrence of "string1" on each line with "string2" in all regular files in the current directory tree<|im_end|> <|im_start|...
Replace the first occurrence of "string1" on each line with "string2" in all regular files in the current directory tree
find ./ -type f -exec sed -i 's/string1/string2/' {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user set alias "mkcd" for command "_{ mkdir -pv $1; cd $1; }; _"<|im_end|> <|im_start|>assistant alias mkcd='_{ mkdir -pv $1; cd $1; }; _'<|im_end|...
set alias "mkcd" for command "_{ mkdir -pv $1; cd $1; }; _"
alias mkcd='_{ mkdir -pv $1; cd $1; }; _'
AnishJoshi/nl2bash-custom