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 Redirects time output to file.<|im_end|> <|im_start|>assistant { time find / 2>/dev/null; } 2>time.txt<|im_end|>
Redirects time output to file.
{ time find / 2>/dev/null; } 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 any files or directories called ".svn" under the current directory and run a long list on each one, displaying a line count of the result...
find any files or directories called ".svn" under the current directory and run a long list on each one, displaying a line count of the resultant output.
find . -iname .svn -exec bash -c 'ls -l "{}" | wc -l' \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find files that are writable by the user, the group, or both<|im_end|> <|im_start|>assistant find plsql -type f -perm /ug=rw -exec ls -l {} \...
Find files that are writable by the user, the group, or both
find plsql -type f -perm /ug=rw -exec ls -l {} \; 2>/dev/null
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Save the system host name into variable "HOST"<|im_end|> <|im_start|>assistant HOST=$<|im_end|>
Save the system host name into variable "HOST"
HOST=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 position number of day '9' in fourth line of calendar output for September, 2009.<|im_end|> <|im_start|>assistant cal 09 2009 | awk 'NR=...
Print position number of day '9' in fourth line of calendar output for September, 2009.
cal 09 2009 | awk 'NR==4{day="9"; col=index($0,day); print col }'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 file extension from standard input<|im_end|> <|im_start|>assistant sed 's/^/./' | rev | cut -d. -f1 | rev<|im_end|>
Print the last file extension from standard input
sed 's/^/./' | rev | cut -d. -f1 | rev
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all /home/folder1/*.txt files and create symlinks appending '_CUSTOM_TEXT.txt' in their names<|im_end|> <|im_start|>assistant find /home/...
Find all /home/folder1/*.txt files and create symlinks appending '_CUSTOM_TEXT.txt' in their names
find /home/folder1/*.txt -type f | awk -F '.txt' '{printf "ln -s %s %s_CUSTOM_TEXT.txt\n", $0, $1}' | 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 Use the contents of compressed files "input1.txt.gz" and "input2.txt" as arguments to "command"<|im_end|> <|im_start|>assistant command $ $<|i...
Use the contents of compressed files "input1.txt.gz" and "input2.txt" as arguments to "command"
command $ $
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user display all files in the entire file system excluding the directories /proc,/sys,/dev and those files which are writable and which are not sym...
display all files in the entire file system excluding the directories /proc,/sys,/dev and those files which are writable and which are not symbolic links and which are not sockets and which do not have the sticky bit set
find / -noleaf -wholename '/proc' -prune -o -wholename '/sys' -prune -o -wholename '/dev' -prune -o -perm -2 ! -type l ! -type s ! \ -print
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user display all files expect directories in the current folder<|im_end|> <|im_start|>assistant find . ! — type d -print<|im_end|>
display all files expect directories in the current folder
find . ! — type d -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 Counts lines in each *.cpp, *.c, *.h file.<|im_end|> <|im_start|>assistant wc -l `find . -type f \ -print`<|im_end|>
Counts lines in each *.cpp, *.c, *.h file.
wc -l `find . -type f \ -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 List all files/directories under current directory using comma (,) as the delimiter for different fields in the output<|im_end|> <|im_start|>a...
List all files/directories under current directory using comma (,) as the delimiter for different fields in the output
find . -ls|awk 'BEGIN{OFS=","}$1=$1'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Pipe an empty line to ssh-keygen.<|im_end|> <|im_start|>assistant printf "" | ssh-keygen -b 1024 -f ball -t dsa<|im_end|>
Pipe an empty line to ssh-keygen.
printf "" | ssh-keygen -b 1024 -f ball -t dsa
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find regular files under the current directory, whose name ends in .mbox, piping the output to the GNU Parallel command that will rename each ...
find regular files under the current directory, whose name ends in .mbox, piping the output to the GNU Parallel command that will rename each file to not have a file extension.
find . -type f -wholename \*.mbox | parallel mv {} {.}
AnishJoshi/nl2bash-custom
<|im_start|>system 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 lines contained in 'dax-weekly.csv' in reverse order.<|im_end|> <|im_start|>assistant cat dax-weekly.csv | awk '{a[i++]=$0} END {f...
Display all lines contained in 'dax-weekly.csv' in reverse order.
cat dax-weekly.csv | awk '{a[i++]=$0} END {for print a[j--] }'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Assign the alias rm100m to a find command that removes any .tar file larger than 100M.<|im_end|> <|im_start|>assistant alias rm100m="find / -t...
Assign the alias rm100m to a find command that removes any .tar file larger than 100M.
alias rm100m="find / -type f -name *.tar -size +100M -exec 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 Replace all commas with tab characters in 'filename.csv' and page interactively through the result.<|im_end|> <|im_start|>assistant sed "s/,/\...
Replace all commas with tab characters in 'filename.csv' and page interactively through the result.
sed "s/,/\t/g" filename.csv | 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 Create a script to count the number of occurrences of each character in a string.<|im_end|> <|im_start|>assistant #!/bin/bash str="hello worl...
Create a script to count the number of occurrences of each character in a string.
#!/bin/bash str="hello world" for ((i=0; i<${#str}; i++)); do char=${str:i:1} count=$(echo "$str" | grep -o "$char" | wc -l) echo "$char: $count" 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 count of unique lines in all files like 'list_part*'<|im_end|> <|im_start|>assistant cat list_part* | sort --unique | wc -l<|im_end|>
Print count of unique lines in all files like 'list_part*'
cat list_part* | sort --unique | 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 Move all regular files under current directory to ./newdir<|im_end|> <|im_start|>assistant find ./ -type f -print | xargs -i mv -f {} ./new...
Move all regular files under current directory to ./newdir
find ./ -type f -print | xargs -i mv -f {} ./newdir
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to calculate the average of a list of numbers.<|im_end|> <|im_start|>assistant #!/bin/bash average() { sum=0 for num ...
Create a script to calculate the average of a list of numbers.
#!/bin/bash average() { sum=0 for num in "$@"; do sum=$((sum + num)) done avg=$((sum / $#)) echo "Average: $avg" } average 10 20 30 40 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 Extract any line in sorted file "A" that does not appear in "B", "C", or "D"<|im_end|> <|im_start|>assistant cat B C D | sort | comm -2 -3 A -...
Extract any line in sorted file "A" that does not appear in "B", "C", or "D"
cat B C D | sort | comm -2 -3 A -
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to check if a specific process is running and restart it if it's not.<|im_end|> <|im_start|>assistant #!/bin/bash process_nam...
Create a script to check if a specific process is running and restart it if it's not.
#!/bin/bash process_name="process_name" if ! pgrep -x "$process_name" >/dev/null; then echo "$process_name is not running. Restarting..." # Restart command 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 standard output and error to the console and append to file "log"<|im_end|> <|im_start|>assistant ./aaa.sh 2>&1 | tee -a log<|im_end|>
Write standard output and error to the console and append to file "log"
./aaa.sh 2>&1 | tee -a 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 Installs all packages from a current folder, excluding ones that match pattern '*glob*'.<|im_end|> <|im_start|>assistant yum install --exclude...
Installs all packages from a current folder, excluding ones that match pattern '*glob*'.
yum install --exclude='*glob*' *.rpm
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Recursively removes all files like '*.pyc' in a current folder.<|im_end|> <|im_start|>assistant rm **/*.pyc<|im_end|>
Recursively removes all files like '*.pyc' in a current folder.
rm **/*.pyc
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Use the uncompressed contents of "blah.gz" as input to "some_command"<|im_end|> <|im_start|>assistant cat blah.gz | gunzip | some_command<|im_...
Use the uncompressed contents of "blah.gz" as input to "some_command"
cat blah.gz | gunzip | some_command
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a new user account with a home directory.<|im_end|> <|im_start|>assistant #!/bin/bash username="new_user" sudo useradd -m $username<|...
Create a new user account with a home directory.
#!/bin/bash username="new_user" sudo useradd -m $username
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all posix-extended regex "[a-f0-9\-]\{36\}\.jpg" files<|im_end|> <|im_start|>assistant find . -regextype posix-extended -regex "[a-f0-9\...
find all posix-extended regex "[a-f0-9\-]\{36\}\.jpg" files
find . -regextype posix-extended -regex "[a-f0-9\-]\{36\}\.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 find all the regular/normal files in the current folder and rename them to html files<|im_end|> <|im_start|>assistant find main-directory -typ...
find all the regular/normal files in the current folder and rename them to html files
find main-directory -type f -exec mv -v '{}' '{}'.html \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Compress "Hello world", base64 encode, and save to variable "FOO"<|im_end|> <|im_start|>assistant FOO=$<|im_end|>
Compress "Hello world", base64 encode, and save to variable "FOO"
FOO=$
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Read a line from standard input into variable "REPLY" with prompt "> $line "<|im_end|> <|im_start|>assistant read -p "> $line "<|im_end|>
Read a line from standard input into variable "REPLY" with prompt "> $line "
read -p "> $line "
AnishJoshi/nl2bash-custom
<|im_start|>system 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 print a multiplication table for a given number.<|im_end|> <|im_start|>assistant #!/bin/bash num=5 echo "Multiplication Ta...
Create a script to print a multiplication table for a given number.
#!/bin/bash num=5 echo "Multiplication Table for $num:" for ((i=1; i<=10; i++)); do echo "$num * $i = $((num * i))" done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system Kubernetes cluster network policies and logs any violations.<|im_end|> <|im_start|>assistant #!/bin/bash ...
Create a script that monitors system Kubernetes cluster network policies and logs any violations.
#!/bin/bash while true; do kubectl get networkpolicies 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 Monitor system memory usage and swap activity every 10 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/ba...
Monitor system memory usage and swap activity every 10 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<6; i++)); do free -m >> memory_and_swap_activity.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 Create a script to monitor system USB device connections and send an alert if any unauthorized devices are connected.<|im_end|> <|im_start|>as...
Create a script to monitor system USB device connections and send an alert if any unauthorized devices are connected.
#!/bin/bash authorized_devices="USB1 USB2" for device in $(lsusb | awk '{print $6}'); do if ! echo "$authorized_devices" | grep -q "$device"; then echo "Unauthorized USB device connected: $device" | mail -s "USB Device Alert" user@example.com fi done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user set alias "mycd" for command "cd `echo $1`"<|im_end|> <|im_start|>assistant alias mycd="cd `echo $1`"<|im_end|>
set alias "mycd" for command "cd `echo $1`"
alias mycd="cd `echo $1`"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system user account group changes and send an alert if any user group memberships are modified.<|im_end|> <|im_star...
Create a script to monitor system user account group changes and send an alert if any user group memberships are modified.
#!/bin/bash group_changes="$(grep -E 'group' /var/log/auth.log | tail -n 5)" if [ -n "$group_changes" ]; then echo "User account group changes detected: $group_changes" | mail -s "User Group Change 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 Write "ee" to standard output and as input to command "foo"<|im_end|> <|im_start|>assistant echo 'ee' | tee /dev/tty | foo<|im_end|>
Write "ee" to standard output and as input to command "foo"
echo 'ee' | tee /dev/tty | foo
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Removes alias with 'sudo' name.<|im_end|> <|im_start|>assistant unalias sudo<|im_end|>
Removes alias with 'sudo' name.
unalias sudo
AnishJoshi/nl2bash-custom
<|im_start|>system 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 Java home in variable "JAVA_HOME"<|im_end|> <|im_start|>assistant JAVA_HOME="$( readlink -f "$" | sed "s:bin/.*$::" )"<|im_end|>
Save Java home in variable "JAVA_HOME"
JAVA_HOME="$( readlink -f "$" | sed "s:bin/.*$::" )"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 .svn files/directories under current directory<|im_end|> <|im_start|>assistant find . -name .svn -exec echo {} \;<|im_end|>
List all .svn files/directories under current directory
find . -name .svn -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 Search for the string 'magic' in all regular files under current directory tree and display long listing of them<|im_end|> <|im_start|>assista...
Search for the string 'magic' in all regular files under current directory tree and display long listing of them
find . -type f -exec grep "magic" {} \; -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 the text files that have modified in the last 2 days and not modified today<|im_end|> <|im_start|>assistant find . -name "*.txt" -typ...
find all the text files that have modified in the last 2 days and not modified today
find . -name "*.txt" -type f -daystart -mtime +0 -mtime -2
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all *.mp3 files under current directory and run mplayer with these files<|im_end|> <|im_start|>assistant find . -name \*.mp3 -print0 | xa...
Find all *.mp3 files under current directory and run mplayer with these files
find . -name \*.mp3 -print0 | xargs -0 mplayer
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create an empty file in each directory named "mydir" under current directory.<|im_end|> <|im_start|>assistant find . -type d -name "mydir" -pr...
Create an empty file in each directory named "mydir" under current directory.
find . -type d -name "mydir" -print | sed 's/$/\/abc.txt/g' | xargs touch
AnishJoshi/nl2bash-custom
<|im_start|>system 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 in detail regular files from the current directory tree whose names match Perl regular expression '\w+-\d+x\d+\.\w+$'<|im_end|> <|im_star...
List in detail regular files from the current directory tree whose names match Perl regular expression '\w+-\d+x\d+\.\w+$'
find -type f | grep -P '\w+-\d+x\d+\.\w+$' | sed -re 's//\\\1/g' | xargs 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 Count the number of lines in a file.<|im_end|> <|im_start|>assistant #!/bin/bash file_path="/path/to/your/file.txt" wc -l "$file_path"<|im_e...
Count the number of lines in a file.
#!/bin/bash file_path="/path/to/your/file.txt" wc -l "$file_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 Check if a string is a valid IPv4 address.<|im_end|> <|im_start|>assistant #!/bin/bash ip_address="192.168.1.1" if [[ "$ip_address" =~ ^([0-...
Check if a string is a valid IPv4 address.
#!/bin/bash ip_address="192.168.1.1" if [[ "$ip_address" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then echo "$ip_address is a valid IPv4 address" else echo "$ip_address is not a valid IPv4 address" 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 a single line of numbers from "001" to "010"<|im_end|> <|im_start|>assistant yes | head -n 10 | awk '{printf}'<|im_end|>
Print a single line of numbers from "001" to "010"
yes | head -n 10 | 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 Print current shell using process ID<|im_end|> <|im_start|>assistant ps -p $$<|im_end|>
Print current shell using process ID
ps -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 Filters only directories including hidden ones from long file listing of a current directory, and prints their names.<|im_end|> <|im_start|>as...
Filters only directories including hidden ones from long file listing of a current directory, and prints their names.
ls -Al | grep "^d" | awk -F" " '{print $9}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system network connections and generate reports on established connections.<|im_end|> <|im_start|>assistant #!/bin/...
Create a script to monitor system network connections and generate reports on established connections.
#!/bin/bash touch /tmp/network_connections_report.txt while true; do netstat -tupan | grep 'ESTABLISHED' >> /tmp/network_connections_report.txt sleep 3600 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user search for all png files in a folder and copy them to another folder<|im_end|> <|im_start|>assistant find /home/mine -iname "*.png" -exec sh -...
search for all png files in a folder and copy them to another folder
find /home/mine -iname "*.png" -exec sh -c 'cp $0 /home/mine/pngcoppies/copy/$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 Check the bit width of static library "libsomefile.a"<|im_end|> <|im_start|>assistant readelf -a -W libsomefile.a | grep Class: | sort | uniq<...
Check the bit width of static library "libsomefile.a"
readelf -a -W libsomefile.a | grep Class: | sort | uniq
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a string contains only printable characters.<|im_end|> <|im_start|>assistant #!/bin/bash string="your string" if [[ "$string" =~ ^[...
Check if a string contains only printable characters.
#!/bin/bash string="your string" if [[ "$string" =~ ^[ -~]+$ ]]; then echo "$string contains only printable characters" else echo "$string does not contain only printable characters" fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all php files in current directory and delete lines matching the regex '<\?php \/\*\*\/eval(base64_decode);.*\?>' in those files<|im_end|...
Find all php files in current directory and delete lines matching the regex '<\?php \/\*\*\/eval(base64_decode);.*\?>' in those files
find . \ -exec grep -Hn "<\?php /\*\*/eval(base64_decode);.*\?>" {} \; -exec sed -i '/<\?php \/\*\*\/eval(base64_decode);.*\?>/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 Save the latest modification time (in format "%T@ %t" of any file under "./$dir" to variable "timestamp"<|im_end|> <|im_start|>assistant times...
Save the latest modification time (in format "%T@ %t" of any file under "./$dir" to variable "timestamp"
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 search for a file using name patterns from the list of all the regular files in the folder project and save the output to the file Include.<|i...
search for a file using name patterns from the list of all the regular files in the folder project and save the output to the file Include.
find project -type f -print | egrep '$' > Include
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files that contain the case insensitive regex 'stringtofind' in maximum 1 level down the / directory without descending into other pa...
Find all files that contain the case insensitive regex 'stringtofind' in maximum 1 level down the / directory without descending into other partitions
find / -maxdepth 1 -xdev -type f -exec grep -Zli "stringtofind" {} +
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Send SIGHUP (hangup) signal to all parents of zombie processes.<|im_end|> <|im_start|>assistant kill -HUP $(ps -A -ostat,ppid | grep -e '[zZ]'...
Send SIGHUP (hangup) signal to all parents of zombie processes.
kill -HUP $(ps -A -ostat,ppid | grep -e '[zZ]'| awk '{ print $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 amount of space available on the file system containg path to the current working directory.<|im_end|> <|im_start|>assistant df . | awk ...
Print amount of space available on the file system containg path to the current working directory.
df . | awk '$3 ~ /[0-9]+/ { print $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 Get domain name of $ip and save it to the variable 'reverse'<|im_end|> <|im_start|>assistant reverse=$(dig -x $ip +short)<|im_end|>
Get domain name of $ip and save it to the variable 'reverse'
reverse=$(dig -x $ip +short)
AnishJoshi/nl2bash-custom
<|im_start|>system 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 leaf directories under current directory<|im_end|> <|im_start|>assistant find -depth -type d | while read dir; do [[ ! $prev =~ $di...
List all leaf directories under current directory
find -depth -type d | while read dir; do [[ ! $prev =~ $dir ]] && echo "${dir}" ; prev="$dir"; 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 the list of available shells on the system.<|im_end|> <|im_start|>assistant #!/bin/bash cat /etc/shells<|im_end|>
Print the list of available shells on the system.
#!/bin/bash cat /etc/shells
AnishJoshi/nl2bash-custom
<|im_start|>system 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 directory given as variable $backuppath recursively for files that were last modified less than 10 days ago and save the list of th...
Search the directory given as variable $backuppath recursively for files that were last modified less than 10 days ago and save the list of them to file.list
find "${backuppath}" -mtime -10 > file.list
AnishJoshi/nl2bash-custom
<|im_start|>system 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 network bandwidth usage and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant...
Create a script to monitor system network bandwidth usage and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold=1000000 bandwidth=$(cat /proc/net/dev | grep 'eth0' | awk '{print $2}') if [ "$bandwidth" -gt "$threshold" ]; then echo "System network bandwidth usage exceeds $threshold bytes." # 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 Look for all files managed by git in the current repository whose name or file type description contains the word "ASCII", display the number ...
Look for all files managed by git in the current repository whose name or file type description contains the word "ASCII", display the number of lines contained in each match.
git ls-files | xargs file | grep "ASCII" | cut -d : -f 1 | 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 Find files/directories under current directory and write them to a file as null terminated strings.<|im_end|> <|im_start|>assistant find -fpri...
Find files/directories under current directory and write them to a file as null terminated strings.
find -fprint0
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system network interface broadcast packets and alerts if any interface exceeds a certain threshold.<|im_end|> <|...
Create a script that monitors system network interface broadcast packets and alerts if any interface exceeds a certain threshold.
#!/bin/bash threshold=100 while true; do sar -n EDEV 1 1 | grep -w '.*[0-9]' | awk '$(NF-3) > "$threshold" {print $1, $(NF-3)}' sleep 60 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the mount point of the last mounted drive<|im_end|> <|im_start|>assistant mount | tail -1 | sed -e "s/^[^/]*\ type .*$/\1/g"<|im_end|>
Print the mount point of the last mounted drive
mount | tail -1 | sed -e "s/^[^/]*\ type .*$/\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 Find all files/directories with '.js' extension under current directory tree without descending into and ignoring './directory' completely<|i...
Find all files/directories with '.js' extension under current directory tree without descending into and ignoring './directory' completely
find . -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 Remove all empty directories within a directory.<|im_end|> <|im_start|>assistant #!/bin/bash find /path/to/your/directory -type d -empty -del...
Remove all empty directories within a directory.
#!/bin/bash find /path/to/your/directory -type d -empty -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 Create a script that monitors system user permissions changes and alerts if any changes are detected.<|im_end|> <|im_start|>assistant #!/bin/b...
Create a script that monitors system user permissions changes and alerts if any changes are detected.
#!/bin/bash while true; do auditctl -l | grep 'chmod' 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 Creates temporary folder and saves path to it in 'td' variable.<|im_end|> <|im_start|>assistant td=$<|im_end|>
Creates temporary folder and saves path to it in 'td' variable.
td=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 CPU usage every 10 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/bash for ((i=0; i<6; i...
Monitor system CPU usage every 10 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<6; i++)); do top -bn1 | grep 'Cpu(s)' >> cpu_usage.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 Create a script that monitors system Docker container logs and alerts if any contain specific error messages.<|im_end|> <|im_start|>assistant ...
Create a script that monitors system Docker container logs and alerts if any contain specific error messages.
#!/bin/bash while true; do docker logs CONTAINER_ID | grep 'ERROR' 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 Create a script to monitor system SSL certificate expiry and send an alert if any certificates are about to expire.<|im_end|> <|im_start|>assi...
Create a script to monitor system SSL certificate expiry and send an alert if any certificates are about to expire.
#!/bin/bash certificate_expiry=$(openssl x509 -enddate -noout -in /path/to/certificate.pem | cut -d '=' -f 2) current_date=$(date +%s) expiry_date=$(date -d "$certificate_expiry" +%s) expiry_days=$(( ($expiry_date - $current_date) / (60*60*24) )) if [ "$expiry_days" -lt 30 ]; then echo "SSL certificate is about to...
AnishJoshi/nl2bash-custom
<|im_start|>system 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 Apache Kafka Connect status and restart connectors when worker errors occur.<|im_end|> <|im_start|>assistant...
Create a script to monitor system Apache Kafka Connect status and restart connectors when worker errors occur.
#!/bin/bash errors=$(curl -s "http://connect.example.com/connectors" | jq '.[].tasks[].trace' | grep -i 'ERROR') if [ "$errors" != "" ]; then curl -X POST "http://connect.example.com/connectors/restart" 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 regular files under /home/www and replace every occurrences of 'subdomainA.example.com' with 'subdomainB.example.com' in those files<...
Find all regular files under /home/www and replace every occurrences of 'subdomainA.example.com' with 'subdomainB.example.com' in those files
find /home/www -type f -print0 | xargs -0 sed -i 's/subdomainA\.example\.com/subdomainB.example.com/g'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Change the group of all directories (except those with a '.') under current directory tree to a group with the same name as the directory name...
Change the group of all directories (except those with a '.') under current directory tree to a group with the same name as the directory name
find . -type d | sed -e 's/\.\///g' -e 's/\./avoid/g' | grep -v avoid | awk '{print $1"\t"$1}' | xargs chgrp
AnishJoshi/nl2bash-custom
<|im_start|>system 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 characters in columns 34 through 39 in the output of "finger"<|im_end|> <|im_start|>assistant finger | colrm 34 39<|im_end|>
Remove characters in columns 34 through 39 in the output of "finger"
finger | colrm 34 39
AnishJoshi/nl2bash-custom
<|im_start|>system 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 COMMAND for all files and directories under the current directory tree<|im_end|> <|im_start|>assistant find . -print0 | xargs -0 COMMA...
Execute COMMAND for all files and directories under the current directory tree
find . -print0 | xargs -0 COMMAND
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Search the *.pdf files from directory tree PDFs/ for text "perry sound", ignoring the case<|im_end|> <|im_start|>assistant find PDFs/ -name '*...
Search the *.pdf files from directory tree PDFs/ for text "perry sound", ignoring the case
find PDFs/ -name '*.pdf' -exec sh -c 'pdftotext "{}" - | grep -C 2 -i --with-filename --label="{}" --color "perry sound"' \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 perl files in /var/www<|im_end|> <|im_start|>assistant find /var/www/ -type f -name "*.pl" -print<|im_end|>
find all the perl files in /var/www
find /var/www/ -type f -name "*.pl" -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 Create a script to monitor system SSH key usage and send an alert if any weak or outdated keys are found.<|im_end|> <|im_start|>assistant #!/b...
Create a script to monitor system SSH key usage and send an alert if any weak or outdated keys are found.
#!/bin/bash weak_keys="$(grep -rl 'ssh-rsa' /home/* | xargs grep -l 'ssh-dss' | xargs grep -l '1024' | xargs grep -l '2048')" if [ -n "$weak_keys" ]; then echo "Weak or outdated SSH keys found: $weak_keys" | mail -s "SSH Key Alert" user@example.com fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files under current directory without descending into .snapshot directory that were modified in last 24 hours with null character as ...
Find all files under current directory without descending into .snapshot directory that were modified in last 24 hours with null character as the delimiter
find . -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 Counts the number of lines in each file in a git repository.<|im_end|> <|im_start|>assistant git ls-files | xargs -d '\n' wc -l<|im_end|>
Counts the number of lines in each file in a git repository.
git ls-files | xargs -d '\n' wc -l
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files in /tmp whose names begin with the current user's name followed by "."<|im_end|> <|im_start|>assistant find /tmp -maxdepth 1 -n...
Find all files in /tmp whose names begin with the current user's name followed by "."
find /tmp -maxdepth 1 -name "$USER.*"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Dump a MySQL database over a compressed SSH tunnel and use it as input to mysql<|im_end|> <|im_start|>assistant mysqldump –add-drop-table –ext...
Dump a MySQL database over a compressed SSH tunnel and use it as input to mysql
mysqldump –add-drop-table –extended-insert –force –log-error=error.log -uUSER -pPASS OLD_DB_NAME | ssh -C user@newhost “mysql -uUSER -pPASS NEW_DB_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 Verbosely compresses all files on seventh and eighth depth level keeping original files in place.<|im_end|> <|im_start|>assistant bzip2 -kv */...
Verbosely compresses all files on seventh and eighth depth level keeping original files in place.
bzip2 -kv */*/*/*/*/*/*/*
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user display the contents of all the regular files in the current folder and save the output to out.txt<|im_end|> <|im_start|>assistant find . -typ...
display the contents of all the regular files in the current folder and save the output to out.txt
find . -type f | xargs cat > out.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 Create a script to monitor system POP3 packets and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bas...
Create a script to monitor system POP3 packets and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold="100" pop3_packets=$(tcpdump -c 100 pop3 | grep 'packets captured' | awk '{print $1}') if [ "$pop3_packets" -gt "$threshold" ]; then echo "System POP3 packets count is too high: $pop3_packets" | mail -s "High POP3 Packets Alert" user@example.com fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Replace 'company' with 'newcompany' in all files under current directory<|im_end|> <|im_start|>assistant find ./ -type f -exec sed -i 's/compa...
Replace 'company' with 'newcompany' in all files under current directory
find ./ -type f -exec sed -i 's/company/newcompany/' {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 | awk '/inet /{sub; print $1}'<|im_end|>
Gets IP address of 'eth0' network interface.
ifconfig eth0 | awk '/inet /{sub; 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 Prints process tree of a bash process.<|im_end|> <|im_start|>assistant pstree $<|im_end|>
Prints process tree of a bash process.
pstree $
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Shifts the positional parameters to the left by 1.<|im_end|> <|im_start|>assistant shift<|im_end|>
Shifts the positional parameters to the left by 1.
shift
AnishJoshi/nl2bash-custom
<|im_start|>system 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 the file foo.sh into /path/to/cotainer of the docker container<|im_end|> <|im_start|>assistant tar -c -C /path/on/local/machine . | docke...
Copy the file foo.sh into /path/to/cotainer of the docker container
tar -c -C /path/on/local/machine . | docker cp - dvc:/path/on/container
AnishJoshi/nl2bash-custom
<|im_start|>system 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 /mydir and replace every occurrences of <string1> with <string2> in those files invoking sed as few times as possible<|im_...
Find all files in /mydir and replace every occurrences of <string1> with <string2> in those files invoking sed as few times as possible
find /mydir -type f -exec sed -i 's/<string1>/<string2>/g' {} +
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Replace "dummyvalue" with the system IP address in "filename"<|im_end|> <|im_start|>assistant sed -i s/'dummyvalue'/$/g filename<|im_end|>
Replace "dummyvalue" with the system IP address in "filename"
sed -i s/'dummyvalue'/$/g filename
AnishJoshi/nl2bash-custom