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 Find symlinks in the current directory tree<|im_end|> <|im_start|>assistant find . -type l | xargs ls -ld<|im_end|>
Find symlinks in the current directory tree
find . -type l | xargs ls -ld
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 that are 10MB in size<|im_end|> <|im_start|>assistant find . -size 10M<|im_end|>
Find all files/directories under current directory that are 10MB in size
find . -size 10M
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 FTP server activity and logs any failed login attempts.<|im_end|> <|im_start|>assistant #!/bin/bash whil...
Create a script that monitors system FTP server activity and logs any failed login attempts.
#!/bin/bash while true; do grep 'failed' /var/log/vsftpd.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 Lists tmux sessions.<|im_end|> <|im_start|>assistant tmux list-sessions<|im_end|>
Lists tmux sessions.
tmux list-sessions
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 current directory that were modified less than 1 day ago excluding hidden files and archive them and put the output into th...
Find all files in current directory that were modified less than 1 day ago excluding hidden files and archive them and put the output into the variable file_changed
file_changed=$(find . -depth \ -prune -o -mtime -1 -print | cpio -oav)
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"<|im_end|> <|im_start|>assistant yes | command<|im_end|>
Continuously send "y" to input of "command"
yes | command
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 network traffic every 5 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/bash for ((i=0; i...
Monitor system network traffic every 5 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<12; i++)); do sar -n DEV 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 Create a script to monitor system file changes and send an alert if any critical files are modified.<|im_end|> <|im_start|>assistant #!/bin/ba...
Create a script to monitor system file changes and send an alert if any critical files are modified.
#!/bin/bash critical_files="/etc/passwd /etc/shadow /etc/sudoers" for file in $critical_files; do if [ -f "$file" ]; then checksum=$(md5sum $file | awk '{print $1}') if [ "$checksum" != "$previous_checksum" ]; then echo "Critical file $file has been modified." | mail -s "File Modificat...
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 numbers from 1 to N.<|im_end|> <|im_start|>assistant #!/bin/bash sum_of_numbers() { n="$1" su...
Create a script to calculate the sum of numbers from 1 to N.
#!/bin/bash sum_of_numbers() { n="$1" sum=0 for ((i=1; i<=n; i++)); do sum=$((sum + i)) done echo "$sum" } sum_of_numbers 100
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 a line 19 lines from the line containing PATTERN<|im_end|> <|im_start|>assistant tac | sed -n '/PATTERN/,+19{h;d};x;/^$/!{p;s/.*//};x' ...
prints a line 19 lines from the line containing PATTERN
tac | sed -n '/PATTERN/,+19{h;d};x;/^$/!{p;s/.*//};x' | tac
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 Unsets shell variable 'penultimate'<|im_end|> <|im_start|>assistant unset -v penultimate<|im_end|>
Unsets shell variable 'penultimate'
unset -v penultimate
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 find the sum of digits of a number.<|im_end|> <|im_start|>assistant #!/bin/bash num=12345 sum=0 while [ $num -gt 0 ]; do ...
Create a script to find the sum of digits of a number.
#!/bin/bash num=12345 sum=0 while [ $num -gt 0 ]; do digit=$((num % 10)) sum=$((sum + digit)) num=$((num / 10)) done echo "The sum of digits 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 list of files modified in the last 24 hours sorted by size.<|im_end|> <|im_start|>assistant #!/bin/bash find /path/to/your/director...
Print the list of files modified in the last 24 hours sorted by size.
#!/bin/bash find /path/to/your/directory -type f -mtime -1 -exec du -h {} + | sort -hr
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 time to ping "8.8.8.8" followed by a time stamp if the ping is greater than 50<|im_end|> <|im_start|>assistant ping 8.8.8.8 | awk -F...
Print the time to ping "8.8.8.8" followed by a time stamp if the ping is greater than 50
ping 8.8.8.8 | awk -F"[= ]" '{if {cmd="date"; cmd | getline dt; close ; print $10, dt}}'
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 *.log files from the current directory tree that have been gzipped<|im_end|> <|im_start|>assistant find ./ -name '*.log' | xargs -I...
Remove all *.log files from the current directory tree that have been gzipped
find ./ -name '*.log' | xargs -I{} sh -c "if [ -f {}.gz ]; then rm {}; 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 Print the system load average.<|im_end|> <|im_start|>assistant #!/bin/bash cat /proc/loadavg<|im_end|>
Print the system load average.
#!/bin/bash cat /proc/loadavg
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 string 'nameserver' in all files under /etc<|im_end|> <|im_start|>assistant find /etc -type f -print0 2>/dev/null | xargs -0 gr...
Search for the string 'nameserver' in all files under /etc
find /etc -type f -print0 2>/dev/null | xargs -0 grep --color=AUTO -Hn 'nameserver' 2>/dev/null
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 TCP connection states every 10 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/bash for (...
Monitor system TCP connection states every 10 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<6; i++)); do netstat -s | grep 'connections' >> tcp_connection_states.log sleep 10 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 Calculate the md5 sum of the list of files in the current directory<|im_end|> <|im_start|>assistant find . -maxdepth 1 -type f | md5sum<|im_en...
Calculate the md5 sum of the list of files in the current directory
find . -maxdepth 1 -type f | 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 beginning at the end of the file, prints lines matching /2012/ and exits after first non-matching line<|im_end|> <|im_start|>assistant tac err...
beginning at the end of the file, prints lines matching /2012/ and exits after first non-matching line
tac error.log | awk '{ifprint;else exit}'
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 Reattach to a screen session<|im_end|> <|im_start|>assistant screen -d -r remote-command<|im_end|>
Reattach to a screen session
screen -d -r remote-command
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 Lemon*.mp3 files under current directory and run mplayer with these files<|im_end|> <|im_start|>assistant find . -name 'Lemon*.mp3' -...
Find all Lemon*.mp3 files under current directory and run mplayer with these files
find . -name 'Lemon*.mp3' -print0 | xargs -0 mplayer
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 xception in all *auth*application* files under current directory and count the number of matches<|im_end|> <|im_start|>assistant ze...
Search for xception in all *auth*application* files under current directory and count the number of matches
zegrep "xception" `find . -name '*auth*application*'` | 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 Print a tab separated table in "table.txt" with cell borders<|im_end|> <|im_start|>assistant sed -e 's/\t/_|/g' table.txt | column -t -s '_' ...
Print a tab separated table in "table.txt" with cell borders
sed -e 's/\t/_|/g' table.txt | column -t -s '_' | awk '1;!(NR%1){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 Find all files on local host whose name contains "labra" and copy them to remote host 11.11.11.11 connecting as ssh user "masi" and copying t...
Find all files on local host whose name contains "labra" and copy them to remote host 11.11.11.11 connecting as ssh user "masi" and copying the files to the Desktop directory this user's home directory - this will not work with file/path names containing spaces.
locate labra | xargs -I{} scp '{}' masi@11.11.11.11:~/Desktop/
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 file "$empty_variable"<|im_end|> <|im_start|>assistant gunzip $empty_variable<|im_end|>
Unzip file "$empty_variable"
gunzip $empty_variable
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 lines in "infile"<|im_end|> <|im_start|>assistant sed 's/^/.+/' infile | bc | tail -1<|im_end|>
Mathematically sum all lines in "infile"
sed 's/^/.+/' infile | bc | tail -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 symbolic link named "/usr/bin/openssl" to file "/usr/local/ssl/bin/openssl"<|im_end|> <|im_start|>assistant ln -s "/usr/local/ssl/bin...
create a symbolic link named "/usr/bin/openssl" to file "/usr/local/ssl/bin/openssl"
ln -s "/usr/local/ssl/bin/openssl /usr/bin/openssl
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 number is prime or not.<|im_end|> <|im_start|>assistant #!/bin/bash is_prime() { num="$1" if [ "$num" -...
Create a script to check if a number is prime or not.
#!/bin/bash is_prime() { num="$1" if [ "$num" -le 1 ]; then echo "$num is not a prime number" return fi for ((i=2; i<=num/2; i++)); do if [ $((num % i)) -eq 0 ]; then echo "$num is not a prime number" return fi done echo "$num is a prime 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 Display variable 'var' without leading and trailing whitespace.<|im_end|> <|im_start|>assistant echo $var | awk '{gsub(/^ +| +$/,"")}1'<|im_en...
Display variable 'var' without leading and trailing whitespace.
echo $var | awk '{gsub(/^ +| +$/,"")}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 Run the find command with all positional parameters<|im_end|> <|im_start|>assistant find "$@<|im_end|>
Run the find command with all positional parameters
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 find all the png files in current folder which are present in the pattern list file "search.txt"<|im_end|> <|im_start|>assistant find . -name ...
find all the png files in current folder which are present in the pattern list file "search.txt"
find . -name '*.png' | grep -f <(sed s?^?/[0-9]_[0-9]_[0-9]_? search.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 Archive "myfile" to "/foo/bar/" and create directory "/foo/bar/" if "/foo/" exists<|im_end|> <|im_start|>assistant rsync -a myfile /foo/bar/<|...
Archive "myfile" to "/foo/bar/" and create directory "/foo/bar/" if "/foo/" exists
rsync -a myfile /foo/bar/
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 Synchronize "dir_a" and "dir_b" to contain the latest files in both directories<|im_end|> <|im_start|>assistant rsync -ur dir_a dir_b && rsync...
Synchronize "dir_a" and "dir_b" to contain the latest files in both directories
rsync -ur dir_a dir_b && rsync -ur dir_b dir_a
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 GPU utilization and alerts if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bash...
Create a script that monitors system GPU utilization and alerts if it exceeds a certain threshold.
#!/bin/bash threshold=80 while true; do nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader | awk '$1 > "$threshold" {print "High GPU utilization: "$1"%"}' 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 Set the bash environmental variable "PROMPT_COMMAND" to save the output of the last executed command to variable "LAST" and file '/tmp/x"<|im_...
Set the bash environmental variable "PROMPT_COMMAND" to save the output of the last executed command to variable "LAST" and file '/tmp/x"
PROMPT_COMMAND='LAST="`cat /tmp/x`"; exec >/dev/tty; exec > >'
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 that matches both the case insensitive patterns *$1* and *$2* under /home/musicuser/Music/ directory and execute mplayer for ea...
Find all files that matches both the case insensitive patterns *$1* and *$2* under /home/musicuser/Music/ directory and execute mplayer for each of them
find /home/musicuser/Music/ -type f -iname "*$1*" -iname "*$2*" -exec mplayer {} \;
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 everything except the control characters in "foobar\n\337" and dump the remaining characters<|im_end|> <|im_start|>assistant printf 'fo...
Delete everything except the control characters in "foobar\n\337" and dump the remaining characters
printf 'foobar\n\377' | tr -d '\0-\176' | od -t 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 Create a script to find the sum of all prime numbers up to a given limit.<|im_end|> <|im_start|>assistant #!/bin/bash limit=50 sum=0 echo "Pr...
Create a script to find the sum of all prime numbers up to a given limit.
#!/bin/bash limit=50 sum=0 echo "Prime numbers up to $limit:" for ((num=2; num<=limit; num++)); do is_prime=true for ((i=2; i<=num/2; i++)); do if [ $((num % i)) -eq 0 ]; then is_prime=false break fi done if [ "$is_prime" = true ]; then sum=$((sum + num)...
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 functions defined in the shell<|im_end|> <|im_start|>assistant set | grep " () $" | cut -d' ' -f1<|im_end|>
List all functions defined in the shell
set | grep " () $" | 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 Check if a string contains only whitespace characters.<|im_end|> <|im_start|>assistant #!/bin/bash string=" " if [[ "$string" =~ ^[[:space...
Check if a string contains only whitespace characters.
#!/bin/bash string=" " if [[ "$string" =~ ^[[:space:]]+$ ]]; then echo "$string contains only whitespace characters" else echo "$string does not contain only whitespace 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 Find all files under relative/path/to/dir, calculate their md5sum and redirect the result to sums.md5<|im_end|> <|im_start|>assistant find rel...
Find all files under relative/path/to/dir, calculate their md5sum and redirect the result to sums.md5
find relative/path/to/dir -type f -exec md5sum {} + > sums.md5
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 new line separated numbers from "001" to "100"<|im_end|> <|im_start|>assistant yes | nl -ba | tr ' ' 0 | sed 100q | cut -b 4-6<|im_end|>
Print new line separated numbers from "001" to "100"
yes | nl -ba | tr ' ' 0 | sed 100q | cut -b 4-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 Recursively list all files and directories in "coreutils-8.9" with "DIR: " prepending directory names<|im_end|> <|im_start|>assistant tree -F ...
Recursively list all files and directories in "coreutils-8.9" with "DIR: " prepending directory names
tree -F coreutils-8.9 | sed -r 's|── (.*)/$|── DIR: \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 jpg files in a directory.<|im_end|> <|im_start|>assistant find /home -name '*.jpg<|im_end|>
find all the jpg files in a directory.
find /home -name '*.jpg
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 in the current directory for each .jpg file under "dir"<|im_end|> <|im_start|>assistant ln -s "$" .<|im_end|>
Create a symbolic link in the current directory for each .jpg file under "dir"
ln -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 to check if a number is a palindrome or not.<|im_end|> <|im_start|>assistant #!/bin/bash is_palindrome() { num="$1" r...
Create a script to check if a number is a palindrome or not.
#!/bin/bash is_palindrome() { num="$1" reverse=0 original="$num" while [ "$num" -gt 0 ]; do remainder=$((num % 10)) reverse=$((reverse * 10 + remainder)) num=$((num / 10)) done if [ "$original" -eq "$reverse" ]; then echo "$original is a palindrome" else ...
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 1 level down the current directory and redirect the sorted output to file a<|im_end|> <|im_start|>assistant find . ...
Find all files/directories 1 level down the current directory and redirect the sorted output to file a
find . -maxdepth 1 | sort > a
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 NTP synchronization and generate reports on time drift.<|im_end|> <|im_start|>assistant #!/bin/bash touch /...
Create a script to monitor system NTP synchronization and generate reports on time drift.
#!/bin/bash touch /tmp/ntp_synchronization_report.txt while true; do ntpq -p >> /tmp/ntp_synchronization_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 in current directory that were modified less than 1 day ago excluding hidden files and archive them to /media/caca/extract/ful...
Find all files in current directory that were modified less than 1 day ago excluding hidden files and archive them to /media/caca/extract/full$date.cpio
find . -depth \ -prune -o -print| cpio -aov > /media/caca/extract/full$date.cpio
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 all files with setuid or setgid permissions within a directory.<|im_end|> <|im_start|>assistant #!/bin/bash find /path/to/y...
Print the list of all files with setuid or setgid permissions within a directory.
#!/bin/bash find /path/to/your/directory -perm /6000
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 For each line in 'file', print "result = " followed by the line backwards.<|im_end|> <|im_start|>assistant rev file | awk '{print "result =",$...
For each line in 'file', print "result = " followed by the line backwards.
rev file | awk '{print "result =",$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 bash function definition of "foobar"<|im_end|> <|im_start|>assistant set | grep -A999 '^foobar ' | grep -m1 -B999 '^}'<|im_end|>
Display bash function definition of "foobar"
set | grep -A999 '^foobar ' | grep -m1 -B999 '^}'
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 information on CPU usage.<|im_end|> <|im_start|>assistant top -bn1 | sed -n '/Cpu/p'<|im_end|>
Display information on CPU usage.
top -bn1 | sed -n '/Cpu/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 Change directory to the "lib" directory located two parent directories above the path to command "perl"<|im_end|> <|im_start|>assistant cd $(d...
Change directory to the "lib" directory located two parent directories above the path to command "perl"
cd $(dirname $(dirname $))/lib
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 the current directory whose filenames are not "file.txt", ignoring the case<|im_end|> <|im_start|>assistant find . -maxde...
Find all files under the current directory whose filenames are not "file.txt", ignoring the case
find . -maxdepth 1 -not -iname file.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 Sort all files/directories under current directory according to modification time and print only the recent 7 of them<|im_end|> <|im_start|>as...
Sort all files/directories under current directory according to modification time and print only the recent 7 of them
find -mindepth 1 -printf "%T@ %P\n" | sort -n -r | cut -d' ' -f 2- | tail -n +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 run "tar -xzvf ..." as user $username<|im_end|> <|im_start|>assistant su $username -c tar xzvf ..<|im_end|>
run "tar -xzvf ..." as user $username
su $username -c tar xzvf ..
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 matching "access.log.<number>.gz" incrementing <number>.<|im_end|> <|im_start|>assistant find -name 'access.log.*.gz' | sort ...
Rename all files matching "access.log.<number>.gz" incrementing <number>.
find -name 'access.log.*.gz' | sort -Vr | rename 's//$1+1/ge'
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 find all jpg,png,jpeg,pdf,tif,tiff,bmp and other image formats using regular expressions excluding those ending with "_ocr.pdf"<|im_end|> <|im...
find all jpg,png,jpeg,pdf,tif,tiff,bmp and other image formats using regular expressions excluding those ending with "_ocr.pdf"
find /somepath -type f -iregex ".*\." ! -name "*_ocr.pdf" -print0
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.<|im_end|> <|im_start|>assistant #!/bin/bash directory="/path/to/directory" if [...
Check if a specific directory exists and has setgid bit set.
#!/bin/bash directory="/path/to/directory" if [ -d "$directory" ] && [ $(stat -c %a "$directory" | grep '^2') ]; 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 Disable X11 forwarding and execute "cd yourRemoteDir; ./yourRemoteScript.sh </dev/null >/dev/null 2>&1" in the background on "remoteServer"<|i...
Disable X11 forwarding and execute "cd yourRemoteDir; ./yourRemoteScript.sh </dev/null >/dev/null 2>&1" in the background on "remoteServer"
ssh -x remoteServer "cd yourRemoteDir; ./yourRemoteScript.sh </dev/null >/dev/null 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 Find target.txt files in the /base/path/of/proj/d‌​ata directory tree and pass them as arguments to simpleGrepScript.sh, saving the output as ...
Find target.txt files in the /base/path/of/proj/d‌​ata directory tree and pass them as arguments to simpleGrepScript.sh, saving the output as overallenergy.out
find /base/path/of/proj/d‌​ata -name target.txt | xargs simpleGrepScript.sh > overallenergy.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 Replace "string1" with "string2" in all regular files in the current directory tree<|im_end|> <|im_start|>assistant find ./ -type f -exec sed ...
Replace "string1" with "string2" in all regular files in the current directory tree
find ./ -type f -exec sed -i 's/string1/string2/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 Represent time string $MOD_DATE as seconds since epoch and save to variable 'MOD_DATE1'<|im_end|> <|im_start|>assistant MOD_DATE1=$<|im_end|>
Represent time string $MOD_DATE as seconds since epoch and save to variable 'MOD_DATE1'
MOD_DATE1=$
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 c, cpp files in current folder<|im_end|> <|im_start|>assistant find -regex '.*\.\'<|im_end|>
find all c, cpp files in current folder
find -regex '.*\.\'
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 canonical path of "/usr/bin/java" with "/bin/java" removed to variable "JAVA_HOME"<|im_end|> <|im_start|>assistant JAVA_HOME=$<|im_en...
Save the canonical path of "/usr/bin/java" with "/bin/java" removed to variable "JAVA_HOME"
JAVA_HOME=$
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 "firstWord" with "newFirstWord", "secondWord" with "newSecondWord", "thirdWord" with "newThirdWord" in all XML files in the current di...
Replace "firstWord" with "newFirstWord", "secondWord" with "newSecondWord", "thirdWord" with "newThirdWord" in all XML files in the current directory tree
find -name "*.xml" -exec sed -s --in-place=.bak -e 's/firstWord/newFirstWord/g;s/secondWord/newSecondWord/g;s/thirdWord/newThirdWord/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 Create a script to monitor GPU temperature and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bash t...
Create a script to monitor GPU temperature and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold="80" gpu_temp=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader) if [ "$gpu_temp" -gt "$threshold" ]; then echo "GPU temperature is too high: $gpu_temp°C" | mail -s "High GPU 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 Find all files/directories with 'my key phrase' in their names under current directory, search for 'my key phrase' in all files under current ...
Find all files/directories with 'my key phrase' in their names under current directory, search for 'my key phrase' in all files under current directory and print a sorted and unique list of output
{ find . -name '*my key phrase*'; grep -rl 'my key phrase' .; } | 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 Prints all NS servers of domain google.com.<|im_end|> <|im_start|>assistant dig google.com ns | awk 'p{print $5}/^;; ANSWER SECTION:$/{p=1}/^$...
Prints all NS servers of domain google.com.
dig google.com ns | awk 'p{print $5}/^;; ANSWER SECTION:$/{p=1}/^$/{p=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 Print the current date followed by ' doing stuff'<|im_end|> <|im_start|>assistant echo $ doing stuff<|im_end|>
Print the current date followed by ' doing stuff'
echo $ doing stuff
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 html, javascript and text files in the current folder<|im_end|> <|im_start|>assistant find . -type f \ -print0 | xargs -0 -n1 echo...
display the html, javascript and text files in the current folder
find . -type f \ -print0 | xargs -0 -n1 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 Adjust the timestamp of file $filename by subtracting 2 hours from it<|im_end|> <|im_start|>assistant touch -d "$ - 2 hours" "$filename"<|im_e...
Adjust the timestamp of file $filename by subtracting 2 hours from it
touch -d "$ - 2 hours" "$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 Send SIGTERM to all processes using TCP port 6000 on the system using root account.<|im_end|> <|im_start|>assistant sudo kill -15 $<|im_end|>
Send SIGTERM to all processes using TCP port 6000 on the system using root account.
sudo kill -15 $
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 Archive the directory structure under current directory into dirstructure.tar<|im_end|> <|im_start|>assistant find . -type d -print0 | tar cf ...
Archive the directory structure under current directory into dirstructure.tar
find . -type d -print0 | tar cf dirstructure.tar --null --files-from - --no-recursion
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 new crontab set including $job and only jobs from current crontab that don`t contain $command<|im_end|> <|im_start|>assistant cat <(fgr...
Create new crontab set including $job and only jobs from current crontab that don`t contain $command
cat <(fgrep -i -v "$command" <) < | crontab -
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 uptime and logs a warning if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bash ...
Create a script that monitors system uptime and logs a warning if it exceeds a certain threshold.
#!/bin/bash threshold=30 while true; do uptime | awk -F'up' '{print $2}' | awk '{print $1}' | awk -F, '{print $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 Remove what follows the forth occurrence of the character ":" in any field which contains it<|im_end|> <|im_start|>assistant sed -r 's/({3}):[...
Remove what follows the forth occurrence of the character ":" in any field which contains it
sed -r 's/({3}):[^ \t]*/\1/g' file | 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 Unsets all environment variables with 'G4' in name.<|im_end|> <|im_start|>assistant unset `printenv |grep G4 |awk 'BEGIN{FS="=";}{printf;}'`<|...
Unsets all environment variables with 'G4' in name.
unset `printenv |grep G4 |awk 'BEGIN{FS="=";}{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 Print "operator: " followed by the full name of "${USER}"<|im_end|> <|im_start|>assistant printf "operator: `finger ${USER} | grep Name: | cut...
Print "operator: " followed by the full name of "${USER}"
printf "operator: `finger ${USER} | grep Name: | cut -f3 -d:` \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 Monitor system memory usage and swap activity every 5 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/bas...
Monitor system memory usage and swap activity every 5 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<12; i++)); do vmstat -s >> memory_and_swap.log 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 Recursively copy newer files in "sourcedir/" to "user@dest.com:/dest/dir/" via ssh<|im_end|> <|im_start|>assistant rsync -auv -e ssh --progres...
Recursively copy newer files in "sourcedir/" to "user@dest.com:/dest/dir/" via ssh
rsync -auv -e ssh --progress sourcedir/ user@dest.com:/dest/dir/
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 Dump "input_file" as a 2 byte hexadecimal, character, and octal value and view the contents in "less"<|im_end|> <|im_start|>assistant od -xcb ...
Dump "input_file" as a 2 byte hexadecimal, character, and octal value and view the contents in "less"
od -xcb input_file_name | 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 Save "1 4 6 9 11 17 22" as a bash array "arr"<|im_end|> <|im_start|>assistant read -a arr <<< "1 4 6 9 11 17 22"<|im_end|>
Save "1 4 6 9 11 17 22" as a bash array "arr"
read -a arr <<< "1 4 6 9 11 17 22"
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 currently logged in users.<|im_end|> <|im_start|>assistant #!/bin/bash who<|im_end|>
Print the list of currently logged in users.
#!/bin/bash who
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 SSH banner and send an alert if the SSH banner is modified.<|im_end|> <|im_start|>assistant #!/bin...
Create a script to monitor system root user SSH banner and send an alert if the SSH banner is modified.
#!/bin/bash original_banner="/etc/ssh/sshd_banner" if ! cmp -s "$original_banner" "/etc/motd"; then echo "SSH banner is modified for root user." | mail -s "Root SSH Banner 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 the largest original ".gz" file in the current directory tree<|im_end|> <|im_start|>assistant find . -name '*.gz' -print | xargs gzip -l ...
Find the largest original ".gz" file in the current directory tree
find . -name '*.gz' -print | xargs gzip -l | awk '{ print $2, $4 ;}' | grep -v '$' | sort -n | tail -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 Check if your/dir is empty or not<|im_end|> <|im_start|>assistant [ $ = your/dir ]<|im_end|>
Check if your/dir is empty or not
[ $ = your/dir ]
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 Pick up a list of variable:value pairs from msgs.config and add them to the current shell or script's environment.<|im_end|> <|im_start|>assis...
Pick up a list of variable:value pairs from msgs.config and add them to the current shell or script's environment.
source <( sed 's/:\(.*\)/="\1"/' msgs.config )
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 week day of a 31 day in a current month.<|im_end|> <|im_start|>assistant cal | awk -v date=31 'NR == 2 { split } NR > 2 { for if { pr...
Prints week day of a 31 day in a current month.
cal | awk -v date=31 'NR == 2 { split } NR > 2 { for if { print header[NR == 3 ? i + 7 - NF : i]; exit } }'
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 bind "\C-i" to "complete" function<|im_end|> <|im_start|>assistant bind '"\C-i":complete'<|im_end|>
bind "\C-i" to "complete" function
bind '"\C-i":complete'
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 modified within a fortnight ago to `deploy.txt'<|im_end|> <|im_start|>assistant find . -type f -mtime -14 > deploy.txt<...
Save the list of files modified within a fortnight ago to `deploy.txt'
find . -type f -mtime -14 > deploy.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 Read a single character from standard input into variable "key" without backslash escapes and using an interactive shell with the prompt $'Are...
Read a single character from standard input into variable "key" without backslash escapes and using an interactive shell with the prompt $'Are you sure : ' and default value $'Y'
read -rp $'Are you sure : ' -ei $'Y' key
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 "some_script" on all files in the current directory tree<|im_end|> <|im_start|>assistant find -exec some_script {} \;<|im_end|>
Execute "some_script" on all files in the current directory tree
find -exec some_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 Finds all files with names like "*.rm" in a current folder, launches ffmpeg conversion for each one, and deletes source file after.<|im_end|> ...
Finds all files with names like "*.rm" in a current folder, launches ffmpeg conversion for each one, and deletes source file after.
find . -type f -name "*.rm" -exec ffmpeg -i {} -sameq {}.mp3 \; -exec 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 Count the number of equal lines in "file1.txt" and "file2.txt"<|im_end|> <|im_start|>assistant comm -12 <(sort file1.txt) <(sort file2.txt) | ...
Count the number of equal lines in "file1.txt" and "file2.txt"
comm -12 <(sort file1.txt) <(sort file2.txt) | 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 List all environment variables whose name or value contains current user's login name.<|im_end|> <|im_start|>assistant env | sed -n /"$USERNAM...
List all environment variables whose name or value contains current user's login name.
env | sed -n /"$USERNAME"/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 in the current directory tree whose names end with the suffix ".keep.$1", where $1 is the first command line argument, and remo...
Find all files in the current directory tree whose names end with the suffix ".keep.$1", where $1 is the first command line argument, and remove that suffix
find . -type f -name "*.keep.$1" -print0 | while IFS= read -r -d '' f; do mv -- "$f" "${f%.keep.$1}"; done
AnishJoshi/nl2bash-custom