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 Create a script that monitors system log files for critical errors and logs them.<|im_end|> <|im_start|>assistant #!/bin/bash while true; do ...
Create a script that monitors system log files for critical errors and logs them.
#!/bin/bash while true; do grep -i 'critical' /var/log/*.log 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 Recursively lists all files in a current folder in long format, sorting by modification time.<|im_end|> <|im_start|>assistant ls -ldt $<|im_en...
Recursively lists all files in a current folder in long format, sorting by modification time.
ls -ldt $
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Unsets GNUPLOT_DRIVER_DIR variable.<|im_end|> <|im_start|>assistant unset GNUPLOT_DRIVER_DIR<|im_end|>
Unsets GNUPLOT_DRIVER_DIR variable.
unset GNUPLOT_DRIVER_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 Create a script to monitor system service startup time and send an alert if any service takes too long to start.<|im_end|> <|im_start|>assista...
Create a script to monitor system service startup time and send an alert if any service takes too long to start.
#!/bin/bash startup_time_threshold=10 slow_startup_services=$(systemd-analyze blame | grep 's' | awk '{print $2}') for service in "$slow_startup_services"; do service_startup_time=$(systemd-analyze blame | grep "$service" | awk '{print $1}') if [ "$service_startup_time" -gt "$startup_time_threshold" ]; then ...
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Save the current date to 'DATE' variable<|im_end|> <|im_start|>assistant DATE=$<|im_end|>
Save the current date to 'DATE' variable
DATE=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 hex dump byte to byte of the output of "printf Aa"<|im_end|> <|im_start|>assistant printf Aa | od -t x1<|im_end|>
Print a hex dump byte to byte of the output of "printf Aa"
printf Aa | od -t x1
AnishJoshi/nl2bash-custom
<|im_start|>system 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 firewall logs for denied connections and alerts if any are found.<|im_end|> <|im_start|>assistant #!/bin/...
Create a script that monitors system firewall logs for denied connections and alerts if any are found.
#!/bin/bash while true; do grep -q 'DENY' /var/log/firewall.log && echo "Denied connection detected" sleep 300 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files under current directory whose file type description contains "image", display only path to each file.<|im_end|> <|im_start|>ass...
Find all files under current directory whose file type description contains "image", display only path to each file.
find . -type f -exec file {} \; | awk -F: '{if 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 List all leaf directories under current directory<|im_end|> <|im_start|>assistant find . -type d -execdir sh -c 'test -z "$" && echo $PWD/{}'...
List all leaf directories under current directory
find . -type d -execdir sh -c 'test -z "$" && echo $PWD/{}' \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files/directories with 777 permission under '/apps/audit' and strip write permission for 'other' from them<|im_end|> <|im_start|>assi...
Find all files/directories with 777 permission under '/apps/audit' and strip write permission for 'other' from them
find /apps/audit -perm -7 -print | xargs chmod o‑w
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all *.htm files under current directory and print the changed names by appending 3 levels of parent directory names at the beginning and ...
Find all *.htm files under current directory and print the changed names by appending 3 levels of parent directory names at the beginning and modifying the actual name to dd-nnn format
find -type f -name "*.htm" | awk -F'[/]' 'BEGIN{OFS="-"}{ gsub ;print $1,$2, substr,substr,substr }'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Save the list of files containing string `ExtJSLogin' to files.txt excluding change-app-name.sh<|im_end|> <|im_start|>assistant find . -type f...
Save the list of files containing string `ExtJSLogin' to files.txt excluding change-app-name.sh
find . -type f -exec grep -l 'ExtJSLogin' {} \; | grep -v 'change-app-name.sh' > files.txt
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all directories with the name like "????-??-??" and which have not been modified in the last 24 hours in the folder /volume1/photo/ipcam ...
find all directories with the name like "????-??-??" and which have not been modified in the last 24 hours in the folder /volume1/photo/ipcam and send them as input to the script in the exec section
find /volume1/photo/ipcam -maxdepth 1 -type d -name "????-??-??" -mtime +0 -exec sh -c 'echo /home/pi/Dropbox-Uploader/dropbox_uploader.sh move /ipcam/$ /ipcam/archive' \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 the current directory, redirecting error messages to the output and filtering any lines containing the text "Permission d...
find all files under the current directory, redirecting error messages to the output and filtering any lines containing the text "Permission denied", writing the remaining output to some_file
find . 2>&1 | grep -v 'Permission denied' > some_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 Displays line count in 'filename' every 2 seconds.<|im_end|> <|im_start|>assistant watch wc -l <filename><|im_end|>
Displays line count in 'filename' every 2 seconds.
watch wc -l <filename>
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Forward port 16186 on hello.com to 8888 on localhost using private key "privatekeystuffdis88s8dsf8h8hsd8fh8d" for login<|im_end|> <|im_start|>...
Forward port 16186 on hello.com to 8888 on localhost using private key "privatekeystuffdis88s8dsf8h8hsd8fh8d" for login
ssh -N -i <(echo "privatekeystuffdis88s8dsf8h8hsd8fh8d") -R 16186:localhost:8888 hello.com
AnishJoshi/nl2bash-custom
<|im_start|>system 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 files from the `sourceDir' directory to the `destDir' directory<|im_end|> <|im_start|>assistant find sourceDir -mindepth 1 -maxdepth ...
Move all files from the `sourceDir' directory to the `destDir' directory
find sourceDir -mindepth 1 -maxdepth 1 -print0 | xargs -0 mv --target-directory=destDir
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Changes group ownership of 'public' and 'private' to 'god'.<|im_end|> <|im_start|>assistant chgrp god public private<|im_end|>
Changes group ownership of 'public' and 'private' to 'god'.
chgrp god public private
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Finds total lines count of few types of files in a current folder and subfolders.<|im_end|> <|im_start|>assistant ( find . \ -print0 | xargs ...
Finds total lines count of few types of files in a current folder and subfolders.
( find . \ -print0 | xargs -0 cat ) | 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 Print each ".txt" file in the current directory<|im_end|> <|im_start|>assistant paste --delimiter=\\n --serial *.txt<|im_end|>
Print each ".txt" file in the current directory
paste --delimiter=\\n --serial *.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 root user system log files for suspicious activities and send an alert if any are found.<|im_end|> <|im_star...
Create a script to monitor system root user system log files for suspicious activities and send an alert if any are found.
#!/bin/bash suspicious_activities="$(grep -iE 'error|warning|critical' /var/log/syslog | tail -n 5)" if [ -n "$suspicious_activities" ]; then echo "Suspicious activities found in system log files for root user: $suspicious_activities" | mail -s "Root Suspicious Activity 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 Run `command' passing the files from the current directory tree as arguments<|im_end|> <|im_start|>assistant find . -print|xargs command<|im_e...
Run `command' passing the files from the current directory tree as arguments
find . -print|xargs 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 List all leaf directories (directories which don't contain any sub-directory) under current directory<|im_end|> <|im_start|>assistant find -de...
List all leaf directories (directories which don't contain any sub-directory) under current directory
find -depth -type d |sed 'h; :b; $b; N; /^\(.*\)\/.*\n\1$/ { g; bb }; $ {x; b}; P; 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 Limit each line in "your_file" to 80 characters and view via "more"<|im_end|> <|im_start|>assistant fold -80 your_file | more<|im_end|>
Limit each line in "your_file" to 80 characters and view via "more"
fold -80 your_file | 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 Rename all .html files to .txt<|im_end|> <|im_start|>assistant rename 's/\.html$/\.txt/' *.html<|im_end|>
Rename all .html files to .txt
rename 's/\.html$/\.txt/' *.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 Prints day of first Tuesday in a month.<|im_end|> <|im_start|>assistant cal | awk 'NR==2 {for (i=1;i<=NF;i++) {sub(/ /,"",$i);a[$i]=i}} NR>2 {...
Prints day of first Tuesday in a month.
cal | awk 'NR==2 {for (i=1;i<=NF;i++) {sub(/ /,"",$i);a[$i]=i}} NR>2 {if ($a["Tu"]~/[0-9]/) {printf "%02d\n",$a["Tu"];exit}}' FIELDWIDTHS="3 3 3 3 3 3 3 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 List screen IDs<|im_end|> <|im_start|>assistant screen -r<|im_end|>
List screen IDs
screen -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 Prints long listing of the current directory and top-level directories within, sorted from oldest to newest, with appended indicators.<|im_end...
Prints long listing of the current directory and top-level directories within, sorted from oldest to newest, with appended indicators.
$ ls -Fltr *
AnishJoshi/nl2bash-custom
<|im_start|>system 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 all email addresses from a text file.<|im_end|> <|im_start|>assistant #!/bin/bash file_path="/path/to/your/file.txt" grep -E -o '\b[...
Extract all email addresses from a text file.
#!/bin/bash file_path="/path/to/your/file.txt" grep -E -o '\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b' "$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 Calculate the md5 sum of the sorted list of md5 sums of all ".py" files under "/path/to/dir/"<|im_end|> <|im_start|>assistant find /path/to/di...
Calculate the md5 sum of the sorted list of md5 sums of all ".py" files under "/path/to/dir/"
find /path/to/dir/ -type f -name *.py -exec md5sum {} + | awk '{print $1}' | sort | md5sum
AnishJoshi/nl2bash-custom
<|im_start|>system 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 IP addresses of the host name in variable "ip"<|im_end|> <|im_start|>assistant ip=$<|im_end|>
Save IP addresses of the host name in variable "ip"
ip=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 a while loop that renames each file, to the sam...
find regular files under the current directory, whose name ends in .mbox, piping the output to a while loop that renames each file, to the same name without .mbox at the end
find . -type f -wholename \*.mbox -print0 | \ while read I ; do mv $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 SELinux status and logs any changes.<|im_end|> <|im_start|>assistant #!/bin/bash while true; do sest...
Create a script that monitors system SELinux status and logs any changes.
#!/bin/bash while true; do sestatus 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 Redirects output of 'time' built-in function and prints only real-time statistic.<|im_end|> <|im_start|>assistant { time find / &>/dev/null; }...
Redirects output of 'time' built-in function and prints only real-time statistic.
{ time find / &>/dev/null; } 2>&1 | grep real
AnishJoshi/nl2bash-custom
<|im_start|>system 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 *.NEF files under current directory and take only the filename without extension and run other commands on this file name.<|im_end|> <...
Find *.NEF files under current directory and take only the filename without extension and run other commands on this file name.
find . -name "*.NEF" -exec basename \{\} .NEF \; | xargs> -i sh -c 'dcraw -w -c $0.NEF | convert - -resize 25% $0.jpg'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print "found" if "blah" contains the hex byte string "\xCA\xFE\xBA\xBE"<|im_end|> <|im_start|>assistant cat blah | perl -en '/\xCA\xFE\xBA\xBE...
Print "found" if "blah" contains the hex byte string "\xCA\xFE\xBA\xBE"
cat blah | perl -en '/\xCA\xFE\xBA\xBE/ && print "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 monitor system entropy level and send an alert if it falls below a certain threshold.<|im_end|> <|im_start|>assistant #!/bi...
Create a script to monitor system entropy level and send an alert if it falls below a certain threshold.
#!/bin/bash threshold="1000" entropy=$(cat /proc/sys/kernel/random/entropy_avail) if [ "$entropy" -lt "$threshold" ]; then echo "System entropy level is too low: $entropy" | mail -s "Low System Entropy Level 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 executable regular files in the current directory tree<|im_end|> <|im_start|>assistant find . -type f -exec test -x {} \; -print<|im_end|...
Find executable regular files in the current directory tree
find . -type f -exec test -x {} \; -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 search for all the symbolic links in a folder and display all the broken/non-existent links<|im_end|> <|im_start|>assistant find /target/dir -...
search for all the symbolic links in a folder and display all the broken/non-existent links
find /target/dir -type l ! -exec test -e {} \; -print
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all .zip files in the current directory tree and unzip them deleting the archives on success<|im_end|> <|im_start|>assistant find . -dept...
Find all .zip files in the current directory tree and unzip them deleting the archives on success
find . -depth -name '*.zip' -exec /usr/bin/unzip -n {} \; -exec rm {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Archive the directory structure under current directory into directory-structure.tar<|im_end|> <|im_start|>assistant find . -type d -print0 | ...
Archive the directory structure under current directory into directory-structure.tar
find . -type d -print0 | tar cf directory-structure.tar --null --files-from - --no-recursion
AnishJoshi/nl2bash-custom
<|im_start|>system 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 "data.gz" as input to "./complicated-perl-script-that-reads-stdin" and print a status<|im_end|> <|im_start|>a...
Use the uncompressed contents of "data.gz" as input to "./complicated-perl-script-that-reads-stdin" and print a status
pv data.gz | gunzip -c | ./complicated-perl-script-that-reads-stdin
AnishJoshi/nl2bash-custom
<|im_start|>system 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 first line and lines with "f" as the third "," separated field in "input" and format the result as a "," delimited table<|im_end|> <...
Print the first line and lines with "f" as the third "," separated field in "input" and format the result as a "," delimited table
awk -F, '{ if (NR == 1)print}{if($3 == "f")print}' input | column -t -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 Create a script to monitor Nginx server status and send an alert if the server becomes unresponsive.<|im_end|> <|im_start|>assistant #!/bin/ba...
Create a script to monitor Nginx server status and send an alert if the server becomes unresponsive.
#!/bin/bash server_status=$(curl -s -o /dev/null -w "%{http_code}" http://localhost) if [ "$server_status" != "200" ]; then echo "Nginx server is unresponsive." | mail -s "Nginx Server Unresponsive Alert" user@example.com fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print last 10 commands in history<|im_end|> <|im_start|>assistant history 10<|im_end|>
Print last 10 commands in history
history 10
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all fonts that belong to the user 'warwick'<|im_end|> <|im_start|>assistant find /usr/local/fonts -user warwick<|im_end|>
Find all fonts that belong to the user 'warwick'
find /usr/local/fonts -user warwick
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user List all files under the current working directory tree<|im_end|> <|im_start|>assistant find $/ -type f<|im_end|>
List all files under the current working directory tree
find $/ -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 Find all xml files under current directory and archive them to .bz2 archives<|im_end|> <|im_start|>assistant for i in `find . | grep ".xml$"`;...
Find all xml files under current directory and archive them to .bz2 archives
for i in `find . | grep ".xml$"`; do bzip2 $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 Find files not matching the patterns 'Image*-70x70*' and 'Image*-100x100*' in their names under Folder1 and copy them to Folder2<|im_end|> <|i...
Find files not matching the patterns 'Image*-70x70*' and 'Image*-100x100*' in their names under Folder1 and copy them to Folder2
find Folder1 \ | xargs -i% cp -p % Folder2
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a specific file exists and is owned by a specific user.<|im_end|> <|im_start|>assistant #!/bin/bash file="/path/to/file" owner="owne...
Check if a specific file exists and is owned by a specific user.
#!/bin/bash file="/path/to/file" owner="owner" if [ -e "$file" ] && [ $(stat -c %U "$file") == "$owner" ]; then echo "$file exists and is owned by $owner" else echo "$file does not exist or is not owned by $owner" 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 two bytes from "/dev/urandom" and print them as an unsigned integer<|im_end|> <|im_start|>assistant od -A n -N 2 -t u2 /dev/urandom<|im_e...
Read two bytes from "/dev/urandom" and print them as an unsigned integer
od -A n -N 2 -t u2 /dev/urandom
AnishJoshi/nl2bash-custom
<|im_start|>system 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 move "./dir" to "user@host:/path" via ssh on port 2222 compressing data and displaying progress during transmission<|im_end|> <|im...
Recursively move "./dir" to "user@host:/path" via ssh on port 2222 compressing data and displaying progress during transmission
rsync -rvz -e 'ssh -p 2222' --progress --remove-sent-files ./dir user@host:/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 Create a script to monitor system swap usage and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bash ...
Create a script to monitor system swap usage and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold=10 swap_usage=$(free | awk '/Swap/{print $3/$2 * 100.0}' | cut -d '.' -f1) if [ "$swap_usage" -gt "$threshold" ]; then echo "System swap usage exceeds $threshold%." # Send alert here fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user display all the regular/normal files in a folder and save errors to a log file<|im_end|> <|im_start|>assistant find ./subdirectory -type f 2>>...
display all the regular/normal files in a folder and save errors to a log file
find ./subdirectory -type f 2>>error.log
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print each column in "file" with "-" character removed<|im_end|> <|im_start|>assistant fold -w1 file | pr -4t | tr -d '\n\t\- ' | sed '$a\'<|i...
Print each column in "file" with "-" character removed
fold -w1 file | pr -4t | tr -d '\n\t\- ' | sed '$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 delete all the tmp files in the /tmp folder. Print0 is used to display all those files which have newline in their names or files whose name ...
delete all the tmp files in the /tmp folder. Print0 is used to display all those files which have newline in their names or files whose name is only spaces.
find /tmp -name "*.tmp" -print0 | xargs -0 rm find /tmp -name "*.tmp" -print0 | xargs -0 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 Calculate the sha1 sum and md5 sum of "foo"<|im_end|> <|im_start|>assistant echo foo | tee > ><|im_end|>
Calculate the sha1 sum and md5 sum of "foo"
echo foo | 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 monitor system SSH key usage and generate reports on key-based logins.<|im_end|> <|im_start|>assistant #!/bin/bash touch /...
Create a script to monitor system SSH key usage and generate reports on key-based logins.
#!/bin/bash touch /tmp/ssh_key_usage_report.txt while true; do grep 'Accepted publickey' /var/log/auth.log >> /tmp/ssh_key_usage_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 Removes trailing and starting newlines from file<|im_end|> <|im_start|>assistant tac file | sed -e '/./,$!d' | tac | sed -e '/./,$!d'<|im_end|...
Removes trailing and starting newlines from file
tac file | sed -e '/./,$!d' | tac | sed -e '/./,$!d'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Prints process tree of a current process with parents processes and id numbers.<|im_end|> <|im_start|>assistant pstree --show-parents -p $$ | ...
Prints process tree of a current process with parents processes and id numbers.
pstree --show-parents -p $$ | head -n 1 | sed 's/\+.*/\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 Print the date, then prompt "Hit ENTER or wait ten seconds" with a 10 second timeout, then the date again<|im_end|> <|im_start|>assistant date...
Print the date, then prompt "Hit ENTER or wait ten seconds" with a 10 second timeout, then the date again
date ; read -t 10 -p "Hit ENTER or wait ten seconds" ; echo ; date
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a specific user exists and create it if it doesn't.<|im_end|> <|im_start|>assistant #!/bin/bash username="username" if ! id -u $use...
Check if a specific user exists and create it if it doesn't.
#!/bin/bash username="username" if ! id -u $username >/dev/null 2>&1; then useradd $username 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 Search directories /path/to/directory/folder{1..50} for .txt files, outputting only the names of the matched files stripped of the .txt suffix...
Search directories /path/to/directory/folder{1..50} for .txt files, outputting only the names of the matched files stripped of the .txt suffix
find /path/to/directory/folder{1..50} -name '*.txt' -exec basename {} .txt \; 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 Lists all files and folders with its content in a current folder, excluding names ending with 'foo'.<|im_end|> <|im_start|>assistant ls !<|im_...
Lists all files and folders with its content in a current folder, excluding names ending with 'foo'.
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 IP addresses of the host name in variable "ip"<|im_end|> <|im_start|>assistant ip=$(hostname -I | awk '{print $1}')<|im_end|>
Save IP addresses of the host name in variable "ip"
ip=$(hostname -I | 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 display all directories in vim folder do not search in sub directories<|im_end|> <|im_start|>assistant find .vim/ -maxdepth 1 -type d<|im_end|...
display all directories in vim folder do not search in sub directories
find .vim/ -maxdepth 1 -type d
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Monitor Apache error logs in real-time and display the latest errors.<|im_end|> <|im_start|>assistant #!/bin/bash tail -f /var/log/apache2/er...
Monitor Apache error logs in real-time and display the latest errors.
#!/bin/bash tail -f /var/log/apache2/error.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 Check if a string contains only lowercase letters.<|im_end|> <|im_start|>assistant #!/bin/bash string="lowercase" if [[ "$string" =~ ^[[:low...
Check if a string contains only lowercase letters.
#!/bin/bash string="lowercase" if [[ "$string" =~ ^[[:lower:]]+$ ]]; then echo "$string contains only lowercase letters" else echo "$string does not contain only lowercase letters" 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 MongoDB server status and send an alert if the server is down.<|im_end|> <|im_start|>assistant #!/bin/bash mongodb...
Create a script to monitor MongoDB server status and send an alert if the server is down.
#!/bin/bash mongodb_status=$(systemctl is-active --quiet mongodb) if [ "$mongodb_status" != "active" ]; then echo "MongoDB server is down." # Send alert here fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the git log in a tabular form<|im_end|> <|im_start|>assistant git log --pretty=format:'%h|%an|%s' -10 | column -t -s '|'<|im_end|>
Print the git log in a tabular form
git log --pretty=format:'%h|%an|%s' -10 | column -t -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 Find all regular files in <path> and execute process with all of them as arguments<|im_end|> <|im_start|>assistant find <path> -type f -exec s...
Find all regular files in <path> and execute process with all of them as arguments
find <path> -type f -exec sh -c 'for f; do echo process $f; done' 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 List files that have been renamed in Git repository.<|im_end|> <|im_start|>assistant find -name .git -prune -o -exec git log --pretty=tformat:...
List files that have been renamed in Git repository.
find -name .git -prune -o -exec git log --pretty=tformat:'' --numstat --follow --find-copies-harder --reverse {} ';' | cut -f3- | grep '.* => .*'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print 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.
#!/bin/bash ls -lh --time-style=long-iso /path/to/your/directory | awk '{print $5, $6, $7, $8, $9}' | sort -k 7,7
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find files/directories under current directory that matches the regex /projects/insanewebproject[^/]*$ in their paths<|im_end|> <|im_start|>a...
Find files/directories under current directory that matches the regex /projects/insanewebproject[^/]*$ in their paths
find . -exec sh -c 'echo {} | grep -qi /projects/insanewebproject[^/]*$' \; -print
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all *.jpg files under maximum 2 levels down the temp/medium/* paths and run `mogrify -resize 428x270"^" -quality 80 -compress JPEG -mon...
Find all *.jpg files under maximum 2 levels down the temp/medium/* paths and run `mogrify -resize 428x270"^" -quality 80 -compress JPEG -monitor -strip` with the file paths as arguments
find temp/medium/* -maxdepth 2 -iname "*.jpg" -print0 | xargs -0 mogrify -resize 428x270"^" -quality 80 -compress JPEG -monitor -strip
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Replace all occurrence of "subdomainA.example.com" with "subdomainB.example.com" in all files under /home/www and below<|im_end|> <|im_start|>...
Replace all occurrence of "subdomainA.example.com" with "subdomainB.example.com" in all files under /home/www and below
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 Gets IP address of 'en1' network interface.<|im_end|> <|im_start|>assistant my_ip=$<|im_end|>
Gets IP address of 'en1' network interface.
my_ip=$
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Show directory sizes in KB and sort to give the largest at the end<|im_end|> <|im_start|>assistant du -sk $ | sort -n -k 1<|im_end|>
Show directory sizes in KB and sort to give the largest at the end
du -sk $ | sort -n -k 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 Recursively bind mount "/something" on "/new_something"<|im_end|> <|im_start|>assistant mount --rbind /something /new_something<|im_end|>
Recursively bind mount "/something" on "/new_something"
mount --rbind /something /new_something
AnishJoshi/nl2bash-custom
<|im_start|>system 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 variable "a" converted to lowercase.<|im_end|> <|im_start|>assistant echo "$a" | awk '{print tolower($0)}'<|im_end|>
Display the contents of variable "a" converted to lowercase.
echo "$a" | awk '{print tolower($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 display a list of all the files in the file system which do not belong to any user and search only in jfs and jfs2 file systems<|im_end|> <|im...
display a list of all the files in the file system which do not belong to any user and search only in jfs and jfs2 file systems
find / -nouser \ -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 Installs 'php-mssql' package with enabling repository 'remi'.<|im_end|> <|im_start|>assistant yum --enablerepo=remi php-mssql<|im_end|>
Installs 'php-mssql' package with enabling repository 'remi'.
yum --enablerepo=remi php-mssql
AnishJoshi/nl2bash-custom
<|im_start|>system 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 CPU temperature and alerts if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bash...
Create a script that monitors system CPU temperature and alerts if it exceeds a certain threshold.
#!/bin/bash threshold=70 while true; do sensors | grep 'Package id' | awk '{print $4}' | cut -c 2- | awk -F. '{print $1}' | awk '$1 > "$threshold" {print "High CPU temperature: "$1"°C"}' 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 delete all text files from current folder<|im_end|> <|im_start|>assistant find . -type f ! -iname "*.txt" -delete<|im_end|>
delete all text files from current folder
find . -type f ! -iname "*.txt" -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 Print the base name of the current working directory<|im_end|> <|im_start|>assistant echo "$(basename $)"<|im_end|>
Print the base name of the current working directory
echo "$(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 Find all *.txt files/directories under current directory and execute the python script hello.py with all their paths as arguments<|im_end|> <|...
Find all *.txt files/directories under current directory and execute the python script hello.py with all their paths as arguments
find . -name "*.txt" -print0 | xargs -0 python hello.py
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove spaces recursively from all subdirectories under current directory<|im_end|> <|im_start|>assistant find /path/to/dir -type d | tac | wh...
Remove spaces recursively from all subdirectories under current directory
find /path/to/dir -type d | tac | while read LINE; do target=$/$; echo mv "$LINE" "$target"; 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 unique lines in "set1" and "set2" when compared to each other and remove any tabs<|im_end|> <|im_start|>assistant comm -3 < < | sed 's/\...
Print unique lines in "set1" and "set2" when compared to each other and remove any tabs
comm -3 < < | sed 's/\t//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 Show files in maximum 1 level down the current directory that were modified less than 1 day ago from today<|im_end|> <|im_start|>assistant les...
Show files in maximum 1 level down the current directory that were modified less than 1 day ago from today
less `find -maxdepth 1 -type f -daystart -mtime -1`
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove the "^M" characters from all *.ext files under /home directory and save the results to new files with _new appended in their names<|im_...
Remove the "^M" characters from all *.ext files under /home directory and save the results to new files with _new appended in their names
find /home -type f -name "*.ext" -print0 | while read -r -d "$" -r path; do dos2unix $path $path"_new"; 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 display all the directories in the current folder which start with processor followed by digit and ends with .1 or .2<|im_end|> <|im_start|>as...
display all the directories in the current folder which start with processor followed by digit and ends with .1 or .2
find . -type d -regextype posix-egrep -regex '\./processor[0-9]*/10\.(1|2)'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Count lines that are neither blanks nor comments in a file 'foo.pl'<|im_end|> <|im_start|>assistant cat foo.pl | sed '/^\s*#/d;/^\s*$/d' | wc ...
Count lines that are neither blanks nor comments in a file 'foo.pl'
cat foo.pl | sed '/^\s*#/d;/^\s*$/d' | wc -l
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove the last line from "$file" without reading the whole file or rewriting anything<|im_end|> <|im_start|>assistant tail -n 1 "$file" | wc ...
Remove the last line from "$file" without reading the whole file or rewriting anything
tail -n 1 "$file" | wc -c | xargs -I {} truncate "$file" -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 Find all *.mov files under current directory and run an ffmpeg command with the literal '%p' and '%f' as the path and name respectively for e...
Find all *.mov files under current directory and run an ffmpeg command with the literal '%p' and '%f' as the path and name respectively for each file
find . -iname "*.mov" -exec ffmpeg -i "%p" -f flv "%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 run command "$WEB --quiet" in backgrounf as user named as the value of the variable $USER<|im_end|> <|im_start|>assistant su $USER -c "$WEB -...
run command "$WEB --quiet" in backgrounf as user named as the value of the variable $USER
su $USER -c "$WEB --quiet" &
AnishJoshi/nl2bash-custom
<|im_start|>system 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 lines from files "file1", "file2", "file3", "file4", "file5", replace "\t" with " \t", and format the "\t" delimited result as a table<|...
Merge lines from files "file1", "file2", "file3", "file4", "file5", replace "\t" with " \t", and format the "\t" delimited result as a table
paste file{1,2,3,4} | sed -e 's/\t/ \t/g' | column -t -s$'\t'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user force delete all the files that have been modified in the last 3 days<|im_end|> <|im_start|>assistant find . -mtime -3 -exec rm -rf {} \;<|im_...
force delete all the files that have been modified in the last 3 days
find . -mtime -3 -exec rm -rf {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system Nginx web server status and reload Nginx when connection limits are exceeded.<|im_end|> <|im_start|>assistan...
Create a script to monitor system Nginx web server status and reload Nginx when connection limits are exceeded.
#!/bin/bash threshold="1000" connection_count=$(netstat -an | grep ':80' | grep -c ESTABLISHED) if [ "$connection_count" -gt "$threshold" ]; then systemctl reload nginx 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 Sources script incl.sh in the folder where current running script is located<|im_end|> <|im_start|>assistant source "$/incl.sh"<|im_end|>
Sources script incl.sh in the folder where current running script is located
source "$/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 Save absolute path of java home to variable "JAVA_HOME"<|im_end|> <|im_start|>assistant export JAVA_HOME=$<|im_end|>
Save absolute path of java home to variable "JAVA_HOME"
export JAVA_HOME=$
AnishJoshi/nl2bash-custom