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 Gets list of folders containing files with changes.<|im_end|> <|im_start|>assistant git diff --name-only | xargs dirname | uniq<|im_end|>
Gets list of folders containing files with changes.
git diff --name-only | xargs dirname | 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 Find all *.mov files under current directory and run an ffmpeg command with the path and the name for each file<|im_end|> <|im_start|>assista...
Find all *.mov files under current directory and run an ffmpeg command with the path and the name for each file
find . -iname "*.mov" -print0 | xargs -0 -i sh -c 'ffmpeg -i {} -f flv `basename {}`'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 text files in the directory "/path/to/inputfiles" and pass them as input to the shell script in exec command and save the outpu...
search for all text files in the directory "/path/to/inputfiles" and pass them as input to the shell script in exec command and save the output to the file out.txt
find /path/to/inputfiles -name "*.txt" -exec /path/to/myprogram.sh {} \; > 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 Print the list of users who have logged in during the last 24 hours.<|im_end|> <|im_start|>assistant #!/bin/bash who | grep "$(date +"%b %d")...
Print the list of users who have logged in during the last 24 hours.
#!/bin/bash who | grep "$(date +"%b %d")" | awk '{print $1}' | 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 Find all files that have wrong permission<|im_end|> <|im_start|>assistant find / \ \ -ls<|im_end|>
Find all files that have wrong permission
find / \ \ -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 Creates temporary file and saves path to it in 'fif2' variable.<|im_end|> <|im_start|>assistant fif2=$(mktemp -u)<|im_end|>
Creates temporary file and saves path to it in 'fif2' variable.
fif2=$(mktemp -u)
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Test if files named 'something' were found in YOUR_DIR<|im_end|> <|im_start|>assistant [[ ! -z `find 'YOUR_DIR/' -name 'something'` ]] && echo...
Test if files named 'something' were found in YOUR_DIR
[[ ! -z `find 'YOUR_DIR/' -name 'something'` ]] && echo "found" || echo "not found"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 rename all files in a directory by appending a timestamp to their names.<|im_end|> <|im_start|>assistant #!/bin/bash dir="...
Create a script to rename all files in a directory by appending a timestamp to their names.
#!/bin/bash dir="/path/to/directory" for file in "$dir"/*; do mv "$file" "$file_$(date +%Y%m%d%H%M%S)" 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 looks for all files larger than 10 megabytes within /home<|im_end|> <|im_start|>assistant find /home -type f -size +10485760c -print<|im_end|...
looks for all files larger than 10 megabytes within /home
find /home -type f -size +10485760c -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 PHP info one page at a time, pausing for user interaction after each page.<|im_end|> <|im_start|>assistant php -i | more<|im_end|>
Display PHP info one page at a time, pausing for user interaction after each page.
php -i | more
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all directories starting from root that contain the string "99966" in their names<|im_end|> <|im_start|>assistant find / -type d -name "*...
Find all directories starting from root that contain the string "99966" in their names
find / -type d -name "*99966*" -print 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 set alisa "py" for command "$EDITOR"<|im_end|> <|im_start|>assistant alias -s py=$EDITOR<|im_end|>
set alisa "py" for command "$EDITOR"
alias -s py=$EDITOR
AnishJoshi/nl2bash-custom
<|im_start|>system 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 ${S} directory<|im_end|> <|im_start|>assistant find "${S}" -type f<|im_end|>
Find all regular files under ${S} directory
find "${S}" -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 Lists enabled repositories along with debugging information.<|im_end|> <|im_start|>assistant yum -v repolist enabled<|im_end|>
Lists enabled repositories along with debugging information.
yum -v repolist enabled
AnishJoshi/nl2bash-custom
<|im_start|>system 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 tar file containing all the files in ~/Library folder that contain spaces in their names<|im_end|> <|im_start|>assistant find ~/Libra...
Create a tar file containing all the files in ~/Library folder that contain spaces in their names
find ~/Library -name '* *' -print0 | xargs -0 tar rf blah.tar
AnishJoshi/nl2bash-custom
<|im_start|>system 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 *.so files/directories under current directory and run myCommand with the file/directory paths as its argument then search for Expect...
Find all *.so files/directories under current directory and run myCommand with the file/directory paths as its argument then search for ExpectedResult in the output of myCommand
find . -name *.so -print0 | xargs -0 -I % sh -c 'echo % ; myCommand "%" | grep ExpectedResult'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Executes 'echo "$ret"' in a subshell that is opened by command 'true'.<|im_end|> <|im_start|>assistant true | echo "$ret"<|im_end|>
Executes 'echo "$ret"' in a subshell that is opened by command 'true'.
true | echo "$ret"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 "deb blah ... blah" to "/etc/apt/sources.list" as root<|im_end|> <|im_start|>assistant echo 'deb blah ... blah' | sudo tee --append /et...
Append "deb blah ... blah" to "/etc/apt/sources.list" as root
echo 'deb blah ... blah' | sudo tee --append /etc/apt/sources.list > /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 display all the files in the current directory excluding the paths "targert", "tools", "git"<|im_end|> <|im_start|>assistant find . \( ! -path...
display all the files in the current directory excluding the paths "targert", "tools", "git"
find . \( ! -path "*target*" -a ! -path "*tools*" -a ! -path "*.git*" -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 Compress the base64 encoded first 200 characters of "/dev/urandom" as input to uuencode<|im_end|> <|im_start|>assistant uuencode <<|im_end|>
Compress the base64 encoded first 200 characters of "/dev/urandom" as input to uuencode
uuencode <
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Moves window from 4 place to 3.<|im_end|> <|im_start|>assistant tmux movew -s 4 -t 3<|im_end|>
Moves window from 4 place to 3.
tmux movew -s 4 -t 3
AnishJoshi/nl2bash-custom
<|im_start|>system 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 "${MD5}" on all files found under "${1}", numerically sort the results, and save to variable "DATA"<|im_end|> <|im_start|>assistant DA...
Execute "${MD5}" on all files found under "${1}", numerically sort the results, and save to variable "DATA"
DATA=$
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all the regular/normal files in the current folder which have been accessed in the last 1440*24 hours and not modified in 1441*24 hours e...
find all the regular/normal files in the current folder which have been accessed in the last 1440*24 hours and not modified in 1441*24 hours excluding those which are in the custom sub directory tree
ionice -c 3 find . -type f -amin -1440 -mmin +1441 -not -path custom/ -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 Monitor system TCP socket statistics every 10 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/bash for (...
Monitor system TCP socket statistics every 10 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<6; i++)); do netstat -s | grep 'TCP:' >> tcp_socket_statistics.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 Execute the ruby script "genrc.rb" which will output a filename, and interpret this file in the current shell.<|im_end|> <|im_start|>assistant...
Execute the ruby script "genrc.rb" which will output a filename, and interpret this file in the current shell.
source $
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove trailing white spaces from all files under current directory ignoring directories wtih *.git* (case insensitive) in their paths and kee...
Remove trailing white spaces from all files under current directory ignoring directories wtih *.git* (case insensitive) in their paths and keep backups of the originals
find . -type f -not -iwholename '*.git*' -print0 | xargs -0 sed -i .bak -E "s/[[:space:]]*$//"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Allocate a pseudo-terminal and execute "screen -r -X ls" which executes "ls" within the screen session on host "example.com"<|im_end|> <|im_st...
Allocate a pseudo-terminal and execute "screen -r -X ls" which executes "ls" within the screen session on host "example.com"
ssh -t example.com "screen -r -X 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 Search the files from the current directory tree for "foo"<|im_end|> <|im_start|>assistant find . -exec grep foo {} \;<|im_end|>
Search the files from the current directory tree for "foo"
find . -exec grep 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 copy all the files with the extension ".type" from one folder to a target directory<|im_end|> <|im_start|>assistant find "$sourcedir" -type f ...
copy all the files with the extension ".type" from one folder to a target directory
find "$sourcedir" -type f -name "*.type" | xargs cp -t targetdir
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Brings down network interface eth0.<|im_end|> <|im_start|>assistant ifconfig eth0 down<|im_end|>
Brings down network interface eth0.
ifconfig eth0 down
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Start bash in a completely empty environment, without parsing /etc/bashrc or ~/.bashrc<|im_end|> <|im_start|>assistant env -i bash --norc<|im_...
Start bash in a completely empty environment, without parsing /etc/bashrc or ~/.bashrc
env -i bash --norc
AnishJoshi/nl2bash-custom
<|im_start|>system 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 randomly sorted list of numbers from 1 to 10 to file "/tmp/lst" and the screen followed by " -------"<|im_end|> <|im_start|>assistant ...
Print a randomly sorted list of numbers from 1 to 10 to file "/tmp/lst" and the screen followed by " -------"
seq 1 10 | sort -R | tee /tmp/lst |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/directories under /data1/Marcel which are greater than 524288 bytes and were modified or accessed more than 1 year ago<|im_end|...
List all files/directories under /data1/Marcel which are greater than 524288 bytes and were modified or accessed more than 1 year ago
find /data1/Marcel -size +1024 \ -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 Save standard input to variable "myVar"<|im_end|> <|im_start|>assistant myVar=$(tee)<|im_end|>
Save standard input to variable "myVar"
myVar=$(tee)
AnishJoshi/nl2bash-custom
<|im_start|>system 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 file exists in a directory.<|im_end|> <|im_start|>assistant #!/bin/bash dir="/path/to/directory" file="filename...
Create a script to check if a file exists in a directory.
#!/bin/bash dir="/path/to/directory" file="filename.txt" if [ -e "$dir/$file" ]; then echo "The file '$file' exists in the directory" else echo "The file '$file' does not exist in the directory" fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system root user systemd slice unit status and send an alert if any slice units are not active.<|im_end|> <|im_star...
Create a script to monitor system root user systemd slice unit status and send an alert if any slice units are not active.
#!/bin/bash slice_units="system.slice user.slice" for unit in $slice_units; do if ! systemctl is-active --quiet $unit; then echo "Slice unit $unit is not active (root user)." | mail -s "Root Slice Unit Status 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 Create a script to rename all files in a directory with a specific extension to have a .bak extension.<|im_end|> <|im_start|>assistant #!/bin/...
Create a script to rename all files in a directory with a specific extension to have a .bak extension.
#!/bin/bash for file in *.$1; do mv "$file" "${file%.*}.bak" 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 line of "$variable" '-' characters<|im_end|> <|im_start|>assistant printf '%0.s-' $<|im_end|>
Print a line of "$variable" '-' characters
printf '%0.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 Print the list of files with their owners in a directory.<|im_end|> <|im_start|>assistant #!/bin/bash ls -l /path/to/your/directory | awk '{p...
Print the list of files with their owners in a directory.
#!/bin/bash ls -l /path/to/your/directory | awk '{print $3, $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 Counts all files in a current folder and subfolders.<|im_end|> <|im_start|>assistant find -type f -exec printf '\n' \; | wc -l<|im_end|>
Counts all files in a current folder and subfolders.
find -type f -exec printf '\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 Execute "killall -USR1 dd" every minute<|im_end|> <|im_start|>assistant watch -n 60 killall -USR1 dd<|im_end|>
Execute "killall -USR1 dd" every minute
watch -n 60 killall -USR1 dd
AnishJoshi/nl2bash-custom
<|im_start|>system 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 area of a trapezoid given its bases and height.<|im_end|> <|im_start|>assistant #!/bin/bash base1=5 base2=7 heigh...
Create a script to find the area of a trapezoid given its bases and height.
#!/bin/bash base1=5 base2=7 height=4 area=$(( (base1 + base2) * height / 2 )) echo "The area of the trapezoid is: $area"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 every directory under current directory with their child executable files<|im_end|> <|im_start|>assistant find . -type d | sort | xargs -...
List every directory under current directory with their child executable files
find . -type d | sort | xargs -n1 -I{} bash -c "find {} -type f -maxdepth 1 -executable | sort -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 Merge data in file1 and file2 where second field is common in both files<|im_end|> <|im_start|>assistant join -j2 < <<|im_end|>
Merge data in file1 and file2 where second field is common in both files
join -j2 < <
AnishJoshi/nl2bash-custom
<|im_start|>system 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 *.pdf.marker files and their corresponding *.pdf files under ${INPUT_LOCATION} to ${OUTPUT_LOCATION}<|im_end|> <|im_start|>assistant ...
Move all *.pdf.marker files and their corresponding *.pdf files under ${INPUT_LOCATION} to ${OUTPUT_LOCATION}
find "${INPUT_LOCATION}" -name '*.pdf.marker' | xargs -i bash -cx 'pdf=`dirname {}`/`basename {} .marker`;[ -e "$pdf" ]&&{ mv {} "$pdf" "$0";}' "${OUTPUT_LOCATION}"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all c & c++ files in the current directory and save output names to another file<|im_end|> <|im_start|>assistant find . -name "*.c" -o -n...
find all c & c++ files in the current directory and save output names to another file
find . -name "*.c" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" > cscope.files
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Sources script incl.sh in the folder where current script is located.<|im_end|> <|im_start|>assistant source $(dirname $0)/incl.sh<|im_end|>
Sources script incl.sh in the folder where current script is located.
source $(dirname $0)/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 find & Substitute Only When the Line Matches with the Pattern Using sed<|im_end|> <|im_start|>assistant find . -type f -name "*.txt" -exec sed...
find & Substitute Only When the Line Matches with the Pattern Using sed
find . -type f -name "*.txt" -exec 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 Search directory trees foo and bar for .java files<|im_end|> <|im_start|>assistant find foo bar -name "*.java"<|im_end|>
Search directory trees foo and bar for .java files
find foo bar -name "*.java"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Recursively search through all files in all directories for any lines containing "pattern" and whose second word is not "Binary".<|im_end|> <|...
Recursively search through all files in all directories for any lines containing "pattern" and whose second word is not "Binary".
grep -Ri "pattern" * | awk '{if print $0}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the input "hello world" followed by a swap of the first two awk fields<|im_end|> <|im_start|>assistant echo hello world | tee ><|im_end...
Print the input "hello world" followed by a swap of the first two awk fields
echo hello world | tee >
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Counts lines in file $file and prints number only.<|im_end|> <|im_start|>assistant wc -l $file | awk '{print $1}';<|im_end|>
Counts lines in file $file and prints number only.
wc -l $file | awk '{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 Delete files under $LOCATION that match $REQUIRED_FILES in their names and were modified more than 1 day ago<|im_end|> <|im_start|>assistant f...
Delete files under $LOCATION that match $REQUIRED_FILES in their names and were modified more than 1 day ago
find $LOCATION -name $REQUIRED_FILES -type f -mtime +1 -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 Find all regular files in current directory and /home/www directory<|im_end|> <|im_start|>assistant find * /home/www -type f<|im_end|>
Find all regular files in current directory and /home/www directory
find * /home/www -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 Counts all non-blank lines in the $i file.<|im_end|> <|im_start|>assistant sed '/^\s*$/d' $i | wc -l ## skip blank lines<|im_end|>
Counts all non-blank lines in the $i file.
sed '/^\s*$/d' $i | wc -l ## skip blank lines
AnishJoshi/nl2bash-custom
<|im_start|>system 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 directory hierarchy from "./<SOURCE_DIR>/" to "<DEST_DIR>"<|im_end|> <|im_start|>assistant find ./<SOURCE_DIR>/ -type d | sed 's/\.\/<SOU...
Copy directory hierarchy from "./<SOURCE_DIR>/" to "<DEST_DIR>"
find ./<SOURCE_DIR>/ -type d | sed 's/\.\/<SOURCE_DIR>//g' | xargs -I {} mkdir -p <DEST_DIR>"/{}"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Set variable 'rav' to the contents of 'var' spelled backwards.<|im_end|> <|im_start|>assistant rav=$<|im_end|>
Set variable 'rav' to the contents of 'var' spelled backwards.
rav=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 environment variables sorted alphabetically.<|im_end|> <|im_start|>assistant #!/bin/bash env | sort<|im_end|>
Print the list of environment variables sorted alphabetically.
#!/bin/bash env | sort
AnishJoshi/nl2bash-custom
<|im_start|>system 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 and upload them to https://PATH_TO_NEXUS/<|im_end|> <|im_start|>assistant find . -type f -exec curl --u...
Find all files under current directory and upload them to https://PATH_TO_NEXUS/
find . -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 Create a script to remove duplicates from an array.<|im_end|> <|im_start|>assistant #!/bin/bash remove_duplicates() { arr=(1 2 2 3 3 4 5 ...
Create a script to remove duplicates from an array.
#!/bin/bash remove_duplicates() { arr=(1 2 2 3 3 4 5 5) uniq_arr=($(printf "%s\n" "${arr[@]}" | sort -u)) echo "Array without duplicates: ${uniq_arr[@]}" } remove_duplicates
AnishJoshi/nl2bash-custom
<|im_start|>system 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 '/var/lib/mongodb/mongod.lock' in 'sudo' mode.<|im_end|> <|im_start|>assistant sudo rm /var/lib/mongodb/mongod.lock<|im_end|>
Removes '/var/lib/mongodb/mongod.lock' in 'sudo' mode.
sudo rm /var/lib/mongodb/mongod.lock
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Split "file" into 10 files of about equal size without splitting lines<|im_end|> <|im_start|>assistant split -n l/10 file<|im_end|>
Split "file" into 10 files of about equal size without splitting lines
split -n l/10 file
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find & calculate total number of worlds in all .txt file from current directory<|im_end|> <|im_start|>assistant find . -type f -name '*.txt'...
Find & calculate total number of worlds in all .txt file from current directory
find . -type f -name '*.txt' -exec wc -w {} \; | awk '{total += $1} 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 Remove files that are less than 1MB in size under <directory><|im_end|> <|im_start|>assistant find <directory> -type f -size -1M -delete<|im_e...
Remove files that are less than 1MB in size under <directory>
find <directory> -type f -size -1M -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 Write standard output of "command" to console and append to "stdout.log", and write standard error of "command" to console and append to "stde...
Write standard output of "command" to console and append to "stdout.log", and write standard error of "command" to console and append to "stderr.log"
command > > 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 Monitor the number of processes for a specific user every 30 seconds for 5 minutes.<|im_end|> <|im_start|>assistant #!/bin/bash for ((i=0; i<...
Monitor the number of processes for a specific user every 30 seconds for 5 minutes.
#!/bin/bash for ((i=0; i<10; i++)); do ps -U username | wc -l sleep 30 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 Use the uncompressed contents of "blah.gz" as input to "some_command"<|im_end|> <|im_start|>assistant gunzip -c blah.gz | some_command<|im_end...
Use the uncompressed contents of "blah.gz" as input to "some_command"
gunzip -c blah.gz | 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 Print the content of file<|im_end|> <|im_start|>assistant sed 's/\n//' file<|im_end|>
Print the content of file
sed 's/\n//' 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 monitor system CPU temperature and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/...
Create a script to monitor system CPU temperature and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold="80" cpu_temp=$(sensors | grep 'Package id 0' | awk '{print $4}' | cut -c 2-3) if [ "$cpu_temp" -gt "$threshold" ]; then echo "CPU temperature is high: $cpu_temp°C" | mail -s "CPU Temperature Alert" user@example.com fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user reverse a file with comma deliminators instead of newline deliminators<|im_end|> <|im_start|>assistant tac -s "," parse.txt > newparse.txt<|im...
reverse a file with comma deliminators instead of newline deliminators
tac -s "," parse.txt > newparse.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 Search all regular files from the current directory tree for lines containing "California" and "surfboard", and save the output as SurfsUp.txt...
Search all regular files from the current directory tree for lines containing "California" and "surfboard", and save the output as SurfsUp.txt
find . -type f -exec grep California {} \; -print | grep surfboard > SurfsUp.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 Saves command execution output to a file 'outfile' together with time report.<|im_end|> <|im_start|>assistant > outfile 2>&1<|im_end|>
Saves command execution output to a file 'outfile' together with time report.
> outfile 2>&1
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the file content of command "f"<|im_end|> <|im_start|>assistant cat "$"<|im_end|>
Print the file content of command "f"
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 Delete all files with a specific extension in a directory.<|im_end|> <|im_start|>assistant #!/bin/bash directory="/path/to/your/directory" ex...
Delete all files with a specific extension in a directory.
#!/bin/bash directory="/path/to/your/directory" extension=".txt" rm -f "$directory"/*"$extension"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 CPU temperature and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/...
Create a script to monitor system CPU temperature and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold=75 cpu_temp=$(sensors | grep 'Core 0' | awk '{print $3}') if [ "$cpu_temp" -gt "$threshold" ]; then echo "System CPU temperature exceeds $threshold°C." # Send alert here fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user display the count of all the normal/ regular files in the current directory<|im_end|> <|im_start|>assistant find . -type f |wc -l<|im_end|>
display the count of all the normal/ regular files in the current directory
find . -type f |wc -l
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Prints week day of a 31 day in a current month.<|im_end|> <|im_start|>assistant cal | awk 'NR==2 {split} {for if print a[i]}' FIELDWIDTHS="3...
Prints week day of a 31 day in a current month.
cal | awk 'NR==2 {split} {for if print a[i]}' FIELDWIDTHS="3 3 3 3 3 3 3 3" date=31
AnishJoshi/nl2bash-custom
<|im_start|>system 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 email address.<|im_end|> <|im_start|>assistant #!/bin/bash email="your_email@example.com" if [[ "$email" =~ ^[A...
Check if a string is a valid email address.
#!/bin/bash email="your_email@example.com" if [[ "$email" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}$ ]]; then echo "$email is a valid email address" else echo "$email is not a valid email 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 Read a line of standard input with prompt "My prompt: " and save it to variable "varname"<|im_end|> <|im_start|>assistant read -e -p "My promp...
Read a line of standard input with prompt "My prompt: " and save it to variable "varname"
read -e -p "My prompt: " varname
AnishJoshi/nl2bash-custom
<|im_start|>system 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 files with '.tgz' and '.gz' extensions and delete the oldest file under '/home/backups' directory tree<|im_end|> <|im_sta...
Find all the regular files with '.tgz' and '.gz' extensions and delete the oldest file under '/home/backups' directory tree
find /home/backups -type f \ -print0 | xargs -0 ls -t | tail -1 | xargs rm
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Archive "source" to "root@remote_server_name:/opt/backups" via ssh on port 3382 and compress data during transmission<|im_end|> <|im_start|>as...
Archive "source" to "root@remote_server_name:/opt/backups" via ssh on port 3382 and compress data during transmission
rsync -avz --rsh='ssh -p3382' source root@remote_server_name:/opt/backups
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Measure the execution time of the command: find /usr/src -name "*.html" | xargs grep -l "foo" | wc -l<|im_end|> <|im_start|>assistant time fin...
Measure the execution time of the command: find /usr/src -name "*.html" | xargs grep -l "foo" | wc -l
time find /usr/src -name "*.html" | xargs grep -l "foo" | 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 Converts all windows line endings to unix line endings<|im_end|> <|im_start|>assistant find $(pwd) -type f | xargs -I xxx sed -i 's/\r//g' xxx...
Converts all windows line endings to unix line endings
find $(pwd) -type f | xargs -I xxx sed -i 's/\r//g' xxx
AnishJoshi/nl2bash-custom
<|im_start|>system 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 largest palindrome made from the product of two n-digit numbers.<|im_end|> <|im_start|>assistant #!/bin/bash larg...
Create a script to find the largest palindrome made from the product of two n-digit numbers.
#!/bin/bash largest_palindrome() { digits="$1" max=$(printf '1%.0s' $(seq 1 $digits)) min=$((max / 10)) largest=0 for ((i=max; i>=min; i--)); do for ((j=max; j>=min; j--)); do product=$((i * j)) if [ $product -lt $largest ]; then break 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 Execute all commands in "/path/to/commands-inc.sh" on server "remote" as user "user"<|im_end|> <|im_start|>assistant ssh user@remote 'bash -s'...
Execute all commands in "/path/to/commands-inc.sh" on server "remote" as user "user"
ssh user@remote 'bash -s' < /path/to/commands-inc.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 Installs 'firefox' package without using 'sublime2' repository.<|im_end|> <|im_start|>assistant yum --disablerepo=sublime2 install firefox<|im...
Installs 'firefox' package without using 'sublime2' repository.
yum --disablerepo=sublime2 install firefox
AnishJoshi/nl2bash-custom
<|im_start|>system 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 file name and saves path to it in 'TMP_FILE' variable.<|im_end|> <|im_start|>assistant TMP_FILE="$"<|im_end|>
Creates temporary file name and saves path to it in 'TMP_FILE' variable.
TMP_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 display all the regular/normal files in the /root folder which are bigger than 500MB<|im_end|> <|im_start|>assistant find /root -type f -size ...
display all the regular/normal files in the /root folder which are bigger than 500MB
find /root -type f -size +500M -printf "The %p file is greater than 500MB\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 Execute "mysqladmin -u root -pXXXXX processlist | grep tablename" every second and append output to "/root/plist.log"<|im_end|> <|im_start|>as...
Execute "mysqladmin -u root -pXXXXX processlist | grep tablename" every second and append output to "/root/plist.log"
watch -n 1 "mysqladmin -u root -pXXXXX processlist | grep tablename" | tee -a /root/plist.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 find all files with pattern` '*song*abc2009*.jpg' and replace "abc2009" with "def2010"<|im_end|> <|im_start|>assistant find . -name '*song*abc...
find all files with pattern` '*song*abc2009*.jpg' and replace "abc2009" with "def2010"
find . -name '*song*abc2009*.jpg' | sed 's/\(^.*song.*\)abc2009\(.*.jpg\)$/mv "&" "\1def2010\2"/' | sh
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Report available space on the file system containing /tmp in kilobytes.<|im_end|> <|im_start|>assistant df -k /tmp | tail -1 | awk '{print $4}...
Report available space on the file system containing /tmp in kilobytes.
df -k /tmp | tail -1 | awk '{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 Find files with 002 permission in entire file system and print them with the string 'has world write permissions' printed at last<|im_end|> <|...
Find files with 002 permission in entire file system and print them with the string 'has world write permissions' printed at last
echo $ has world write permissions
AnishJoshi/nl2bash-custom
<|im_start|>system 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 symbolc link named "latest" to the last modified file or directory in "target-directory"<|im_end|> <|im_start|>assistant ln -s target...
Create a symbolc link named "latest" to the last modified file or directory in "target-directory"
ln -s target-directory/`ls -rt target-directory | tail -n1` latest
AnishJoshi/nl2bash-custom
<|im_start|>system 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 contents of a file excluding comments.<|im_end|> <|im_start|>assistant #!/bin/bash file_path="/path/to/your/file.txt" sed '/^#/d' ...
Print the contents of a file excluding comments.
#!/bin/bash file_path="/path/to/your/file.txt" sed '/^#/d' "$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 Page through both standard output and standard error of 'make'.<|im_end|> <|im_start|>assistant make 2>&1 | less<|im_end|>
Page through both standard output and standard error of 'make'.
make 2>&1 | 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 set a crontab to create or update the timestamp of "washere2" in the current directory every 30 minutes.<|im_end|> <|im_start|>assistant echo ...
set a crontab to create or update the timestamp of "washere2" in the current directory every 30 minutes.
echo "30 * * * * touch $(pwd)/washere2" | 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 Print the list of files in a directory with their sizes and last modification times sorted by last modification time in human-readable format ...
Print the list of files in a directory with their sizes and last modification times sorted by last modification time in human-readable format in reverse order.
#!/bin/bash ls -lh --time-style=long-iso /path/to/your/directory | awk '{print $5, $6, $7, $8, $9}' | sort -k 7,7r
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all files in current folder which are more than 300MB<|im_end|> <|im_start|>assistant find . -size +300M<|im_end|>
find all files in current folder which are more than 300MB
find . -size +300M
AnishJoshi/nl2bash-custom
<|im_start|>system 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 "pattern" in "file" and join each line by a space<|im_end|> <|im_start|>assistant cat file | grep pattern | paste -sd' '<|im_end|>
Search for "pattern" in "file" and join each line by a space
cat file | grep pattern | paste -sd' '
AnishJoshi/nl2bash-custom
<|im_start|>system 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 CPU temperature and send alerts if temperatures exceed safe limits.<|im_end|> <|im_start|>assistant #!/bin/b...
Create a script to monitor system CPU temperature and send alerts if temperatures exceed safe limits.
#!/bin/bash cpu_temp=$(sensors | grep 'Core 0' | awk '{print $3}') threshold="70" if [ "$cpu_temp" -gt "$threshold" ]; then echo "CPU temperature is high: $cpu_temp°C" | mail -s "CPU Temperature Alert" user@example.com fi
AnishJoshi/nl2bash-custom