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 sleep for 10 seconds<|im_end|> <|im_start|>assistant sleep `10`<|im_end|>
sleep for 10 seconds
sleep `10`
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Open all .java files in the current directory tree in the vim editor<|im_end|> <|im_start|>assistant find . -name '*.java' -exec vim {} +<|im_...
Open all .java files in the current directory tree in the vim editor
find . -name '*.java' -exec 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 Create a script that monitors system sudoers configuration and logs any changes to the sudoers file.<|im_end|> <|im_start|>assistant #!/bin/ba...
Create a script that monitors system sudoers configuration and logs any changes to the sudoers file.
#!/bin/bash while true; do cat /etc/sudoers > /tmp/sudoers_backup sleep 3600 if ! cmp -s /tmp/sudoers_backup /etc/sudoers; then echo "Sudoers configuration has been modified" fi rm -f /tmp/sudoers_backup 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 Print numbers from 1 to 10 with 2 values per line<|im_end|> <|im_start|>assistant seq 10 | paste -sd" \n" -<|im_end|>
Print numbers from 1 to 10 with 2 values per line
seq 10 | paste -sd" \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 Creates temporary folder in a $temp_dir folder with name pattern defined by $template, and stores path to created folder in 'my_temp' variable...
Creates temporary folder in a $temp_dir folder with name pattern defined by $template, and stores path to created folder in 'my_temp' variable.
$ my_temp_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 Copy loadable kernel module "mymodule.ko" to the drivers in modules directory matchig current kernel.<|im_end|> <|im_start|>assistant sudo cp ...
Copy loadable kernel module "mymodule.ko" to the drivers in modules directory matchig current kernel.
sudo cp mymodule.ko /lib/modules/$/kernel/drivers/
AnishJoshi/nl2bash-custom
<|im_start|>system 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 xml files under current directory and archive them to .bz2 archives<|im_end|> <|im_start|>assistant find . | grep ".xml$" | parallel ...
Find all xml files under current directory and archive them to .bz2 archives
find . | grep ".xml$" | parallel bzip2
AnishJoshi/nl2bash-custom
<|im_start|>system 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 sizes of all top-level folders in a current folder with human-readable format and descending order.<|im_end|> <|im_start|>assistant du ...
Prints sizes of all top-level folders in a current folder with human-readable format and descending order.
du -h --max-depth=1 . | sort -n -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 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 <
AnishJoshi/nl2bash-custom
<|im_start|>system 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 package manager errors and alerts if any errors are found.<|im_end|> <|im_start|>assistant #!/bin/bash w...
Create a script that monitors system package manager errors and alerts if any errors are found.
#!/bin/bash while true; do grep -i 'error' /var/log/dpkg.log 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 under and below the current working directory with the word California in the file, and count the number of lines in the output...
Find all files under and below the current working directory with the word California in the file, and count the number of lines in the output
find . -type f -exec grep -n California {} \; -print | 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 Archive any files changed in the last day from "remote_host" to "local_dir"<|im_end|> <|im_start|>assistant rsync -av remote_host:'$' local_di...
Archive any files changed in the last day from "remote_host" to "local_dir"
rsync -av remote_host:'$' local_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 Run a shell with all environment variables specified in the file 'cronenv' in the user's home directory.<|im_end|> <|im_start|>assistant env -...
Run a shell with all environment variables specified in the file 'cronenv' in the user's home directory.
env - `cat ~/cronenv` /bin/sh
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Prints all business days in a current month.<|im_end|> <|im_start|>assistant cal -h | cut -c 4-17<|im_end|>
Prints all business days in a current month.
cal -h | cut -c 4-17
AnishJoshi/nl2bash-custom
<|im_start|>system 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 last modification time in reverse order.<|im_end...
Print the list of files in a directory with their sizes and last modification times sorted by 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 7,7r
AnishJoshi/nl2bash-custom
<|im_start|>system 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 "b" to the first word of "a" converted to lowercase.<|im_end|> <|im_start|>assistant b=`echo "$a" | awk '{ print tolower }'`<|im_...
Set variable "b" to the first word of "a" converted to lowercase.
b=`echo "$a" | 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 display all the files in the current folder excluding the current folder and do not search in the sub directories<|im_end|> <|im_start|>assis...
display all the files in the current folder excluding the current folder and do not search in the sub directories
find . -maxdepth 1 -type d \
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Creates temporary folder in a TMPDIR folder or /tmp folder if TMPDIR doesn`t defined, with folder name like current shell name and 10-letter s...
Creates temporary folder in a TMPDIR folder or /tmp folder if TMPDIR doesn`t defined, with folder name like current shell name and 10-letter suffix, and saves created path in 'mydir' variable.
mydir=$(mktemp -d "${TMPDIR:-/tmp/}$.XXXXXXXXXXXX")
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Saves date of the first Sunday in month $mo of year $yo in the 'do' variable.<|im_end|> <|im_start|>assistant do=$<|im_end|>
Saves date of the first Sunday in month $mo of year $yo in the 'do' variable.
do=$
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Output the standard input followed by the line number until line 786<|im_end|> <|im_start|>assistant nl -ba | sed 786q | grep . | awk '{print ...
Output the standard input followed by the line number until line 786
nl -ba | sed 786q | grep . | awk '{print $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 Lists installed packages from 'fedora' repository only.<|im_end|> <|im_start|>assistant yum list installed --disablerepo="*" --enablerepo="f...
Lists installed packages from 'fedora' repository only.
yum list installed --disablerepo="*" --enablerepo="fedora*"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 non-blank lines in a file 'foo.c'<|im_end|> <|im_start|>assistant sed '/^\s*$/d' foo.c | wc -l<|im_end|>
Count non-blank lines in a file 'foo.c'
sed '/^\s*$/d' foo.c | 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 Create a script that monitors system network interface errors, drops, FIFO errors, collisions, TCP retransmission rate, and TCP connection sta...
Create a script that monitors system network interface errors, drops, FIFO errors, collisions, TCP retransmission rate, and TCP connection state and alerts if any interface exceeds a certain threshold.
#!/bin/bash threshold=10 while true; do sar -n EDEV 1 1 | grep -w '.*[0-9]' | awk '$NF > "$threshold" {print $1, $NF}' sar -n SOCK 1 1 | grep -w '.*[0-9]' | awk '$NF > "$threshold" {print $1, $NF}' sar -n COLL 1 1 | grep -w '.*[0-9]' | awk '$NF > "$threshold" {print $1, $NF}' netstat -s | grep 'retran...
AnishJoshi/nl2bash-custom
<|im_start|>system 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 environment variable "_" of the current shell<|im_end|> <|im_start|>assistant set | grep "^_="<|im_end|>
Display environment variable "_" of the current shell
set | grep "^_="
AnishJoshi/nl2bash-custom
<|im_start|>system 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 help on 'cat' command usage<|im_end|> <|im_start|>assistant cat --help<|im_end|>
Print help on 'cat' command usage
cat --help
AnishJoshi/nl2bash-custom
<|im_start|>system 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 exiting the shell on error<|im_end|> <|im_start|>assistant set +e<|im_end|>
Disable exiting the shell on error
set +e
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Generate UUIDs for the files from the current directory tree<|im_end|> <|im_start|>assistant find . -printf "%P\n" | sort | while IFS= read -r...
Generate UUIDs for the files from the current directory tree
find . -printf "%P\n" | sort | while IFS= read -r f; do echo "$ $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 Print nothing because 'MYVAR' string doesn`t match with '/[^/]+:' pattern<|im_end|> <|im_start|>assistant echo MYVAR | grep -oE '/[^/]+:' | cu...
Print nothing because 'MYVAR' string doesn`t match with '/[^/]+:' pattern
echo MYVAR | grep -oE '/[^/]+:' | cut -c2- | rev | cut -c2- | rev
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Gives longest '*.php' files with line count first, and excludes directories with "libs", "tmp", "tests" and "vendor" in their paths.<|im_end|...
Gives longest '*.php' files with line count first, and excludes directories with "libs", "tmp", "tests" and "vendor" in their paths.
find . -name '*.php' | xargs wc -l | sort -nr | egrep -v "libs|tmp|tests|vendor" | 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 search for the file foo in the current folder and display a long listing of it in sorted order of modification date<|im_end|> <|im_start|>ass...
search for the file foo in the current folder and display a long listing of it in sorted order of modification date
find . -name foo | xargs ls -tl
AnishJoshi/nl2bash-custom
<|im_start|>system 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 "595a" into characters and then print the hexadecimal and printable characters of each byte<|im_end|> <|im_start|>assistant echo 595a ...
Convert "595a" into characters and then print the hexadecimal and printable characters of each byte
echo 595a | awk -niord '$0=chr("0x"RT)' RS=.. ORS= | od -tx1c
AnishJoshi/nl2bash-custom
<|im_start|>system 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 days between date $A and $B<|im_end|> <|im_start|>assistant echo " / " | bc -l<|im_end|>
Print days between date $A and $B
echo " / " | bc -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 Replace all newlines except the last with a comma in "test.txt"<|im_end|> <|im_start|>assistant sed -i ':a;N;$!ba;s/\n/,/g' test.txt<|im_end|>
Replace all newlines except the last with a comma in "test.txt"
sed -i ':a;N;$!ba;s/\n/,/g' test.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 List environment variables whose name contains "X"<|im_end|> <|im_start|>assistant set | cut -d= -f1 | grep X<|im_end|>
List environment variables whose name contains "X"
set | cut -d= -f1 | grep X
AnishJoshi/nl2bash-custom
<|im_start|>system 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 from / a file called 'toBeSearched.file', suppressing any error messages<|im_end|> <|im_start|>assistant find /. -name 'toBeSearched.file...
find from / a file called 'toBeSearched.file', suppressing any error messages
find /. -name 'toBeSearched.file' 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 Run sed command "s#\(export\ PATH=\"\)\(.*\)#\1/home/$(whoami)/bin:~/\.local/bin:\2#" on "~/.zshrc" where "$(whoami)" is replaced with the cur...
Run sed command "s#\(export\ PATH=\"\)\(.*\)#\1/home/$(whoami)/bin:~/\.local/bin:\2#" on "~/.zshrc" where "$(whoami)" is replaced with the current user name
sed -i "s#\(export\ PATH=\"\)\(.*\)#\1/home/$(whoami)/bin:~/\.local/bin:\2#" ~/.zshrc
AnishJoshi/nl2bash-custom
<|im_start|>system 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 crons in the environment<|im_end|> <|im_start|>assistant cat /etc/passwd | sed 's/^\([^:]*\):.*$/crontab -u \1 -l 2>\&1/' | grep -v "...
List all crons in the environment
cat /etc/passwd | sed 's/^\([^:]*\):.*$/crontab -u \1 -l 2>\&1/' | grep -v "no crontab for" | 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 Replace each non-blank line in "YOURFILE" preceded with "pX=" where "X" is the line number<|im_end|> <|im_start|>assistant grep -v '^$' YOURFI...
Replace each non-blank line in "YOURFILE" preceded with "pX=" where "X" is the line number
grep -v '^$' YOURFILE | nl -s= -w99 | tr -s ' ' p
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Counts lines in file $file ignoring '//' commented lines, lines with spaces only and empty lines.<|im_end|> <|im_start|>assistant cat $file | ...
Counts lines in file $file ignoring '//' commented lines, lines with spaces only and empty lines.
cat $file | sed '/\/\//d' | sed '/^\s*$/d' | wc -l
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user enable extglob expansion and create symbolic links in "bar2" directory to all files located in "bar1" directory that are not directory and do ...
enable extglob expansion and create symbolic links in "bar2" directory to all files located in "bar1" directory that are not directory and do not have".cc" filename extension
shopt -s extglob; cd bar2; ln -s ../bar1/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 Print each line in "file1" whose first word does not exist as the first word of any line in "file2"<|im_end|> <|im_start|>assistant join -v 1 ...
Print each line in "file1" whose first word does not exist as the first word of any line in "file2"
join -v 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 Saves in 'result' variable list of groups which user $line belongs to, and not matching pattern "_unknown|sciences|everyone|netaccounts"<|im_e...
Saves in 'result' variable list of groups which user $line belongs to, and not matching pattern "_unknown|sciences|everyone|netaccounts"
result=$(groups "$line" | sed 's/ /\n/g' | egrep -v "_unknown|sciences|everyone|netaccounts")
AnishJoshi/nl2bash-custom
<|im_start|>system 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 files in the current folder<|im_end|> <|im_start|>assistant find . -iname "*$@*" -or -iname ".*$@*"<|im_end|>
display all files in the current folder
find . -iname "*$@*" -or -iname ".*$@*"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 *.cls files/directories under current directory and print '{if(length($0) > L) { LINE=$0; L = length($0)}} END {print LINE"L"L}' for ...
Find all *.cls files/directories under current directory and print '{if(length($0) > L) { LINE=$0; L = length($0)}} END {print LINE"L"L}' for each of them where $0 is expanded to the file/directory path
find . -iname "*.cls" -exec echo '{if(length($0) > L) { LINE=$0; L = length($0)}} END {print LINE"L"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 regular files in the current directory tree and count them<|im_end|> <|im_start|>assistant find -type f | wc -l<|im_end|>
Find all regular files in the current directory tree and count them
find -type f | 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 Remount "/system" with read and write permission<|im_end|> <|im_start|>assistant mount -o rw,remount /system<|im_end|>
Remount "/system" with read and write permission
mount -o rw,remount /system
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user split the first 100 lines of the file "datafile" per lines with size 1700 bytes<|im_end|> <|im_start|>assistant sed 100q datafile | split -C 1...
split the first 100 lines of the file "datafile" per lines with size 1700 bytes
sed 100q datafile | split -C 1700 -
AnishJoshi/nl2bash-custom
<|im_start|>system 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 output of history without line numbers<|im_end|> <|im_start|>assistant history | sed 's/^[ ]*[0-9]\+[ ]*//'<|im_end|>
Print the output of history without line numbers
history | sed 's/^[ ]*[0-9]\+[ ]*//'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Prints the Nth line of output from 'ls -1'<|im_end|> <|im_start|>assistant ls -1 | (for () ; do read ; done ; head -n1)<|im_end|>
Prints the Nth line of output from 'ls -1'
ls -1 | (for () ; do read ; done ; head -n1)
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Show global windows options.<|im_end|> <|im_start|>assistant tmux show-options -g<|im_end|>
Show global windows options.
tmux show-options -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 Removes all files from current folder but 5 newest ones.<|im_end|> <|im_start|>assistant rm `ls -t | awk 'NR>5'`<|im_end|>
Removes all files from current folder but 5 newest ones.
rm `ls -t | awk 'NR>5'`
AnishJoshi/nl2bash-custom
<|im_start|>system 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 GPU temperature and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/...
Create a script to monitor system 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 "System GPU temperature exceeds $threshold°C." # 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 Connect to host 'hostname' as user 'username' by forcing host key confirmation<|im_end|> <|im_start|>assistant ssh -o UserKnownHostsFile=/dev/...
Connect to host 'hostname' as user 'username' by forcing host key confirmation
ssh -o UserKnownHostsFile=/dev/null username@hostname
AnishJoshi/nl2bash-custom
<|im_start|>system 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 process tree of user 'user' processes.<|im_end|> <|im_start|>assistant pstree -p user<|im_end|>
Prints process tree of user 'user' processes.
pstree -p user
AnishJoshi/nl2bash-custom
<|im_start|>system 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 TensorFlow Serving model status and trigger reloads when model versions change.<|im_end|> <|im_start|>assist...
Create a script to monitor system TensorFlow Serving model status and trigger reloads when model versions change.
#!/bin/bash model_name="<model_name>" previous_version=$(curl -s "http://tf-serving.example.com/models/$model_name" | jq -r '.model_version') current_version=$(curl -s "http://tf-serving.example.com/models/$model_name" | jq -r '.model_version') if [ "$current_version" != "$previous_version" ]; then curl -X POST "h...
AnishJoshi/nl2bash-custom
<|im_start|>system 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 is palindrome.<|im_end|> <|im_start|>assistant #!/bin/bash string="madam" if [ "$string" == "$(echo "$string" | rev)" ]; t...
Check if a string is palindrome.
#!/bin/bash string="madam" if [ "$string" == "$(echo "$string" | rev)" ]; then echo "$string is a palindrome" else echo "$string is not a palindrome" 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 display all the files in the current folder excluding the file states_to_csv.pl and those that are present in the directories whose name start...
display all the files in the current folder excluding the file states_to_csv.pl and those that are present in the directories whose name starts with ".git"
find . \! -path "./.git*" -a \! -name states_to_csv.pl
AnishJoshi/nl2bash-custom
<|im_start|>system 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 | sed -n '/^foobar ()/,/^}/p'<|im_end|>
Display bash function definition of "foobar"
set | sed -n '/^foobar ()/,/^}/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 Print the top memory-consuming processes.<|im_end|> <|im_start|>assistant #!/bin/bash ps aux --sort -rss | head -n 10<|im_end|>
Print the top memory-consuming processes.
#!/bin/bash ps aux --sort -rss | head -n 10
AnishJoshi/nl2bash-custom
<|im_start|>system 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 symbolic links under the directory "$directory" using contents of the $IFS variable between output of each one<|im_end|> <|im_start|>assi...
list symbolic links under the directory "$directory" using contents of the $IFS variable between output of each one
find $directory -type l -printf "%p$IFS"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 a word in all the .C files in current directory<|im_end|> <|im_start|>assistant find . -type f \ |grep -i -r “keyword”<|im_end|>
search for a word in all the .C files in current directory
find . -type f \ |grep -i -r “keyword”
AnishJoshi/nl2bash-custom
<|im_start|>system 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 actual working directory in variable "target_PWD"<|im_end|> <|im_start|>assistant target_PWD=$<|im_end|>
Save actual working directory in variable "target_PWD"
target_PWD=$
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system memory usage and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bas...
Create a script to monitor system memory usage and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold=80 mem_usage=$(free | grep Mem | awk '{print $3/$2 * 100.0}') if [ "$mem_usage" -gt "$threshold" ]; then echo "Memory usage exceeds $threshold%." # 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 the files that are modified in the last 1 day<|im_end|> <|im_start|>assistant find -mtime +0 -mtime -1<|im_end|>
find all the files that are modified in the last 1 day
find -mtime +0 -mtime -1
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Save the list of .log files in the current directory tree to sas_log_list.txt<|im_end|> <|im_start|>assistant find `pwd` -name "*.log" > sas_l...
Save the list of .log files in the current directory tree to sas_log_list.txt
find `pwd` -name "*.log" > sas_log_list.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 Save the absolute path of the directory of the current script to variable "DIR"<|im_end|> <|im_start|>assistant DIR=$(dirname "$")<|im_end|>
Save the absolute path of the directory of the current script to variable "DIR"
DIR=$(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 Create a script to calculate the perimeter of a rectangle given its length and width.<|im_end|> <|im_start|>assistant #!/bin/bash length=5 wi...
Create a script to calculate the perimeter of a rectangle given its length and width.
#!/bin/bash length=5 width=10 perimeter=$((2 * (length + width))) echo "The perimeter of the rectangle is: $perimeter"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 difference between two strings "$s" and "$r"<|im_end|> <|im_start|>assistant diff < < | awk '/[<>]/{printf $2}'<|im_end|>
Print difference between two strings "$s" and "$r"
diff < < | awk '/[<>]/{printf $2}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all *.ext regular files under /path and execute my_cool_script for each of them with the file path as argument<|im_end|> <|im_start|>assi...
Find all *.ext regular files under /path and execute my_cool_script for each of them with the file path as argument
find /path -type f -name '*.ext' -exec my_cool_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 find all files ending with "js.compiled" in current folder and rename them.<|im_end|> <|im_start|>assistant find . -name "*.js.compiled" -exec...
find all files ending with "js.compiled" in current folder and rename them.
find . -name "*.js.compiled" -exec rename -v 's/\.compiled$//' {} +
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Search the /Path directory tree for files whose pathnames match "/Path/bar*" or "/Path/foo*" and whose names match pattern "file_name*"<|im_en...
Search the /Path directory tree for files whose pathnames match "/Path/bar*" or "/Path/foo*" and whose names match pattern "file_name*"
find /Path \ -name "file_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 login as user username<|im_end|> <|im_start|>assistant su - username<|im_end|>
login as user username
su - username
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Show a long listing of files not modified in over 20 days or not accessed in over 40 days<|im_end|> <|im_start|>assistant find /mydir \ -exec ...
Show a long listing of files not modified in over 20 days or not accessed in over 40 days
find /mydir \ -exec ls -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 Creates random file name formatted like expression in variable ${str// /X} and saves it in 'rand_str' variable.<|im_end|> <|im_start|>assistan...
Creates random file name formatted like expression in variable ${str// /X} and saves it in 'rand_str' variable.
rand_str=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 IP address of default network interface.<|im_end|> <|im_start|>assistant netstat -rn | gawk '/UG/ {print $NF}' | xargs ifconfig | gawk '...
Finds IP address of default network interface.
netstat -rn | gawk '/UG/ {print $NF}' | xargs ifconfig | gawk 'match($0,/inet addr: B/,a) {print a[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 Search directories /path/to/directory/folder{1..50} for .txt files, outputting only the names of the matched files<|im_end|> <|im_start|>assis...
Search directories /path/to/directory/folder{1..50} for .txt files, outputting only the names of the matched files
find /path/to/directory/folder{1..50} -name '*.txt' -exec basename {} \; 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 Run the PHP script "newEmptyPHP" redirecting the output to "nohup.out" in the current directory, or in the home directory if that is not possi...
Run the PHP script "newEmptyPHP" redirecting the output to "nohup.out" in the current directory, or in the home directory if that is not possible. The process will not receive or respond to SIGHUP which are sent to it.
nohup php newEmptyPHP.php &
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Unzip "file.gz" and print each line with the 2nd | separated field greater than 5<|im_end|> <|im_start|>assistant zcat a.csv.gz | gawk '$2>5' ...
Unzip "file.gz" and print each line with the 2nd | separated field greater than 5
zcat a.csv.gz | gawk '$2>5' FPAT='[^"|]+'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Add executable permission to "rr.sh"<|im_end|> <|im_start|>assistant chmod +x rr.sh<|im_end|>
Add executable permission to "rr.sh"
chmod +x rr.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 Go to directory /cygdrive/c/Program Files using quotes to escape special characters<|im_end|> <|im_start|>assistant cd "/cygdrive/c/Program F...
Go to directory /cygdrive/c/Program Files using quotes to escape special characters
cd "/cygdrive/c/Program Files "
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Search the current directory for files whose names start with "messages." ignoring SVN and CVS files<|im_end|> <|im_start|>assistant find \( -...
Search the current directory for files whose names start with "messages." ignoring SVN and CVS files
find \( -name 'messages.*' ! -path "*/.svn/*" ! -path "*/CVS/*" \) -exec grep -Iw uint {} +
AnishJoshi/nl2bash-custom
<|im_start|>system 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 *.c and *.h files under the current directory tree skipping hidden directories and files<|im_end|> <|im_start|>assistant find . \ -a -nam...
Find *.c and *.h files under the current directory tree skipping hidden directories and files
find . \ -a -name '*.[ch]'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Sets prompt to "username@host:pwd"<|im_end|> <|im_start|>assistant export PS1="\[\033]0;\u $(host $)\007\]\u@\h:\w\$ "<|im_end|>
Sets prompt to "username@host:pwd"
export PS1="\[\033]0;\u $(host $)\007\]\u@\h:\w\$ "
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Enables shell option 'progcomp'.<|im_end|> <|im_start|>assistant shopt -s progcomp<|im_end|>
Enables shell option 'progcomp'.
shopt -s progcomp
AnishJoshi/nl2bash-custom
<|im_start|>system 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 "message" with escaped prompt "Please Enter a Message: \n\b"<|im_end|> <|im_start|>assistant rea...
Read a line from standard input into variable "message" with escaped prompt "Please Enter a Message: \n\b"
read -p "$(echo -e 'Please Enter a Message: \n\b')" message
AnishJoshi/nl2bash-custom
<|im_start|>system 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 occurrence of "subdomainA.example.com" with "subdomainB.example.com" in all files under the current directory and below<|im_end|> ...
Replace all occurrence of "subdomainA.example.com" with "subdomainB.example.com" in all files under the current directory and below
find . -type f -print0 | xargs -0 perl -i.bak -pe 's/subdomainA\.example\.com/subdomainB.example.com/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 Puts the job 1 in the background.<|im_end|> <|im_start|>assistant bg %1 [puts the job in the background]<|im_end|>
Puts the job 1 in the background.
bg %1 [puts the job in the background]
AnishJoshi/nl2bash-custom
<|im_start|>system 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 files modified in the last hour within a directory and its subdirectories, then move them to another directory.<|im_end|> <|im_...
Search for all files modified in the last hour within a directory and its subdirectories, then move them to another directory.
#!/bin/bash find /path/to/directory -type f -mmin -60 -exec mv {} /path/to/destination/ \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 *fink* files/directories in entire file system<|im_end|> <|im_start|>assistant find / \ -name \*fink\* -print<|im_end|>
Find all *fink* files/directories in entire file system
find / \ -name \*fink\* -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 Display differences between file1 and file2 side-by-side.<|im_end|> <|im_start|>assistant diff -y file1 file2<|im_end|>
Display differences between file1 and file2 side-by-side.
diff -y file1 file2
AnishJoshi/nl2bash-custom
<|im_start|>system 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 network bandwidth usage and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin...
Create a script to monitor network bandwidth usage and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold=1000000 bandwidth_usage=$(ifstat -t 1 1 | tail -n 1 | awk '{print $2}') if [ "$bandwidth_usage" -gt "$threshold" ]; then echo "Network bandwidth usage exceeds $threshold bytes/sec." # 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 with pattern` '*song*abc2009*.jpg' and replace "abc2009" with "def2010"<|im_end|> <|im_start|>assistant find . -name '*song*abc...
find all files with pattern` '*song*abc2009*.jpg' and replace "abc2009" with "def2010"
find . -name '*song*abc2009*.jpg' | sed 's/\abc2009\$/mv "&" "\1def2010\2"/' | 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 the configuration files in the files system and donot display any errors.<|im_end|> <|im_start|>assistant find / -name "*.conf" 2>>/d...
find all the configuration files in the files system and donot display any errors.
find / -name "*.conf" 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 Print the user name of the current user<|im_end|> <|im_start|>assistant whoami<|im_end|>
Print the user name of the current user
whoami
AnishJoshi/nl2bash-custom
<|im_start|>system 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 count of duplicate lines in "filename" sorted by most frequent<|im_end|> <|im_start|>assistant sort filename | uniq -c | sort -nr<|im_...
Print a count of duplicate lines in "filename" sorted by most frequent
sort filename | uniq -c | sort -nr
AnishJoshi/nl2bash-custom
<|im_start|>system 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 stderr to stdout and write to the console and "/dev/null"<|im_end|> <|im_start|>assistant xxx |& tee /dev/null<|im_end|>
Redirect stderr to stdout and write to the console and "/dev/null"
xxx |& tee /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 Save the number of matching executables for "$cmd" in $PATH to variable "candidates"<|im_end|> <|im_start|>assistant candidates=$<|im_end|>
Save the number of matching executables for "$cmd" in $PATH to variable "candidates"
candidates=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 2*.data files/directories under jcho directory<|im_end|> <|im_start|>assistant find jcho -name 2*.data<|im_end|>
Find all 2*.data files/directories under jcho directory
find jcho -name 2*.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 show all files in the entire file system<|im_end|> <|im_start|>assistant find / -print0 | perl -ln0e 'print "found $_" if -p'<|im_end|>
show all files in the entire file system
find / -print0 | perl -ln0e 'print "found $_" if -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 the extension of all the ".abc" files in the folder "/the/path" to ".edefg" and do not change in the sub directories<|im_end|> <|im_sta...
change the extension of all the ".abc" files in the folder "/the/path" to ".edefg" and do not change in the sub directories
find /the/path -depth -type f -name "*.abc" -exec sh -c 'mv "$1" "$/$.edefg"' _ {} \;
AnishJoshi/nl2bash-custom