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 Monitor system load average every 10 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/bash for ((i=0; i<6...
Monitor system load average every 10 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<6; i++)); do uptime sleep 10 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print a single line of numbers from "001" to "100"<|im_end|> <|im_start|>assistant yes | grep y | sed 100q | awk '{printf}'; echo<|im_end|>
Print a single line of numbers from "001" to "100"
yes | grep y | sed 100q | awk '{printf}'; echo
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Unsets array member with index 2.<|im_end|> <|im_start|>assistant unset array[2]<|im_end|>
Unsets array member with index 2.
unset array[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 Print the list of all installed packages on the system.<|im_end|> <|im_start|>assistant #!/bin/bash apt list --installed<|im_end|>
Print the list of all installed packages on the system.
#!/bin/bash apt list --installed
AnishJoshi/nl2bash-custom
<|im_start|>system 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 path to the $SCRIPT file in the SCRIPTPATH variable.<|im_end|> <|im_start|>assistant set SCRIPTPATH=`dirname "$SCRIPT"`<|im_end|>
Saves path to the $SCRIPT file in the SCRIPTPATH variable.
set SCRIPTPATH=`dirname "$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 Change permissions of all files ending in ".php" under the current directory to 755 and print a '+' for each file<|im_end|> <|im_start|>assist...
Change permissions of all files ending in ".php" under the current directory to 755 and print a '+' for each file
find . -name '*.php' -exec chmod 755 {} \; -exec echo '+' \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Delete all directories in the TBD directory that were modified more than 1 day ago<|im_end|> <|im_start|>assistant find /TBD -mtime +1 -type d...
Delete all directories in the TBD directory that were modified more than 1 day ago
find /TBD -mtime +1 -type d | xargs rm -f -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 Create a script to check if a specific port is open and send an alert if it's closed.<|im_end|> <|im_start|>assistant #!/bin/bash host="examp...
Create a script to check if a specific port is open and send an alert if it's closed.
#!/bin/bash host="example.com" port="80" nc -z -v -w5 "$host" "$port" if [ $? -eq 0 ]; then echo "Port $port is open on $host." else echo "Port $port is closed on $host." # 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 Remove newlines from the output of "./series.bc" and pipe into "sed 's.\\..g'"<|im_end|> <|im_start|>assistant ./series.bc | tr -d '\n' | sed ...
Remove newlines from the output of "./series.bc" and pipe into "sed 's.\\..g'"
./series.bc | tr -d '\n' | 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 Execute "myfile" on all regular files from the current directory tree<|im_end|> <|im_start|>assistant find . -type f -exec bash -c 'myfile "{}...
Execute "myfile" on all regular files from the current directory tree
find . -type f -exec bash -c 'myfile "{}"' \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Calculate the sum of all the numbers from 1 to 10<|im_end|> <|im_start|>assistant seq 10|jq -s add<|im_end|>
Calculate the sum of all the numbers from 1 to 10
seq 10|jq -s add
AnishJoshi/nl2bash-custom
<|im_start|>system 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 current directory name<|im_end|> <|im_start|>assistant pwd | sed 's#.*/##'<|im_end|>
Prints current directory name
pwd | sed 's#.*/##'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user In the current shell, interpret 'incl.sh' which is in the directory pointed by variable DIR<|im_end|> <|im_start|>assistant source "$DIR/incl....
In the current shell, interpret 'incl.sh' which is in the directory pointed by variable DIR
source "$DIR/incl.sh"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Gets IP address of eth0 network interface.<|im_end|> <|im_start|>assistant ifconfig eth0 | grep addr: | awk '{ print $2 }' | cut -d: -f2<|im_e...
Gets IP address of eth0 network interface.
ifconfig eth0 | grep addr: | awk '{ print $2 }' | cut -d: -f2
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system processes and alerts if any process becomes unresponsive.<|im_end|> <|im_start|>assistant #!/bin/bash wh...
Create a script that monitors system processes and alerts if any process becomes unresponsive.
#!/bin/bash while true; do ps aux | grep -v 'USER' | awk '{print $8, $11}' | grep -v 'S' | grep -v 'R' | grep -v 'D' sleep 600 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files under /mnt/naspath directory without descending into .snapshot directory that were modified in last 24 hours with null characte...
Find all files under /mnt/naspath directory without descending into .snapshot directory that were modified in last 24 hours with null character as the delimiter
find /mnt/naspath -name .snapshot -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 Runs 'tty' command in a subshell that is opened by built-in function 'true'.<|im_end|> <|im_start|>assistant true | echo `tty | sed 's:/dev/::...
Runs 'tty' command in a subshell that is opened by built-in function 'true'.
true | echo `tty | sed 's:/dev/::'`
AnishJoshi/nl2bash-custom
<|im_start|>system 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 for everything under the current directory, displaying human-readable file type description for each entry.<|im_end|> <|im_...
Recursively search for everything under the current directory, displaying human-readable file type description for each entry.
find . -exec 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 Create a script to check if a given string is a palindrome or not.<|im_end|> <|im_start|>assistant #!/bin/bash str="radar" reversed="" for ((...
Create a script to check if a given string is a palindrome or not.
#!/bin/bash str="radar" reversed="" for ((i=${#str}-1; i>=0; i--)); do reversed+="${str:i:1}" done if [ "$str" = "$reversed" ]; then echo "$str is a palindrome" else echo "$str 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 Append "\r" on each line of file "input" and display the printable characters<|im_end|> <|im_start|>assistant sed 's/$/\r/g' input |od -c<|im_...
Append "\r" on each line of file "input" and display the printable characters
sed 's/$/\r/g' input |od -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 set alias "psgrep" for command "ps -ef | grep"<|im_end|> <|im_start|>assistant alias psgrep="ps -ef | grep"<|im_end|>
set alias "psgrep" for command "ps -ef | grep"
alias psgrep="ps -ef | 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 Monitor Apache access logs in real-time and display the latest access entries.<|im_end|> <|im_start|>assistant #!/bin/bash tail -f /var/log/a...
Monitor Apache access logs in real-time and display the latest access entries.
#!/bin/bash tail -f /var/log/apache2/access.log
AnishJoshi/nl2bash-custom
<|im_start|>system 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 file size and directory size in human readable format of the current directory tree 2 levels deep<|im_end|> <|im_start|>assistant tr...
Print the file size and directory size in human readable format of the current directory tree 2 levels deep
tree --du -h -L 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 display the contents of all the files in the current folder which have the name "dummy" and discard all the errors while searching<|im_end|> <...
display the contents of all the files in the current folder which have the name "dummy" and discard all the errors while searching
find / -type f -name dummy 2>/dev/null -exec cat {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 files under and below the directory given as variable $FULFILLMENT<|im_end|> <|im_start|>assistant find $FULFILLMENT -ls<|im_end|>
List all files under and below the directory given as variable $FULFILLMENT
find $FULFILLMENT -ls
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files on your system that are world writable<|im_end|> <|im_start|>assistant find / -wholename '/proc' -prune -o -type f -perm -00...
Find all files on your system that are world writable
find / -wholename '/proc' -prune -o -type f -perm -0002 -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 display all the directories in the folder /path/to/dest except tmp and cache directories<|im_end|> <|im_start|>assistant find /path/to/dest -t...
display all the directories in the folder /path/to/dest except tmp and cache directories
find /path/to/dest -type d \ -o \ -print
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all files ending with ".fq" and give is as input to the fastQC command<|im_end|> <|im_start|>assistant find . -name "*.fq" | xargs -n 1 f...
find all files ending with ".fq" and give is as input to the fastQC command
find . -name "*.fq" | xargs -n 1 fastqc
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all *.txt files/directories under current directory and execute process once with all of them as arguments<|im_end|> <|im_start|>assistan...
Find all *.txt files/directories under current directory and execute process once with all of them as arguments
find . -name \*.txt -print0 | xargs -0 process
AnishJoshi/nl2bash-custom
<|im_start|>system 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 byte size of all content of $1 folder in 'uiTotalSize' variable.<|im_end|> <|im_start|>assistant uiTotalSize=$(ls -l -R $1 | grep -v ^d ...
Saves byte size of all content of $1 folder in 'uiTotalSize' variable.
uiTotalSize=$(ls -l -R $1 | grep -v ^d | awk '{total+=$5;} END {print total;}')
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system file integrity using cryptographic hashes and alerts if any files are tampered with.<|im_end|> <|im_start...
Create a script that monitors system file integrity using cryptographic hashes and alerts if any files are tampered with.
#!/bin/bash while true; do find /etc -type f -exec sha256sum {} + > /tmp/file_hashes.txt sleep 3600 compare_file_hashes 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 Write the current date and time followed by " 0" to the console and append to "log.csv"<|im_end|> <|im_start|>assistant echo $ "0" | tee -a lo...
Write the current date and time followed by " 0" to the console and append to "log.csv"
echo $ "0" | tee -a log.csv
AnishJoshi/nl2bash-custom
<|im_start|>system 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 files in the "${S}/bundled-libs" folder except "libbass.so"<|im_end|> <|im_start|>assistant find "${S}/bundled-libs" \! -name 'libb...
Delete all files in the "${S}/bundled-libs" folder except "libbass.so"
find "${S}/bundled-libs" \! -name 'libbass.so' -delete
AnishJoshi/nl2bash-custom
<|im_start|>system 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 directory "uploads" in current folder and change the permission of the folder and all the files to 755<|im_end|> <|im_start|>as...
search for the directory "uploads" in current folder and change the permission of the folder and all the files to 755
find . -type d -name 'uploads' | while read d; do chmod -R 755 "$d"; 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 Replace "foo" with "bar" in all PHP files in the current directory tree<|im_end|> <|im_start|>assistant find . -name "*.php" -print | xargs se...
Replace "foo" with "bar" in all PHP files in the current directory tree
find . -name "*.php" -print | xargs sed -i 's/foo/bar/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 Find all files under trunk directory and upload them to https://PATH_TO_NEXUS/trunk/<|im_end|> <|im_start|>assistant find trunk -type f -exec ...
Find all files under trunk directory and upload them to https://PATH_TO_NEXUS/trunk/
find trunk -type f -exec curl --user user:pass --ftp-create-dirs -T {} https://PATH_TO_NEXUS/{} \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 directory exists.<|im_end|> <|im_start|>assistant #!/bin/bash directory="/path/to/your/directory" if [ -d "$directory" ]; then ...
Check if a directory exists.
#!/bin/bash directory="/path/to/your/directory" if [ -d "$directory" ]; then echo "$directory exists" else echo "$directory does not exist" 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 last 1000 lines of all files matching "/var/spool/cron/*"<|im_end|> <|im_start|>assistant tail -n 1000 /var/spool/cron/*<|im_end|>
Print the last 1000 lines of all files matching "/var/spool/cron/*"
tail -n 1000 /var/spool/cron/*
AnishJoshi/nl2bash-custom
<|im_start|>system 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" that do not contain a "." and append ".jpg" to their file name<|im_end|> <|im_start|>assistant find /path -type f...
Find all files under "/path" that do not contain a "." and append ".jpg" to their file name
find /path -type f -not -name "*.*" -print0 | xargs -0 rename 's/$/$1.jpg/'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system sudo command usage and send an alert if any unauthorized sudo commands are executed.<|im_end|> <|im_start|>a...
Create a script to monitor system sudo command usage and send an alert if any unauthorized sudo commands are executed.
#!/bin/bash sudo_logs="/var/log/auth.log" unauthorized_sudo=$(grep -i 'sudo' $sudo_logs | grep -i 'not allowed' | wc -l) if [ "$unauthorized_sudo" -gt "0" ]; then echo "Unauthorized sudo command usage detected." | mail -s "Unauthorized Sudo 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 display all the regular files in the current folder which have the permission 777<|im_end|> <|im_start|>assistant find . -type f -perm 777<|im...
display all the regular files in the current folder which have the permission 777
find . -type f -perm 777
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Searches available packages by word 'zsh'.<|im_end|> <|im_start|>assistant yum search zsh<|im_end|>
Searches available packages by word 'zsh'.
yum search zsh
AnishJoshi/nl2bash-custom
<|im_start|>system 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 an archive and show a progress bar<|im_end|> <|im_start|>assistant tar -c --checkpoint=.1000 /var<|im_end|>
create an archive and show a progress bar
tar -c --checkpoint=.1000 /var
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find target.out files starting from /starting/path and pass them as arguments to /path/to/simpleGrepScript.sh<|im_end|> <|im_start|>assistant ...
Find target.out files starting from /starting/path and pass them as arguments to /path/to/simpleGrepScript.sh
find /starting/path -name target.out | xargs /path/to/simpleGrepScript.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 Create a script to find the average of numbers in a file.<|im_end|> <|im_start|>assistant #!/bin/bash sum=0 count=0 while read -r num; do ...
Create a script to find the average of numbers in a file.
#!/bin/bash sum=0 count=0 while read -r num; do sum=$((sum + num)) count=$((count + 1)) done < numbers.txt average=$(echo "scale=2; $sum / $count" | bc) echo "The average of numbers in the file is: $average"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 instances of a file in current folder and display all errors apart from permission denied<|im_end|> <|im_start|>assistant find . -nam...
find all instances of a file in current folder and display all errors apart from permission denied
find . -name "my.txt" 2>&1 | grep -v "Permission denied"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Highlights current day in a month calendar with color.<|im_end|> <|im_start|>assistant cal -h | sed "s/$/"$'\033\[94m&\033\[0m/g'<|im_end|>
Highlights current day in a month calendar with color.
cal -h | sed "s/$/"$'\033\[94m&\033\[0m/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 Recursively change owner to "amzadm" and group to "root" of all files in "/usr/lib/python2.6/site-packages/awscli/"<|im_end|> <|im_start|>assi...
Recursively change owner to "amzadm" and group to "root" of all files in "/usr/lib/python2.6/site-packages/awscli/"
chown amzadm.root -R /usr/lib/python2.6/site-packages/awscli/
AnishJoshi/nl2bash-custom
<|im_start|>system 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 'string_to_find' from all files under current directory<|im_end|> <|im_start|>assistant find . -type f | xargs grep 'string_to_find' -s...
Delete 'string_to_find' from all files under current directory
find . -type f | xargs grep 'string_to_find' -sl | xargs perl -pi -w -e 's/string_to_find//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 Monitor failed login attempts and display the count for each user.<|im_end|> <|im_start|>assistant #!/bin/bash grep 'Failed password' /var/lo...
Monitor failed login attempts and display the count for each user.
#!/bin/bash grep 'Failed password' /var/log/auth.log | awk '{print $9}' | 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 Run 'join' on file1 and file2, using a literal tab character as field separator.<|im_end|> <|im_start|>assistant join -t $'\t' file1 file2<|im...
Run 'join' on file1 and file2, using a literal tab character as field separator.
join -t $'\t' 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 Check if a specific directory exists and is executable by the group.<|im_end|> <|im_start|>assistant #!/bin/bash directory="/path/to/director...
Check if a specific directory exists and is executable by the group.
#!/bin/bash directory="/path/to/directory" if [ -x "$directory" ]; then echo "$directory exists and is executable by the group" else echo "$directory either does not exist or is not executable by the group" fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find "*.dat" files recursively in the current directory, print the lines starting on line 5 to the console and save to "concat.txt"<|im_end|> ...
Find "*.dat" files recursively in the current directory, print the lines starting on line 5 to the console and save to "concat.txt"
find . -type f \( -name "*.dat" \) -exec tail -n+5 -q "$file" {} + |tee concat.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 Pass a single argument containing a string of numbers from 1 to 100000 to "/bin/true"<|im_end|> <|im_start|>assistant /bin/true "$"<|im_end|>
Pass a single argument containing a string of numbers from 1 to 100000 to "/bin/true"
/bin/true "$"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all the directories in current folder and do not search in sub directories and create the same directory structure in another folder<|im_...
find all the directories in current folder and do not search in sub directories and create the same directory structure in another folder
find . -maxdepth 1 -type d -print0 |
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Prints dates of $m month in $y year, preceded by month number and slash like ' 10/1'.<|im_end|> <|im_start|>assistant cal $m $y | sed -e '1,2d...
Prints dates of $m month in $y year, preceded by month number and slash like ' 10/1'.
cal $m $y | sed -e '1,2d' -e 's/^/ /' -e "s/ \/ $m\/\1/g"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Save the current date, system host name, and "$changes" with newlines removed to variable "subj"<|im_end|> <|im_start|>assistant subj="$ - $ -...
Save the current date, system host name, and "$changes" with newlines removed to variable "subj"
subj="$ - $ - $"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 regular/normal files in the current folder which have been modified after a specific time stamp and do not search in the sub d...
display all the regular/normal files in the current folder which have been modified after a specific time stamp and do not search in the sub directories
find -maxdepth 1 -type f newermt "$timestamp"'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 uppercase.<|im_end|> <|im_start|>assistant #!/bin/bash your_string="your string" echo "$your_string" | tr '[:lower:]' '[...
Convert a string to uppercase.
#!/bin/bash your_string="your string" echo "$your_string" | tr '[:lower:]' '[:upper:]'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 Subscription.java under current directory, and go to directory containing it.<|im_end|> <|im_start|>assistant cd "$(find . -name Su...
Search for Subscription.java under current directory, and go to directory containing it.
cd "$(find . -name Subscription.java -printf '%h\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 alias "X2" for command "| cut -d' ' -f2"<|im_end|> <|im_start|>assistant alias -g X2="| cut -d' ' -f2"<|im_end|>
set alias "X2" for command "| cut -d' ' -f2"
alias -g X2="| cut -d' ' -f2"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Download "http://www.multitran.ru/c/m.exe?CL=1&s=hello&l1=1" and convert encoding to "windows-1251" and print only printable characters<|im_en...
Download "http://www.multitran.ru/c/m.exe?CL=1&s=hello&l1=1" and convert encoding to "windows-1251" and print only printable characters
curl 'http://www.multitran.ru/c/m.exe?CL=1&s=hello&l1=1' | iconv -f windows-1251 | tr -dc '[: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 Format the time string @133986838 according to the default time format and save it to variable 'VARIABLENAME'<|im_end|> <|im_start|>assistant ...
Format the time string @133986838 according to the default time format and save it to variable 'VARIABLENAME'
VARIABLENAME=$
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Monitor CPU temperature every 10 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/bash for ((i=0; i<6; i+...
Monitor CPU temperature every 10 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<6; i++)); do sensors | grep 'Core' >> cpu_temperature.log sleep 10 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files/directories under /path/to/dir/* paths and print the timestamp along with their paths and stat them<|im_end|> <|im_start|>assis...
Find all files/directories under /path/to/dir/* paths and print the timestamp along with their paths and stat them
find /path/to/dir/* -printf "%T@|%p|%l" -exec stat -Lc "|%Y.0000000000" {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 working directory separated by newlines instead of forward slashes<|im_end|> <|im_start|>assistant pwd | tr '/' '\n'<|im_end|>
Print working directory separated by newlines instead of forward slashes
pwd | tr '/' '\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 Create a script to find the number of files with a specific prefix in a directory.<|im_end|> <|im_start|>assistant #!/bin/bash dir="/path/to/...
Create a script to find the number of files with a specific prefix in a directory.
#!/bin/bash dir="/path/to/directory" prefix="file" count=$(ls "$dir"/$prefix* 2>/dev/null | wc -l) echo "The number of files with prefix '$prefix' in the directory is: $count"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 disk usage and send an alert if usage exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bash thr...
Create a script to monitor disk usage and send an alert if usage exceeds a certain threshold.
#!/bin/bash threshold=90 usage=$(df -h / | awk 'NR==2 {print $5}' | sed 's/%//') if [ "$usage" -gt "$threshold" ]; then echo "Disk 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 Counts the number of lines in each file but png|jpg|ico files in a git repository.<|im_end|> <|im_start|>assistant git ls-files | grep -vE "" ...
Counts the number of lines in each file but png|jpg|ico files in a git repository.
git ls-files | grep -vE "" | 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 Create a script to count the number of vowels in a given string.<|im_end|> <|im_start|>assistant #!/bin/bash str="hello world" vowel_count=$(...
Create a script to count the number of vowels in a given string.
#!/bin/bash str="hello world" vowel_count=$(echo "$str" | grep -o -i '[aeiou]' | wc -l) echo "The number of vowels in the string is: $vowel_count"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 unique file extensions in the current directory tree<|im_end|> <|im_start|>assistant find . -type f | sed -e 's/.*\.//' | ...
Count the number of unique file extensions in the current directory tree
find . -type f | sed -e 's/.*\.//' | sed -e 's/.*\///' | sort | uniq -c | sort -rn
AnishJoshi/nl2bash-custom
<|im_start|>system 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 true directory name of the current directory<|im_end|> <|im_start|>assistant readlink `pwd`<|im_end|>
Print true directory name of the current directory
readlink `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 Find files in the current directory tree that match "pattern" and run "git diff" on them<|im_end|> <|im_start|>assistant find . -name "pattern...
Find files in the current directory tree that match "pattern" and run "git diff" on them
find . -name "pattern" | xargs git diff --
AnishJoshi/nl2bash-custom
<|im_start|>system 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 default SSH public key to "somehost" as user "myname"<|im_end|> <|im_start|>assistant ssh-copy-id myname@somehost<|im_end|>
Copy default SSH public key to "somehost" as user "myname"
ssh-copy-id myname@somehost
AnishJoshi/nl2bash-custom
<|im_start|>system 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 files/directories under current directory<|im_end|> <|im_start|>assistant find | perl -lne 'print quotemeta' | xargs ls -d<|im_end|>
List all files/directories under current directory
find | perl -lne 'print quotemeta' | xargs ls -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 all the html files in current folder and replace old string with new string<|im_end|> <|im_start|>assistant find . -name '*.html' -print0...
find all the html files in current folder and replace old string with new string
find . -name '*.html' -print0 | xargs -0 perl -pi -e 's/oldstring/newstring/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 Reports time consumed by command 'sleep 1' to the file time.txt together, and saves command error output to sleep.stderr.<|im_end|> <|im_start...
Reports time consumed by command 'sleep 1' to the file time.txt together, and saves command error output to sleep.stderr.
{ time sleep 1 2> sleep.stderr ; } 2> time.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 files/directories that were modified more than 2 days ago and redirect the list to ~/output.file<|im_end|> <|im_start|>assistant find...
Find all files/directories that were modified more than 2 days ago and redirect the list to ~/output.file
find . -mtime +2 | perl -pe 's{^}{\"};s{$}{\"}' > ~/output.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 Copy local file "file" via ssh to remote "host" path "/directory/"<|im_end|> <|im_start|>assistant rsync -e ssh file host:/directory/.<|im_end...
Copy local file "file" via ssh to remote "host" path "/directory/"
rsync -e ssh file host:/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 find all the files in the folder /opt which have been modified between 20 to 50 days ago<|im_end|> <|im_start|>assistant find /opt -mtime +30 ...
find all the files in the folder /opt which have been modified between 20 to 50 days ago
find /opt -mtime +30 -mtime -50
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to find the difference between two dates.<|im_end|> <|im_start|>assistant #!/bin/bash date1="2023-01-01" date2="2024-01-01" s...
Create a script to find the difference between two dates.
#!/bin/bash date1="2023-01-01" date2="2024-01-01" seconds_diff=$(($(date -d "$date2" +%s) - $(date -d "$date1" +%s))) days_diff=$((seconds_diff / 86400)) echo "The difference between the dates is: $days_diff days"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Set the modification timestamp of file 'filename' to specified date/time.<|im_end|> <|im_start|>assistant touch -m --date="Wed Jun 12 14:00:00...
Set the modification timestamp of file 'filename' to specified date/time.
touch -m --date="Wed Jun 12 14:00:00 IDT 2013" filename
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a compressed tarball of a directory and encrypt it with GPG.<|im_end|> <|im_start|>assistant #!/bin/bash dir_to_backup="/path/to/sourc...
Create a compressed tarball of a directory and encrypt it with GPG.
#!/bin/bash dir_to_backup="/path/to/source" backup_name="backup_$(date +"%Y%m%d").tar.gz.gpg" tar czf - $dir_to_backup | gpg -c > $backup_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 Recursively finds latest modified file in a directory<|im_end|> <|im_start|>assistant find . -type f -print0 | xargs -0 stat -f "%m %N" | sort...
Recursively finds latest modified file in a directory
find . -type f -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -1 | cut -f2- -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 Rename absolute path of symbolic link "dirln" to "dir2"<|im_end|> <|im_start|>assistant mv "$" dir2<|im_end|>
Rename absolute path of symbolic link "dirln" to "dir2"
mv "$" 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 Create a script to find the sum of all digits in a text file.<|im_end|> <|im_start|>assistant #!/bin/bash sum=0 while read -r -n1 char; do ...
Create a script to find the sum of all digits in a text file.
#!/bin/bash sum=0 while read -r -n1 char; do if [[ "$char" =~ [0-9] ]]; then sum=$((sum + char)) fi done < textfile.txt echo "The sum of digits in the file is: $sum"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the list of files in a directory with their sizes and last access times sorted by last access time.<|im_end|> <|im_start|>assistant #!/b...
Print the list of files in a directory with their sizes and last access times sorted by last access time.
#!/bin/bash ls -l --time-style=long-iso /path/to/your/directory | awk '{print $5, $6, $7, $8, $9}' | sort -k 4
AnishJoshi/nl2bash-custom
<|im_start|>system 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 `images' directory tree for regular files<|im_end|> <|im_start|>assistant find images/ -type f<|im_end|>
Search the `images' directory tree for regular files
find images/ -type f
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print all filenames in /usr/src except for those that are of the form '*,v' or '.*,v'<|im_end|> <|im_start|>assistant find /usr/src -not \ '{}...
Print all filenames in /usr/src except for those that are of the form '*,v' or '.*,v'
find /usr/src -not \ '{}' \; -print
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Read a line from standard input into variable "SSHPASS" with prompt "Password: " and without echoing the input<|im_end|> <|im_start|>assistant...
Read a line from standard input into variable "SSHPASS" with prompt "Password: " and without echoing the input
read -p "Password: " -s SSHPASS
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Replace ",," with ", ," twice in "data.csv" and display the "," delimited result as a table<|im_end|> <|im_start|>assistant sed 's/,,/, ,/g;s/...
Replace ",," with ", ," twice in "data.csv" and display the "," delimited result as a table
sed 's/,,/, ,/g;s/,,/, ,/g' data.csv | column -s, -t
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Prints current directory name<|im_end|> <|im_start|>assistant pwd | awk -F/ '{print $NF}'<|im_end|>
Prints current directory name
pwd | awk -F/ '{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 For every cron job with a comment "change-enabled" at the end of its crontab entry, change the scheduled hour to 7.<|im_end|> <|im_start|>assi...
For every cron job with a comment "change-enabled" at the end of its crontab entry, change the scheduled hour to 7.
crontab -l | sed -re '/# *change-enabled *$/s/^ [^ ]+/\1 7/' | crontab -
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user count lines of C or C++ or Obj-C or Java code under the current directory<|im_end|> <|im_start|>assistant find . \ -print0 | xargs -0 wc<|im_e...
count lines of C or C++ or Obj-C or Java code under the current directory
find . \ -print0 | xargs -0 wc
AnishJoshi/nl2bash-custom
<|im_start|>system 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 "erl" executable in $PATH and read the "RELEASES" file to extract the erlang release number<|im_end|> <|im_start|>assistant awk -F, '...
Find the "erl" executable in $PATH and read the "RELEASES" file to extract the erlang release number
awk -F, 'NR==1 {gsub(/"/,"",$3);print $3}' "$(dirname $(readlink -f $(which erl)))/../releases/RELEASES"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 regular files in the folder /home which have the permission 077<|im_end|> <|im_start|>assistant find /home -type f -perm 07...
search for all the regular files in the folder /home which have the permission 077
find /home -type f -perm 0777 -print
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files in current directory that were modified less than 1 day ago excluding hidden files and archive them and put the output into th...
Find all files in current directory that were modified less than 1 day ago excluding hidden files and archive them and put the output into the variable file_changed
file_changed=$(find . -depth \( -wholename \./\.\* \) -prune -o -mtime -1 -print | cpio -oav)
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user create a zip file of all the files in some directory<|im_end|> <|im_start|>assistant find $directory -type -f -execdir zip -j $ZipFileName {}\...
create a zip file of all the files in some directory
find $directory -type -f -execdir zip -j $ZipFileName {}\;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 first "." separated field of the system host name to variable "HOSTZ"<|im_end|> <|im_start|>assistant HOSTZ=$<|im_end|>
Save the first "." separated field of the system host name to variable "HOSTZ"
HOSTZ=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 output of 'script -q /dev/null ./a' to standard output and "output.txt"<|im_end|> <|im_start|>assistant script -q /dev/null ./a | tee ou...
Print output of 'script -q /dev/null ./a' to standard output and "output.txt"
script -q /dev/null ./a | tee output.txt
AnishJoshi/nl2bash-custom