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 Create a script that monitors system GPU power consumption and alerts if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bi...
Create a script that monitors system GPU power consumption and alerts if it exceeds a certain threshold.
#!/bin/bash threshold=200 while true; do nvidia-smi --query-gpu=power.draw --format=csv,noheader | awk '$1 > "$threshold" {print "High GPU power consumption: "$1" W"}' 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 Creates temporary file with file name formatted like /tmp/gnuplot_cmd_$(basename "${0}").XXXXXX.gnuplot and saves path to it in a variable 'gn...
Creates temporary file with file name formatted like /tmp/gnuplot_cmd_$(basename "${0}").XXXXXX.gnuplot and saves path to it in a variable 'gnuplotscript'.
gnuplotscript=$(mktemp /tmp/gnuplot_cmd_$(basename "${0}").XXXXXX.gnuplot)
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 list of files in a directory with their sizes and last access times sorted by size.<|im_end|> <|im_start|>assistant #!/bin/bash ls ...
Print the list of files in a directory with their sizes and last access times sorted by size.
#!/bin/bash ls -l --time-style=long-iso /path/to/your/directory | awk '{print $5, $6, $7, $8, $9}' | sort -n
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 files ~/.android/adbkey and ~/.android/adbkey.pub without prompting.<|im_end|> <|im_start|>assistant rm -f ~/.android/adbkey ~/.androi...
Removes files ~/.android/adbkey and ~/.android/adbkey.pub without prompting.
rm -f ~/.android/adbkey ~/.android/adbkey.pub
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 "dropbox-cli status" every second<|im_end|> <|im_start|>assistant watch -n1 dropbox-cli status<|im_end|>
Execute "dropbox-cli status" every second
watch -n1 dropbox-cli status
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 named "filename" in the current directory tree, not descending into "FOLDER1" directories<|im_end|> <|im_start|>assistant find ...
Find all files named "filename" in the current directory tree, not descending into "FOLDER1" directories
find . '' -print
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 Read the first line of output from "du -s $i" into variable "k" in ksh<|im_end|> <|im_start|>assistant du -s $i | read k<|im_end|>
Read the first line of output from "du -s $i" into variable "k" in ksh
du -s $i | read k
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, calculate their md5sum<|im_end|> <|im_start|>assistant find . -type f -print0 | parallel -0 -X md5sum<...
Find all files under current directory, calculate their md5sum
find . -type f -print0 | parallel -0 -X md5sum
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 DNS records and send alerts when changes are detected (e.g., new records, changes in IP addresses).<|im_end|...
Create a script to monitor system DNS records and send alerts when changes are detected (e.g., new records, changes in IP addresses).
#!/bin/bash dns_server="8.8.8.8" domain="example.com" dig +short @${dns_server} ${domain} | sort > /tmp/current_dns_records.txt echo "" > /tmp/previous_dns_records.txt while true; do dig +short @${dns_server} ${domain} | sort > /tmp/current_dns_records.txt if ! cmp -s /tmp/current_dns_records.txt /tmp/previous...
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 all regular files which path is not dir1 or dir2<|im_end|> <|im_start|>assistant find dir -not \ -type f<|im_end|>
list all regular files which path is not dir1 or dir2
find dir -not \ -type 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 to monitor system thread count and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bas...
Create a script to monitor system thread count and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold="1000" thread_count=$(ps -eLf | wc -l) if [ "$thread_count" -gt "$threshold" ]; then echo "System thread count is too high: $thread_count" | mail -s "High Thread Count 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 set variable r to currently running kernel release, ie. 4.4.0-81-generic<|im_end|> <|im_start|>assistant r="$"<|im_end|>
set variable r to currently running kernel release, ie. 4.4.0-81-generic
r="$"
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 Join data in file1 containing one number per line with data in file2 containing a number and other information per line, keeping the same orde...
Join data in file1 containing one number per line with data in file2 containing a number and other information per line, keeping the same order as it is found in file1.
join -1 2 -2 1 -a1 < < | sort -k2 | cut --complement -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 Create a script that monitors system process memory usage and alerts if any process exceeds a certain threshold.<|im_end|> <|im_start|>assista...
Create a script that monitors system process memory usage and alerts if any process exceeds a certain threshold.
#!/bin/bash threshold=500000 while true; do ps aux | awk '$6 > "$threshold" {print $11, $6}' 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 Make directories "$@" verbosely and replace "mkdir: created directory " with "jar-jar: yea, weesa gotta " in the output<|im_end|> <|im_start|>...
Make directories "$@" verbosely and replace "mkdir: created directory " with "jar-jar: yea, weesa gotta " in the output
mkdir -v "$@" | sed 's/mkdir: created directory /jar-jar: yea, weesa gotta /'
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 DHCP server status and send an alert if the server is down.<|im_end|> <|im_start|>assistant #!/bin/bash dhcp_statu...
Create a script to monitor DHCP server status and send an alert if the server is down.
#!/bin/bash dhcp_status=$(systemctl is-active --quiet isc-dhcp-server) if [ "$dhcp_status" != "active" ]; then echo "DHCP server is down." # 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 Find all files under current directory and run /tmp/clever.sh for each of them with each file path as an argument<|im_end|> <|im_start|>assist...
Find all files under current directory and run /tmp/clever.sh for each of them with each file path as an argument
find . -type f -exec /tmp/clever.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 Find all *.mp4 files under /foo/bar and move them to /some/path<|im_end|> <|im_start|>assistant find /foot/bar/ -name '*.mp4' -exec mv -t /som...
Find all *.mp4 files under /foo/bar and move them to /some/path
find /foot/bar/ -name '*.mp4' -exec mv -t /some/path {} +
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 new MySQL database, user, and grant privileges.<|im_end|> <|im_start|>assistant #!/bin/bash mysql -u root -p <<MYSQL_SCRIPT CREATE D...
Create a new MySQL database, user, and grant privileges.
#!/bin/bash mysql -u root -p <<MYSQL_SCRIPT CREATE DATABASE new_database; CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON new_database.* TO 'new_user'@'localhost'; FLUSH PRIVILEGES; MYSQL_SCRIPT
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 size of each subdirectory in a directory.<|im_end|> <|im_start|>assistant #!/bin/bash directory="/path/to/your/directory" for subd...
Print the size of each subdirectory in a directory.
#!/bin/bash directory="/path/to/your/directory" for subdir in "$directory"/*/; do du -sh "$subdir" 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 regular files in the current directory tree and count them<|im_end|> <|im_start|>assistant find -type f -printf '.' | wc -c<|im_end|>
Find all regular files in the current directory tree and count them
find -type f -printf '.' | wc -c
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 Kill process named "python csp_build.py".<|im_end|> <|im_start|>assistant ps aux | grep 'python csp_build.py' | head -1 | tr -s ' ' | cut -d "...
Kill process named "python csp_build.py".
ps aux | grep 'python csp_build.py' | head -1 | tr -s ' ' | cut -d " " -f2 | xargs kill
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 email queue size and alerts if the queue size exceeds a certain threshold.<|im_end|> <|im_start|>assistan...
Create a script that monitors system email queue size and alerts if the queue size exceeds a certain threshold.
#!/bin/bash threshold=100 while true; do mailq | tail -n +2 | wc -l | awk '$1 > "$threshold" {print "Email queue size: "$1}' 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 Check if "/path/to/file" exists on remote host "host"<|im_end|> <|im_start|>assistant ssh host "test -e /path/to/file"<|im_end|>
Check if "/path/to/file" exists on remote host "host"
ssh host "test -e /path/to/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 Recursively finds all files containing text 'OPEN' and prints folder where they are placed.<|im_end|> <|im_start|>assistant grep -r OPEN * | a...
Recursively finds all files containing text 'OPEN' and prints folder where they are placed.
grep -r OPEN * | awk '{split; print path[1]}' | xargs -I{} dirname {}
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 Convert all m4a sound files in a directory and its subdirectories to mp3 files<|im_end|> <|im_start|>assistant find . -type f -name '*.m4a' -e...
Convert all m4a sound files in a directory and its subdirectories to mp3 files
find . -type f -name '*.m4a' -exec bash -c 'avconv -i "$0" "${0/%m4a/mp3}"' '{}' \;
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 'git pull' in every subdirectory of the current directory<|im_end|> <|im_start|>assistant find . -mindepth 1 -maxdepth 1 -type d -print -e...
Run 'git pull' in every subdirectory of the current directory
find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} pull \;
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 directory exists and has setgid bit set recursively.<|im_end|> <|im_start|>assistant #!/bin/bash directory="/path/to/dire...
Check if a specific directory exists and has setgid bit set recursively.
#!/bin/bash directory="/path/to/directory" if [ -d "$directory" ] && [ $(find "$directory" ! -perm -2000) ]; then echo "Directory exists and has setgid bit set" else echo "Directory either does not exist or does not have setgid bit set" 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 Check if a string contains only digits and special characters.<|im_end|> <|im_start|>assistant #!/bin/bash string="123!@#" if [[ "$string" =...
Check if a string contains only digits and special characters.
#!/bin/bash string="123!@#" if [[ "$string" =~ ^[0-9!@#]+$ ]]; then echo "$string contains only digits and special characters" else echo "$string does not contain only digits and special characters" 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 Attaches to a 'session name' tmux session.<|im_end|> <|im_start|>assistant tmux attach -t <session name><|im_end|>
Attaches to a 'session name' tmux session.
tmux attach -t <session name>
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 Measure the execution time of the command: find /usr/src -name "*.html" -exec grep -H "foo" {} ';' | wc -l<|im_end|> <|im_start|>assistant tim...
Measure the execution time of the command: find /usr/src -name "*.html" -exec grep -H "foo" {} ';' | wc -l
time find /usr/src -name "*.html" -exec grep -H "foo" {} ';' | 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 Find all *.php and *.js files under /home/jul/here excluding /home/jul/here/exclude/* paths<|im_end|> <|im_start|>assistant find /home/jul/...
Find all *.php and *.js files under /home/jul/here excluding /home/jul/here/exclude/* paths
find /home/jul/here -type f \ ! -path "/home/jul/here/exclude/*"
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 absolute path of "$path" whose parents exist to variable "abspath"<|im_end|> <|im_start|>assistant abspath=$(readlink -f $path)<|im_end|>
Save absolute path of "$path" whose parents exist to variable "abspath"
abspath=$(readlink -f $path)
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 all SGID and SUID files in entire file system<|im_end|> <|im_start|>assistant find / -type f \ -ls<|im_end|>
List all SGID and SUID files in entire file system
find / -type f \ -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 display all the files in the current folder excluding those that are present in the folder "secret"<|im_end|> <|im_start|>assistant find . \ -...
display all the files in the current folder excluding those that are present in the folder "secret"
find . \ -o -print
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 duplicate lines in "file_name" and print the output on stdout<|im_end|> <|im_start|>assistant awk '{print(NR"\t"$0)}' file_name | sort ...
Remove duplicate lines in "file_name" and print the output on stdout
awk '{print(NR"\t"$0)}' file_name | sort -t$'\t' -k2,2 | uniq --skip-fields 1 | sort -k1,1 -t$'\t' | cut -f2 -d$'\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 Repeat "image.png" 10 times on a single line<|im_end|> <|im_start|>assistant echo $(yes image.png | head -n10)<|im_end|>
Repeat "image.png" 10 times on a single line
echo $(yes image.png | head -n10)
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 list of files in a directory with their sizes and last modification times sorted by size and last modification time in reverse order...
Print the list of files in a directory with their sizes and last modification times sorted by size and last modification time in reverse order.
#!/bin/bash ls -l --time-style=long-iso /path/to/your/directory | awk '{print $5, $6, $7, $8, $9}' | sort -k 5,5nr -k 7,7
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 three largest files by size in current folder<|im_end|> <|im_start|>assistant find . -type f -exec ls -s {} + | sort -n -r | head ...
display the three largest files by size in current folder
find . -type f -exec ls -s {} + | sort -n -r | head -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 Adds execution permissions on a script ./etc/bash_completion within Homebrew home folder path.<|im_end|> <|im_start|>assistant chmod +x $/etc/...
Adds execution permissions on a script ./etc/bash_completion within Homebrew home folder path.
chmod +x $/etc/bash_completion
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 .txt files in the current directory tree and edit them with `vim'<|im_end|> <|im_start|>assistant find . -name "*.txt" | xargs vim<|i...
Find all .txt files in the current directory tree and edit them with `vim'
find . -name "*.txt" | xargs vim
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 .py files in the current directory except "setup.py" and those beginning with "test_"<|im_end|> <|im_start|>assistant find . -maxdept...
Find all .py files in the current directory except "setup.py" and those beginning with "test_"
find . -maxdepth 1 -mindepth 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 Recursively removes all files like any-cased '*.pyc' in a current folder.<|im_end|> <|im_start|>assistant find . -iname '*.pyc' -print0 | xarg...
Recursively removes all files like any-cased '*.pyc' in a current folder.
find . -iname '*.pyc' -print0 | xargs -0 --no-run-if-empty 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 Immediately display unique entries from access.log<|im_end|> <|im_start|>assistant tail -f access.log | stdbuf -oL cut -d ' ' -f1 | uniq<|im_e...
Immediately display unique entries from access.log
tail -f access.log | stdbuf -oL cut -d ' ' -f1 | uniq
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 redirect output inside screen session<|im_end|> <|im_start|>assistant screen /bin/bash -c 'java Foo > foo.txt'<|im_end|>
redirect output inside screen session
screen /bin/bash -c 'java Foo > foo.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 find all the empty in the current folder do not search in sub directories<|im_end|> <|im_start|>assistant find . -maxdepth 1 -type d -empty<|i...
find all the empty in the current folder do not search in sub directories
find . -maxdepth 1 -type d -empty
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 files with a txt extension under current directory<|im_end|> <|im_start|>assistant find . -type f -name "*.txt" | xargs -I {} ks...
Remove all files with a txt extension under current directory
find . -type f -name "*.txt" | xargs -I {} ksh -c "echo deleting {}; 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 Display inputfile all on one line<|im_end|> <|im_start|>assistant awk 1 ORS=' ' file<|im_end|>
Display inputfile all on one line
awk 1 ORS=' ' 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 Rename .jpg files to .jpeg in all level 2 subdirectories of the current directory<|im_end|> <|im_start|>assistant find -maxdepth 3 -mindepth 3...
Rename .jpg files to .jpeg in all level 2 subdirectories of the current directory
find -maxdepth 3 -mindepth 3 -type f -iname '*.jpg' -exec rename -n 's/jpg$/jpeg/i' {} +
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 total lines in PHP and JS files.<|im_end|> <|im_start|>assistant find . -name '*.js' -or -name '*.php' | xargs wc -l | grep 'total' | ...
Counts total lines in PHP and JS files.
find . -name '*.js' -or -name '*.php' | xargs wc -l | grep 'total' | awk '{ SUM += $1; print $1} END { print "Total text lines in PHP and JS",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 search for all the files in current folder and display all the file names separated by space<|im_end|> <|im_start|>assistant find . | awk '{pr...
search for all the files in current folder and display all the file names separated by space
find . | awk '{printf "%s ", $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 Login to "user@host" with key "keyFile" and execute "./script arg1 arg2 > output.txt 2>&1" in the background<|im_end|> <|im_start|>assistant s...
Login to "user@host" with key "keyFile" and execute "./script arg1 arg2 > output.txt 2>&1" in the background
ssh -i keyFile user@host bash -c "\"nohup ./script arg1 arg2 > output.txt 2>&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 Send each byte in "/home/cscape/Desktop/table.sql" to awk<|im_end|> <|im_start|>assistant fold -1 /home/cscape/Desktop/table.sql | awk '{prin...
Send each byte in "/home/cscape/Desktop/table.sql" to awk
fold -1 /home/cscape/Desktop/table.sql | awk '{print $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 display all the mp4 and flv files in a folder along with their timestamps in the sorted order of time<|im_end|> <|im_start|>assistant find /st...
display all the mp4 and flv files in a folder along with their timestamps in the sorted order of time
find /storage -type f \ -printf '%T@ %p\0' | sort -zn)
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 "R -e \"install.packages\"" as user root with a full login simulation<|im_end|> <|im_start|>assistant sudo su - -c "R -e \"install...
run command "R -e \"install.packages\"" as user root with a full login simulation
sudo su - -c "R -e \"install.packages\""
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 names and sizes of regular files residing in the "tmp" directory tree<|im_end|> <|im_start|>assistant find tmp -type f -printf "%s %...
Print the names and sizes of regular files residing in the "tmp" directory tree
find tmp -type f -printf "%s %p\n" | awk '{sub(/^[^ ]+/,sprintf("f %10d",$1))}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 Set variable 'path' to name of current directory converted to lowercase.<|im_end|> <|im_start|>assistant path=$(basename $ | awk '{print tolo...
Set variable 'path' to name of current directory converted to lowercase.
path=$(basename $ | awk '{print tolower}')
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 'Empty dir' if $some_dir is empty<|im_end|> <|im_start|>assistant if find "`echo "$some_dir"`" -maxdepth 0 -empty | read v; then echo "E...
Print 'Empty dir' if $some_dir is empty
if find "`echo "$some_dir"`" -maxdepth 0 -empty | read v; then echo "Empty dir"; 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 check if a given number is even or odd.<|im_end|> <|im_start|>assistant #!/bin/bash check_even_odd() { num="$1" if...
Create a script to check if a given number is even or odd.
#!/bin/bash check_even_odd() { num="$1" if [ $((num % 2)) -eq 0 ]; then echo "$num is even" else echo "$num is odd" fi } check_even_odd 7
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 Apache access logs and send an alert if any suspicious requests are detected.<|im_end|> <|im_start|>assistant #!/bi...
Create a script to monitor Apache access logs and send an alert if any suspicious requests are detected.
#!/bin/bash suspicious_requests=$(tail -n 100 /var/log/apache2/access.log | grep -i 'wp-admin' | wc -l) if [ "$suspicious_requests" -gt "10" ]; then echo "Suspicious requests detected in Apache access logs." | mail -s "Apache Suspicious Requests 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 Rename all files in the current directory starting with "fgh" to start with "jkl"<|im_end|> <|im_start|>assistant for f in fgh*; do mv "$f" $;...
Rename all files in the current directory starting with "fgh" to start with "jkl"
for f in fgh*; do mv "$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 Find all *.txt files/directories under current directory and execute the python script hello.py for each of them with the file path as an argu...
Find all *.txt files/directories under current directory and execute the python script hello.py for each of them with the file path as an argument to the script
find . -name "*.txt" | python hello.py
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 Modify interval to 0.1 seconds for the watch command<|im_end|> <|im_start|>assistant watch -n 0.1<|im_end|>
Modify interval to 0.1 seconds for the watch command
watch -n 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 Make a directory structure same as the current directory tree under /tmp/tar_root directory<|im_end|> <|im_start|>assistant for i in `find . -...
Make a directory structure same as the current directory tree under /tmp/tar_root directory
for i in `find . -type d`; do mkdir -p /tmp/tar_root/`echo $i|sed 's/\.\///'`; 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 Move all *$lower1* files/directories under current directory to paths formed by replacing the match of $lower1 with $lower2 in their paths<|im...
Move all *$lower1* files/directories under current directory to paths formed by replacing the match of $lower1 with $lower2 in their paths
find . -name "*$lower1*" -exec bash -c 'mv "$1" "${1/$2/$3}"' -- {} $lower1 $lower2 \;
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 Copy specific sub-directories "company1/" and "company1/unique_folder1" from "user@server.com:/path/to/old/data/" to "/path/to/new/data" via s...
Copy specific sub-directories "company1/" and "company1/unique_folder1" from "user@server.com:/path/to/old/data/" to "/path/to/new/data" via ssh
rsync -avzn --list-only --include 'company1/' --include 'company1/unique_folder1/***' --exclude '*' -e ssh user@server.com:/path/to/old/data/ /path/to/new/data
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, calculate their md5sum and print each of the hash and file name to filename-hash.md5 files<|im_end|> <...
Find all files under current directory, calculate their md5sum and print each of the hash and file name to filename-hash.md5 files
find . -type f | while read f; do g=`md5sum $f | awk '{print $1}'`; echo "$g $f"> $f-$g.md5; 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 Generates default-formatted file name of temporary file in a /dev/mapper folder, and saves path to it in a variable 'MAPPER'.<|im_end|> <|im_s...
Generates default-formatted file name of temporary file in a /dev/mapper folder, and saves path to it in a variable 'MAPPER'.
MAPPER=$
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 Unzip and extract "*\ [^ =]\+=.*" from "input.gz"<|im_end|> <|im_start|>assistant zcat input.gz | sed -n 's/.*\ [^ =]\+=.*/\1/p'<|im_end|>
Unzip and extract "*\ [^ =]\+=.*" from "input.gz"
zcat input.gz | sed -n 's/.*\ [^ =]\+=.*/\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 Find all files/directories in current directory and execute multiple ANDed commands for each file<|im_end|> <|im_start|>assistant find . -exe...
Find all files/directories in current directory and execute multiple ANDed commands for each file
find . -exec cmd1 \; -exec cmd2 \;
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 setuid files and directories writing the details to /root/suid.txt , and find large files writing the details to /root/big.txt, traversin...
find setuid files and directories writing the details to /root/suid.txt , and find large files writing the details to /root/big.txt, traversing the filesystem just once
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 Execute 'tput setaf 1; echo foo' with color support every 2 seconds<|im_end|> <|im_start|>assistant watch --color 'tput setaf 1; echo foo'<|im...
Execute 'tput setaf 1; echo foo' with color support every 2 seconds
watch --color 'tput setaf 1; echo foo'
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 for the word text in all the python files in the current folder<|im_end|> <|im_start|>assistant find . -iname '*py' -exec grep "text" {...
search for the word text in all the python files in the current folder
find . -iname '*py' -exec grep "text" {} \;
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 Verbosely compresses all files on second and third depth level keeping original files in place.<|im_end|> <|im_start|>assistant bzip2 -kv */*<...
Verbosely compresses all files on second and third depth level keeping original files in place.
bzip2 -kv */*
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 list of all filepattern-*2009* files/directories under data/ to filesOfInterest.txt file<|im_end|> <|im_start|>assistant find data/ -n...
Print a list of all filepattern-*2009* files/directories under data/ to filesOfInterest.txt file
find data/ -name filepattern-*2009* -print > filesOfInterest.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 Delete all the 'test' directories from all directories under maximum 1 level down the current directory that contain directories named 'test' ...
Delete all the 'test' directories from all directories under maximum 1 level down the current directory that contain directories named 'test' and 'live'
find -maxdepth 1 -type d -exec sh -c "cd {} && [ -d test ] && [ -d live ] && rm -rvf test " {} \;
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 extract the content of the file doc.gz and split it into pieces per 1000 lines compressed with gzip<|im_end|> <|im_start|>assistant zcat doc.g...
extract the content of the file doc.gz and split it into pieces per 1000 lines compressed with gzip
zcat doc.gz | split -l 1000 --filter='gzip > $FILE.gz'
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 to the dirs stack directory path of the current script, or current directory path if executed from bash shell.<|im_end|> <|im_start|>as...
Pushes to the dirs stack directory path of the current script, or current directory path if executed from bash shell.
pushd $(dirname $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 Convert "some random\nbytes" to "%" separated hexadecimal byte values<|im_end|> <|im_start|>assistant echo -ne 'some random\nbytes' | xxd -pla...
Convert "some random\nbytes" to "%" separated hexadecimal byte values
echo -ne 'some random\nbytes' | xxd -plain | tr -d '\n' | sed 's/\/%\1/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 Remove all .sh files in the current directory tree whose names begin with "new"<|im_end|> <|im_start|>assistant find . -name "new*.sh" -exec r...
Remove all .sh files in the current directory tree whose names begin with "new"
find . -name "new*.sh" -exec 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 Check if a specific website is reachable and display the HTTP status code.<|im_end|> <|im_start|>assistant #!/bin/bash website="http://exampl...
Check if a specific website is reachable and display the HTTP status code.
#!/bin/bash website="http://example.com" status_code=$(curl -Is $website | head -n 1 | awk '{print $2}') echo "HTTP status code: $status_code"
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 /somefolder matching the extended case insensitive regex '\./$' in their paths<|im_end|> <|im_start|>assistant find -E /s...
Find all files under /somefolder matching the extended case insensitive regex '\./$' in their paths
find -E /somefolder -type f -iregex '\./$'
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 user account creation and send an alert if any new user accounts are created.<|im_end|> <|im_start|>assistan...
Create a script to monitor system user account creation and send an alert if any new user accounts are created.
#!/bin/bash new_users="$(grep -E 'useradd|adduser' /var/log/auth.log | tail -n 5)" if [ -n "$new_users" ]; then echo "New user accounts created: $new_users" | mail -s "New User Account 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 replace the name php_admin_flag to #php_admin_flag in all the .htaccess files in the folder /home/nobody/public_html<|im_end|> <|im_start|>ass...
replace the name php_admin_flag to #php_admin_flag in all the .htaccess files in the folder /home/nobody/public_html
find /home/nobody/public_html -type f -name .htaccess -exec replace "php_admin_flag" "#php_admin_flag" -- {} \;
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 contents of file 'filename' excluding lines starting with # or empty/space-only lines, waiting for user interaction after each pag...
Display the contents of file 'filename' excluding lines starting with # or empty/space-only lines, waiting for user interaction after each page.
grep -v '^$\|^#\|^\s*\#' filename | grep -v "^[[:space:]]*$" | 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 Gets list of IP addresses of all network interfaces.<|im_end|> <|im_start|>assistant /sbin/ifconfig | sed -ne $'/127.0.0.1/ ! { s/^[ \t]*inet...
Gets list of IP addresses of all network interfaces.
/sbin/ifconfig | sed -ne $'/127.0.0.1/ ! { s/^[ \t]*inet[ \t]\\{1,99\\}\\\\{0,1\\}\\[ \t\/].*$/\\2/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 set alias "X" for command "| cut -d' ' -f2"<|im_end|> <|im_start|>assistant alias -g X="| cut -d' ' -f2"<|im_end|>
set alias "X" for command "| cut -d' ' -f2"
alias -g X="| 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 Create a script to monitor system temperature and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bash...
Create a script to monitor system temperature and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold="60" temp=$(sensors | grep 'Core 0' | awk '{print $3}') temp=${temp//[^0-9]/} if [ "$temp" -gt "$threshold" ]; then echo "System temperature is too high: $temp°C" | mail -s "High System Temperature 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 Gets IP addresses of all network interfaces.<|im_end|> <|im_start|>assistant ifconfig | grep ad.*Bc | cut -d: -f2 | awk '{ print $1}'<|im_end|...
Gets IP addresses of all network interfaces.
ifconfig | grep ad.*Bc | cut -d: -f2 | awk '{ 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 Replace all newlines with spaces in standard input<|im_end|> <|im_start|>assistant sed -z 's/\n/ /'g<|im_end|>
Replace all newlines with spaces in standard input
sed -z 's/\n/ /'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 Construction with additional '-exec true' to be used if both commands need to run regardless of their success or failure.<|im_end|> <|im_start...
Construction with additional '-exec true' to be used if both commands need to run regardless of their success or failure.
find . -name "*.txt" \ -exec grep banana {} \;
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 "cats" for command 'konqueror http:'//icanhazcheezburger.com''<|im_end|> <|im_start|>assistant alias cats='konqueror http:'//icanhaz...
set alias "cats" for command 'konqueror http:'//icanhazcheezburger.com''
alias cats='konqueror http:'//icanhazcheezburger.com''
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 recursively all files under current directory tree that contain a colon in the filename<|im_end|> <|im_start|>assistant find . -name \*\:...
Find recursively all files under current directory tree that contain a colon in the filename
find . -name \*\:\*
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 all *.php~ files under current directory to /mydir<|im_end|> <|im_start|>assistant for D in `find . -iname "*.php~"`; do mv ${D} /mydir;...
Move all *.php~ files under current directory to /mydir
for D in `find . -iname "*.php~"`; do mv ${D} /mydir; 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 Continuously send "y" to input of "command-that-asks-for-input"<|im_end|> <|im_start|>assistant yes | command-that-asks-for-input<|im_end|>
Continuously send "y" to input of "command-that-asks-for-input"
yes | command-that-asks-for-input
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 Make directories and parents as needed for each unique second "&" delimited field with " ", ",", and ":" removed in "filetypes.txt"<|im_end|> ...
Make directories and parents as needed for each unique second "&" delimited field with " ", ",", and ":" removed in "filetypes.txt"
mkdir -p `cut -f2 -d"&" filetypes.txt | sed 's/[ ,:]//g' | sort -u`
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 and directories starting from the current directory and excluding hidden files and directories<|im_end|> <|im_start|>assistant ...
Find all files and directories starting from the current directory and excluding hidden files and directories
find . \( ! -regex '.*/\..*' \) | sed '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 Find regular files in the current directory tree that have any executable bits set<|im_end|> <|im_start|>assistant find -L . -type f \<|im_end...
Find regular files in the current directory tree that have any executable bits set
find -L . -type 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 fan speeds and logs any irregularities.<|im_end|> <|im_start|>assistant #!/bin/bash while true; do s...
Create a script that monitors system fan speeds and logs any irregularities.
#!/bin/bash while true; do sensors | grep 'fan' | awk '{print $2}' > /tmp/fan_speed.txt sleep 300 analyze_fan_speed 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 Read a line from standard input into variable "REPLY" with prompt "$*"<|im_end|> <|im_start|>assistant read -p "$*"<|im_end|>
Read a line from standard input into variable "REPLY" with prompt "$*"
read -p "$*"
AnishJoshi/nl2bash-custom