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 Get the sizes of all files under dir1 directory<|im_end|> <|im_start|>assistant find dir1 ! -type d |xargs wc -c<|im_end|>
Get the sizes of all files under dir1 directory
find dir1 ! -type d |xargs wc -c
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a file exists and is a regular file or a symbolic link.<|im_end|> <|im_start|>assistant #!/bin/bash file="/path/to/your/file.txt" i...
Check if a file exists and is a regular file or a symbolic link.
#!/bin/bash file="/path/to/your/file.txt" if [ -f "$file" ] || [ -L "$file" ]; then echo "$file exists and is a regular file or a symbolic link" else echo "$file does not exist or is not a regular file or a symbolic link" 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 in directory tree /tmp/foo and pass them as arguments to script /tmp/echoargs<|im_end|> <|im_start|>assistant find /tmp/foo -ex...
Find all files in directory tree /tmp/foo and pass them as arguments to script /tmp/echoargs
find /tmp/foo -exec /tmp/echoargs {} +
AnishJoshi/nl2bash-custom
<|im_start|>system 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 file system for regular files whose pathnames are shorter than 25 characters<|im_end|> <|im_start|>assistant find / -type f|awk -F'...
Search the file system for regular files whose pathnames are shorter than 25 characters
find / -type f|awk -F'/' '{print $NF}'| awk 'length($0) < 25'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user all .jpg or .png images modified in the past week<|im_end|> <|im_start|>assistant find . -mtime -7 \<|im_end|>
all .jpg or .png images modified in the past week
find . -mtime -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 Find all CDC* files under current directory that were accessed less than 1 day ago and delete the first and last lines from those files<|im_en...
Find all CDC* files under current directory that were accessed less than 1 day ago and delete the first and last lines from those files
find . -type f -name "CDC*" -ctime -1 -exec sed -i'' -e '1d' -e '$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 Find the oldest *.sql file under current directory<|im_end|> <|im_start|>assistant find . -name \*.sql | xargs \ls -1rc | tail -7 | head -1<|i...
Find the oldest *.sql file under current directory
find . -name \*.sql | xargs \ls -1rc | tail -7 | head -1
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files under current directory whose file type description contains "image", display only path to each file.<|im_end|> <|im_start|>ass...
Find all files under current directory whose file type description contains "image", display only path to each file.
find . -type f -exec file {} \; | awk -F: '{ if ($2 ~/[Ii]mage|EPS/) print $1}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the directory name of the physical current working directory<|im_end|> <|im_start|>assistant dirname `pwd -P`<|im_end|>
Print the directory name of the physical current working directory
dirname `pwd -P`
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a report of the contents of a USB drive mounted at find /path/to/drive<|im_end|> <|im_start|>assistant find /path/to/drive -type f -exe...
Create a report of the contents of a USB drive mounted at find /path/to/drive
find /path/to/drive -type f -exec file -b '{}' \; -printf '%s\n' | awk -F , 'NR%2 {i=$1} NR%2==0 {a[i]+=$1} END {for (i in a) printf("%12u %s\n",a[i],i)}' | 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 Find *.c and *.h files under the current directory tree skipping hidden directories and files<|im_end|> <|im_start|>assistant find . \( -path ...
Find *.c and *.h files under the current directory tree skipping hidden directories and files
find . \( -path '*/.*' -prune -o ! -name '.*' \) -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 Dispaly the latest version of Joomla in various folders<|im_end|> <|im_start|>assistant find /home/*/public_html/ -type f \ -print0 -exec perl...
Dispaly the latest version of Joomla in various folders
find /home/*/public_html/ -type f \ -print0 -exec perl -e 'while { $release = $1 if m/ \$RELEASE\s+= ..;/; $dev = $1 if m/ \$DEV_LEVEL\s+= ..;/; } print qq;' {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 "ifconfig" in the output of "history" and print 5 lines that precede and follow<|im_end|> <|im_start|>assistant history | grep -C 5...
Search for "ifconfig" in the output of "history" and print 5 lines that precede and follow
history | grep -C 5 ifconfig
AnishJoshi/nl2bash-custom
<|im_start|>system 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 via ssh "user@source-server:/somedirA/" to "somedirB/" with compressed data during transmission and display progress<|im_end|> <|i...
Synchronize via ssh "user@source-server:/somedirA/" to "somedirB/" with compressed data during transmission and display progress
rsync -avz -e ssh --progress user@source-server:/somedirA/ somedirB/
AnishJoshi/nl2bash-custom
<|im_start|>system 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 *weservice* files under current directory and restart the services provided by them<|im_end|> <|im_start|>assistant find -iname '*we...
Find all *weservice* files under current directory and restart the services provided by them
find -iname '*weservice*'|xargs -I {} service {} restart
AnishJoshi/nl2bash-custom
<|im_start|>system 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 trace prompt to print seconds, nnoseconds, script name, and line number<|im_end|> <|im_start|>assistant PS4='+$(date "+%s:%N") %N:%i> '<|i...
Set trace prompt to print seconds, nnoseconds, script name, and line number
PS4='+$(date "+%s:%N") %N:%i> '
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the character representations of 65 to 90<|im_end|> <|im_start|>assistant seq 65 90 | awk '{printf}'<|im_end|>
Print the character representations of 65 to 90
seq 65 90 | awk '{printf}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find files with a question mark in their names and save the output as a file<|im_end|> <|im_start|>assistant find . -name \*\\?\* > output.txt...
Find files with a question mark in their names and save the output as a file
find . -name \*\\?\* > output.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 Calculte and output amount of CPU load taken by all processes belonging to user 'abc'.<|im_end|> <|im_start|>assistant top -b -n 1 -u abc | aw...
Calculte and output amount of CPU load taken by all processes belonging to user 'abc'.
top -b -n 1 -u abc | awk 'NR>7 { sum += $9; } END { print 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 Set variable "b" to the first word of "a" converted to uppercase.<|im_end|> <|im_start|>assistant b=`echo "$a" | awk '{ print toupper }'`<|im_...
Set variable "b" to the first word of "a" converted to uppercase.
b=`echo "$a" | awk '{ print toupper }'`
AnishJoshi/nl2bash-custom
<|im_start|>system 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 xml files in a directory and pass it as an argument to a jar<|im_end|> <|im_start|>assistant find /dump -type f -name '*.xml' | p...
find all the xml files in a directory and pass it as an argument to a jar
find /dump -type f -name '*.xml' | parallel -j8 java -jar ProcessFile.jar {}
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Force tty allocation and execute "./script.py" on host "foo"<|im_end|> <|im_start|>assistant ssh -tt foo ./script.py<|im_end|>
Force tty allocation and execute "./script.py" on host "foo"
ssh -tt foo ./script.py
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create directory dir2<|im_end|> <|im_start|>assistant mkdir dir2<|im_end|>
Create directory dir2
mkdir dir2
AnishJoshi/nl2bash-custom
<|im_start|>system 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 ".git" folder in the current folder and run the git pull request<|im_end|> <|im_start|>assistant find . -name .git -type d -exe...
search for the ".git" folder in the current folder and run the git pull request
find . -name .git -type d -execdir git pull -v ';'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user display a long listing of all the temp files whose size is 0 bytes and which have not been accessed in the last 10 days<|im_end|> <|im_start|>...
display a long listing of all the temp files whose size is 0 bytes and which have not been accessed in the last 10 days
find /tmp -size 0 -atime +10 -exec ls -l {} \; > /tmp/checkold.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 print value of the variable $PROJ_PATH of the kenneth system user environment<|im_end|> <|im_start|>assistant su -l kenneth -c 'echo $PROJ_PAT...
print value of the variable $PROJ_PATH of the kenneth system user environment
su -l kenneth -c 'echo $PROJ_PATH'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user convert all text files in the current folder from dos to unix format<|im_end|> <|im_start|>assistant find . -name *.txt | xargs dos2unix<|im_e...
convert all text files in the current folder from dos to unix format
find . -name *.txt | xargs dos2unix
AnishJoshi/nl2bash-custom
<|im_start|>system 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 information about all users who are logged in<|im_end|> <|im_start|>assistant who -la<|im_end|>
Print information about all users who are logged in
who -la
AnishJoshi/nl2bash-custom
<|im_start|>system 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' | xargs gzip -l | tail ...
Find the largest original ".gz" file in the current directory tree
find . -name '*.gz' | xargs gzip -l | tail -n +2 | head -n -1 | sort -k 2 | tail -n 1 | awk '{print $NF}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user get the jenkins user access<|im_end|> <|im_start|>assistant sudo su - jenkins<|im_end|>
get the jenkins user access
sudo su - jenkins
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user when using vi-insert keymap bind command "\C-v{}\ei" to key "{"<|im_end|> <|im_start|>assistant bind -m vi-insert '"{" "\C-v{}\ei"'<|im_end|>
when using vi-insert keymap bind command "\C-v{}\ei" to key "{"
bind -m vi-insert '"{" "\C-v{}\ei"'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 string 'joomla' case insensitively in all the php and html files under current directory tree and display the matched lines along wit...
Find the string 'joomla' case insensitively in all the php and html files under current directory tree and display the matched lines along with the file names and line numbers
find . \ -print0 | xargs -0 grep -Hin "joomla"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user search for all the files which have not been modified in the last 6 months (180 days) in current folder and display the total disk usage of th...
search for all the files which have not been modified in the last 6 months (180 days) in current folder and display the total disk usage of them
find . -mtime +180 -exec du -ks {} \; | cut -f1 | awk '{total=total+$1}END{print total/1024}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print a line of 100 '=' characters<|im_end|> <|im_start|>assistant printf %100s |tr " " "="<|im_end|>
Print a line of 100 '=' characters
printf %100s |tr " " "="
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove all files with a txt extension under current directory<|im_end|> <|im_start|>assistant find . -type f -name "*.txt" | xargs -i ksh -...
Remove all files with a txt extension under current directory
find . -type f -name "*.txt" | xargs -i ksh -c "echo deleting {}; rm {}"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user download content from "http://search.twitter.com/search.json?q=node.js" and format it as json<|im_end|> <|im_start|>assistant curl -s http://s...
download content from "http://search.twitter.com/search.json?q=node.js" and format it as json
curl -s http://search.twitter.com/search.json?q=node.js | json
AnishJoshi/nl2bash-custom
<|im_start|>system 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 until tomorrow at 21:30<|im_end|> <|im_start|>assistant sleep $(($0))<|im_end|>
Sleep until tomorrow at 21:30
sleep $(($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 number of packets sent, received, and the percentage lost for each ping request to "google.com"<|im_end|> <|im_start|>assistant ping...
Print the number of packets sent, received, and the percentage lost for each ping request to "google.com"
ping google.com | awk '{ sent=NR-1; received+=/^.*(time=.+ ms).*$/; loss=0; } { if (sent>0) loss=100-((received/sent)*100) } { printf "sent:%d received:%d loss:%d%%\n", sent, received, loss }'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 /path/to/base/dir and change their permission to 644<|im_end|> <|im_start|>assistant chmod 644 $<|im_end|>
Find all files under /path/to/base/dir and change their permission to 644
chmod 644 $
AnishJoshi/nl2bash-custom
<|im_start|>system 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 of the hidden files in the current directory and its sub-directories.<|im_end|> <|im_start|>assistant find . -type f -name ".*<|im_en...
Find all of the hidden files in the current directory and its sub-directories.
find . -type f -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 SSH into "111.222.333.444" as user "tunneluser" without a pseudo-terminal and without interpreting bash variables locally<|im_end|> <|im_start...
SSH into "111.222.333.444" as user "tunneluser" without a pseudo-terminal and without interpreting bash variables locally
ssh -T tunneluser@111.222.333.444 <<'EOI'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to check if a given string is an anagram of another string.<|im_end|> <|im_start|>assistant #!/bin/bash str1="listen" str2="s...
Create a script to check if a given string is an anagram of another string.
#!/bin/bash str1="listen" str2="silent" if [ "$(echo "$str1" | grep -o . | sort | tr -d ' ')" = "$(echo "$str2" | grep -o . | sort | tr -d ' ')" ]; then echo "$str1 and $str2 are anagrams" else echo "$str1 and $str2 are not anagrams" 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 broken symlinks under current directory<|im_end|> <|im_start|>assistant find . -type l -exec sh -c "file -b {} | grep -q ^broken" \; ...
Find all broken symlinks under current directory
find . -type l -exec sh -c "file -b {} | grep -q ^broken" \; -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 Rank the usage of libraries for a set of tools "/bin/* /usr/bin/* ..."<|im_end|> <|im_start|>assistant ldd /bin/* /usr/bin/* ... | sed -e '/^[...
Rank the usage of libraries for a set of tools "/bin/* /usr/bin/* ..."
ldd /bin/* /usr/bin/* ... | sed -e '/^[^\t]/ d; s/^\t\\?\ (.*/\2/g' | sort | uniq -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 delete all the "wmv" "wma" files in the currnet folder,<|im_end|> <|im_start|>assistant find . \( -name '*.wmv' -o -name '*.wma' \) -exec rm {...
delete all the "wmv" "wma" files in the currnet folder,
find . \( -name '*.wmv' -o -name '*.wma' \) -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 print all active readline keybindings<|im_end|> <|im_start|>assistant bind -P | grep --fixed-strings ' can be found on ' | perl -pe 's/(*)\\C/...
print all active readline keybindings
bind -P | grep --fixed-strings ' can be found on ' | perl -pe 's/(*)\\C/\1Ctrl/g;s/(*)\\e/\1Esc,/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 Search for files greater than 20MB in the entire file system, sort them according to size in ascending order and display the path and file siz...
Search for files greater than 20MB in the entire file system, sort them according to size in ascending order and display the path and file size
find / -type f -size +20M -exec ls -lh {} \; 2> /dev/null | awk '{ print $NF ": " $5 }' | sort -nk 2,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 Recursively search through all files in all directories for any lines containing "pattern" and whose second word is not "Binary".<|im_end|> <|...
Recursively search through all files in all directories for any lines containing "pattern" and whose second word is not "Binary".
grep -Ri "pattern" * | awk '{if($1 != "Binary") print $0}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Page through the contents of BIG_FILE.txt, letting the user move around with the arrow keys, the Q key quits.<|im_end|> <|im_start|>assistant ...
Page through the contents of BIG_FILE.txt, letting the user move around with the arrow keys, the Q key quits.
cat BIG_FILE.txt | 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 Print a list of all files/directories under current directory in myfile.sh file<|im_end|> <|im_start|>assistant find . -print >myfile.sh<|im_e...
Print a list of all files/directories under current directory in myfile.sh file
find . -print >myfile.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 Remove trailing white spaces and replace CRLF with LF in all files under current directory ignoring .git and .svn directories<|im_end|> <|im_s...
Remove trailing white spaces and replace CRLF with LF in all files under current directory ignoring .git and .svn directories
find . -not \ -type f -exec sed -i 's/[:space:]+$//' \{} \; -exec sed -i 's/\r\n$/\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 Set status code to a non-zero value if process with PID 4129 is running in a different namespace than init<|im_end|> <|im_start|>assistant bas...
Set status code to a non-zero value if process with PID 4129 is running in a different namespace than init
bash -c "test -h /proc/4129/ns/pid && test '$' != '$'"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Installs git and bash-completion packages.<|im_end|> <|im_start|>assistant brew install git bash-completion<|im_end|>
Installs git and bash-completion packages.
brew install git bash-completion
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Finds all strings with parent folder of path '$path' in 'file', and saves result in 'x' variable.<|im_end|> <|im_start|>assistant x=$(grep "$"...
Finds all strings with parent folder of path '$path' in 'file', and saves result in 'x' variable.
x=$(grep "$" file)
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all the files in the current folder and display those that are not present in the list "file.lst"<|im_end|> <|im_start|>assistant find . ...
find all the files in the current folder and display those that are not present in the list "file.lst"
find . | grep -vf file.lst
AnishJoshi/nl2bash-custom
<|im_start|>system 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 hidden files under current directory and remove them excluding the files specified in /tmp/list_files<|im_end|> <|im_start|>assistant...
Find all hidden files under current directory and remove them excluding the files specified in /tmp/list_files
find . -iname ".*" -exec bash -c "fgrep {} /tmp/list_files >/dev/null || rm -i {}" \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Rename all *.jpg files to *.jpg$.jpg files under current directory<|im_end|> <|im_start|>assistant find . -name '*.jpg' -exec sh -c 'mv "$0" "...
Rename all *.jpg files to *.jpg$.jpg files under current directory
find . -name '*.jpg' -exec sh -c 'mv "$0" "${0%.JPG}$.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 Print an alert message containing the IP address and information of the user connecting via SSH<|im_end|> <|im_start|>assistant echo -e "ALERT...
Print an alert message containing the IP address and information of the user connecting via SSH
echo -e "ALERT - Shell Access on:' `date` `who` '\n\n' `whois $(who | 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 Run command "program" as the current user<|im_end|> <|im_start|>assistant /usr/bin/sudo -u `whoami` `which program`<|im_end|>
Run command "program" as the current user
/usr/bin/sudo -u `whoami` `which program`
AnishJoshi/nl2bash-custom
<|im_start|>system 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 permission of all the files in the current directory to 664 and change the permission of all the directories in the current folder...
change the permission of all the files in the current directory to 664 and change the permission of all the directories in the current folder to 775.
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 Show the internal memory size used by process whose PID is specified by variable PID.<|im_end|> <|im_start|>assistant top -l 1 -s 0 -stats mem...
Show the internal memory size used by process whose PID is specified by variable PID.
top -l 1 -s 0 -stats mem -pid $PID
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user set alias "pwd" for command '/bin/pwd | pbcopy'<|im_end|> <|im_start|>assistant alias pwd='/bin/pwd | pbcopy'<|im_end|>
set alias "pwd" for command '/bin/pwd | pbcopy'
alias pwd='/bin/pwd | pbcopy'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a specific file exists and is writable.<|im_end|> <|im_start|>assistant #!/bin/bash file="/path/to/file" if [ -w "$file" ]; then ...
Check if a specific file exists and is writable.
#!/bin/bash file="/path/to/file" if [ -w "$file" ]; then echo "$file exists and is writable" else echo "$file does not exist or is not writable" 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 Show the subdirectories of the current directory<|im_end|> <|im_start|>assistant find . -maxdepth 1 -type d -print | parallel echo Directory: ...
Show the subdirectories of the current directory
find . -maxdepth 1 -type d -print | parallel echo Directory: {}
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user kills a running program 'python csp_build.py'<|im_end|> <|im_start|>assistant ps aux | grep 'python csp_build.py' | head -1 | cut -d " " -f 2 ...
kills a running program 'python csp_build.py'
ps aux | grep 'python csp_build.py' | head -1 | cut -d " " -f 2 | xargs kill
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system login attempts and send an alert if any successful attempts are detected.<|im_end|> <|im_start|>assistant #!...
Create a script to monitor system login attempts and send an alert if any successful attempts are detected.
#!/bin/bash successful_attempts=$(grep -i 'Accepted password' /var/log/auth.log | wc -l) if [ "$successful_attempts" -gt 0 ]; then echo "Successful login attempts detected." # Send alert here fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Delete all __temp__* files/directories under current directory tree<|im_end|> <|im_start|>assistant find . -name __temp__* -exec rm -rf '{}' \...
Delete all __temp__* files/directories under current directory tree
find . -name __temp__* -exec rm -rf '{}' \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 text and pdf files in the current folder<|im_end|> <|im_start|>assistant find . -regex ".*\$"<|im_end|>
display all the text and pdf files in the 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 Create a script to monitor Git server status and send an alert if the server is down.<|im_end|> <|im_start|>assistant #!/bin/bash git_status=...
Create a script to monitor Git server status and send an alert if the server is down.
#!/bin/bash git_status=$(systemctl is-active --quiet git) if [ "$git_status" != "active" ]; then echo "Git server is down." # Send alert here fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Write the standard output and error of "ls" to the console and append it to "/tmp/ls.txt"<|im_end|> <|im_start|>assistant ls 2>&1 | tee --appe...
Write the standard output and error of "ls" to the console and append it to "/tmp/ls.txt"
ls 2>&1 | tee --append /tmp/ls.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 Returns the single most recent file in a directory<|im_end|> <|im_start|>assistant ls -ltq <path> | head -n 1<|im_end|>
Returns the single most recent file in a directory
ls -ltq <path> | head -n 1
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Run an awk program on every TXT file found in the current directory tree<|im_end|> <|im_start|>assistant find . -name '*txt' -print -exec awk ...
Run an awk program on every TXT file found in the current directory tree
find . -name '*txt' -print -exec awk 'BEGIN {nl=1 ;print FILENAME} $9 !="" {if (nl<11) { print $0 ; nl = nl + 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 for 'magic' in all regular files under current directory tree<|im_end|> <|im_start|>assistant find . -type f | xargs grep "magic"<|im_e...
Search for 'magic' in all regular files under current directory tree
find . -type f | xargs grep "magic"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 are "YourProgram", change to the directories they are in, and execute them<|im_end|> ...
Find all files in the current directory tree whose names are "YourProgram", change to the directories they are in, and execute them
find $ -name YourProgram -exec dirname {} \; | while read d; do cd "$d" && ./YourPrgram; done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a specific directory exists and create it if it doesn't, setting specific permissions.<|im_end|> <|im_start|>assistant #!/bin/bash d...
Check if a specific directory exists and create it if it doesn't, setting specific permissions.
#!/bin/bash directory="/path/to/directory" if [ ! -d "$directory" ]; then mkdir -p "$directory" chmod 755 "$directory" 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 Collapse double slashes in variable "dir" into a single one.<|im_end|> <|im_start|>assistant dir="`echo $dir | sed s,//,/,g`"<|im_end|>
Collapse double slashes in variable "dir" into a single one.
dir="`echo $dir | sed s,//,/,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 Convert a string to lowercase.<|im_end|> <|im_start|>assistant #!/bin/bash your_string="YOUR STRING" echo "$your_string" | tr '[:upper:]' '[...
Convert a string to lowercase.
#!/bin/bash your_string="YOUR STRING" echo "$your_string" | tr '[:upper:]' '[:lower:]'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all directories under minimum 1 level down the current directory excluding directories that start with a . in their names<|im_end|> <|...
Find all directories under minimum 1 level down the current directory excluding directories that start with a . in their names
find . -mindepth 1 -name '.*' -prune -o \
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Swap "new" and "old" files or directories<|im_end|> <|im_start|>assistant mv new old -b && mv old~ new<|im_end|>
Swap "new" and "old" files or directories
mv new old -b && mv old~ new
AnishJoshi/nl2bash-custom
<|im_start|>system 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 the spaces in mp3 files to underscore<|im_end|> <|im_start|>assistant find . -type f -iname “*.mp3″ -exec rename “s/ /_/g” {} \;<|i...
rename all the spaces in mp3 files to underscore
find . -type f -iname “*.mp3″ -exec rename “s/ /_/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 Delete all empty directories and directories that contain only empty directories under current directory<|im_end|> <|im_start|>assistant find ...
Delete all empty directories and directories that contain only empty directories under current directory
find -type d -empty -exec rmdir -vp --ignore-fail-on-non-empty {} `;`
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Gets IP address of first network interface which name matches pattern "venet0:0\|eth0".<|im_end|> <|im_start|>assistant ifconfig | grep -A2 "v...
Gets IP address of first network interface which name matches pattern "venet0:0\|eth0".
ifconfig | grep -A2 "venet0:0\|eth0" | grep 'inet addr:' | sed -r 's/.*inet addr:.*/\1/' | head -1
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user display all the .sh scripts in the folder /usr<|im_end|> <|im_start|>assistant find /usr -name '*.sh'<|im_end|>
display all the .sh scripts in the folder /usr
find /usr -name '*.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 Search the /dir directory tree for files whose names match regular expression '.*2015.*\'<|im_end|> <|im_start|>assistant find /dir -regex '.*...
Search the /dir directory tree for files whose names match regular expression '.*2015.*\'
find /dir -regex '.*2015.*\'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 and all of its sub-directory for any PDF files being careful to prevent the shell from expanding anything in '*.p...
Search the current directory and all of its sub-directory for any PDF files being careful to prevent the shell from expanding anything in '*.pdf' before it'ss passed to find.
find . -name '*.pdf' -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 .jpg files in the current directory and below<|im_end|> <|im_start|>assistant find -name '*.jpg<|im_end|>
Find all .jpg files in the current directory and below
find -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 Counts the number of lines in each file in a git repository.<|im_end|> <|im_start|>assistant git ls-files | xargs wc -l<|im_end|>
Counts the number of lines in each file in a git repository.
git ls-files | xargs 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 Generate a report of top network-consuming processes and their network usage.<|im_end|> <|im_start|>assistant #!/bin/bash iftop -t -n -s 5 -o...
Generate a report of top network-consuming processes and their network usage.
#!/bin/bash iftop -t -n -s 5 -o 2s > network_consumption_report.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 Write output of "whatever" to standard output and to "logfile.txt"<|im_end|> <|im_start|>assistant whatever | tee logfile.txt<|im_end|>
Write output of "whatever" to standard output and to "logfile.txt"
whatever | tee logfile.txt
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all your jsp's, map them to your localhost webserver, and invoke a wget (fetch) on them<|im_end|> <|im_start|>assistant find -name \*.jsp...
Find all your jsp's, map them to your localhost webserver, and invoke a wget (fetch) on them
find -name \*.jsp | sed 's/^/http:\/\/127.0.0.1/server/g' | xargs -n 1 wget
AnishJoshi/nl2bash-custom
<|im_start|>system 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 SSH server status and send an alert if the server becomes unresponsive.<|im_end|> <|im_start|>assistant #!/bin/bash...
Create a script to monitor SSH server status and send an alert if the server becomes unresponsive.
#!/bin/bash server_status=$(curl -s -o /dev/null -w "%{http_code}" ssh://localhost) if [ "$server_status" != "200" ]; then echo "SSH server is unresponsive." | mail -s "SSH Server Unresponsive 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 Create a script to monitor system MySQL database status and send email alerts when replication lag exceeds a certain threshold.<|im_end|> <|im...
Create a script to monitor system MySQL database status and send email alerts when replication lag exceeds a certain threshold.
#!/bin/bash threshold="300" replication_lag=$(mysql -e "SHOW SLAVE STATUS\G" | grep -i 'seconds_behind_master' | awk '{print $2}') if [ "$replication_lag" -gt "$threshold" ]; then echo "MySQL replication lag is $replication_lag seconds." | mail -s "MySQL Replication Lag 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 Print the ping time of a single request to "8.8.8.8"<|im_end|> <|im_start|>assistant ping -c 1 8.8.8.8 | awk 'FNR == 2 { print $(NF-1) }'<|im...
Print the ping time of a single request to "8.8.8.8"
ping -c 1 8.8.8.8 | awk 'FNR == 2 { print $(NF-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 js files under the build direcotry except build/external and build/log directory.<|im_end|> <|im_start|>assistant find build -not \ -...
find all js files under the build direcotry except build/external and build/log directory.
find build -not \ -not \ -name \*.js
AnishJoshi/nl2bash-custom
<|im_start|>system 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 FQDN host name of the system in variable "hnd"<|im_end|> <|im_start|>assistant hnd=$<|im_end|>
Save the FQDN host name of the system in variable "hnd"
hnd=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 times each person is logged in on the system<|im_end|> <|im_start|>assistant who | awk '{print $1}' | sort | uniq -c | sor...
Count the number of times each person is logged in on the system
who | awk '{print $1}' | sort | uniq -c | sort -n
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Report only total size of file systems in 1T blocks.<|im_end|> <|im_start|>assistant df --total -BT | tail -n 1 | sed -E 's/total *.*/\1/'<|im...
Report only total size of file systems in 1T blocks.
df --total -BT | tail -n 1 | sed -E 's/total *.*/\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 Prepend the reverse history number as negative values to the output of the history command with arguments "$@"<|im_end|> <|im_start|>assistant...
Prepend the reverse history number as negative values to the output of the history command with arguments "$@"
history "$@" | tac | nl | tac | sed 's/^\( *\)\([0-9]\)/\1-\2/'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find Flash videos stored by browsers on a Mac<|im_end|> <|im_start|>assistant find /private/ 2>/dev/null | grep /Flash<|im_end|>
Find Flash videos stored by browsers on a Mac
find /private/ 2>/dev/null | grep /Flash
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user discard all the errors and search for the file "program.c" in the entire file system<|im_end|> <|im_start|>assistant find / -name 'program.c' ...
discard all the errors and search for the file "program.c" in the entire file system
find / -name 'program.c' 2>/dev/null
AnishJoshi/nl2bash-custom