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 to monitor system UPS load shedding events and generate reports on power reductions.<|im_end|> <|im_start|>assistant #!/bin/ba...
Create a script to monitor system UPS load shedding events and generate reports on power reductions.
#!/bin/bash touch /tmp/ups_load_shedding_report.txt while true; do grep 'load shedding' /var/log/syslog >> /tmp/ups_load_shedding_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 find all the files starting with "config" in the folder Symfony<|im_end|> <|im_start|>assistant find Symfony -name '*config*';<|im_end|>
find all the files starting with "config" in the folder Symfony
find Symfony -name '*config*';
AnishJoshi/nl2bash-custom
<|im_start|>system 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 .log files older than 7 days within a directory.<|im_end|> <|im_start|>assistant #!/bin/bash find /path/to/your/directory -name '*...
Delete all .log files older than 7 days within a directory.
#!/bin/bash find /path/to/your/directory -name '*.log' -type f -mtime +7 -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 Remove files that are less than 1MB in size under <directory><|im_end|> <|im_start|>assistant find <directory> -type f -size -1M -print0 | xa...
Remove files that are less than 1MB in size under <directory>
find <directory> -type f -size -1M -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 Find all files in the /home/myuser directory recursively that are older than 7 days<|im_end|> <|im_start|>assistant find /home/myuser -mtime +...
Find all files in the /home/myuser directory recursively that are older than 7 days
find /home/myuser -mtime +7 -print
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system root user file changes in specific directories and send an alert if any changes are detected in those direct...
Create a script to monitor system root user file changes in specific directories and send an alert if any changes are detected in those directories.
#!/bin/bash critical_dirs="/etc /root" for dir in $critical_dirs; do changes=$(find $dir -cmin -60) if [ -n "$changes" ]; then echo "File changes detected in directory $dir for root user." | mail -s "Root File Change in Critical Directory 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 List the drive of each "/dev/" disk mount point<|im_end|> <|im_start|>assistant mount | grep '^/dev/' | sed -E 's/([^ ]*) on ([^ ]*) .*/"\2" i...
List the drive of each "/dev/" disk mount point
mount | grep '^/dev/' | sed -E 's/([^ ]*) on ([^ ]*) .*/"\2" is located on "\1"/'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user create a symbolic link with absolute path "/cygdrive/c/Program Files" to file "/cygdrive/c/ProgramFiles"<|im_end|> <|im_start|>assistant ln -s...
create a symbolic link with absolute path "/cygdrive/c/Program Files" to file "/cygdrive/c/ProgramFiles"
ln -s "/cygdrive/c/Program Files" /cygdrive/c/ProgramFiles
AnishJoshi/nl2bash-custom
<|im_start|>system 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 md5sum of the contents of the archives '/tmp/tst.gz', '/tmp/tst.bz2', '/tmp/tst.lzma' and '/tmp/tst.xz'.<|im_end|> <|im_start|>assis...
Calculate md5sum of the contents of the archives '/tmp/tst.gz', '/tmp/tst.bz2', '/tmp/tst.lzma' and '/tmp/tst.xz'.
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 Find all files/directories under $something directory<|im_end|> <|im_start|>assistant find $something<|im_end|>
Find all files/directories under $something directory
find $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 Search the /path directory tree for files matching pattern '*.foo'<|im_end|> <|im_start|>assistant find /path -name '*.foo'<|im_end|>
Search the /path directory tree for files matching pattern '*.foo'
find /path -name '*.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 Merge the first "$lc" lines of "current.txt" and the last "$lc" lines of "current.txt" and display the result as a comma separated table<|im_e...
Merge the first "$lc" lines of "current.txt" and the last "$lc" lines of "current.txt" and display the result as a comma separated table
paste < < | column -t -o,
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Monitor system file system events every 5 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/bash for ((i=0...
Monitor system file system events every 5 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<12; i++)); do sar -v 5 6 sleep 5 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 Prints calendar for a current month without first day of a week.<|im_end|> <|im_start|>assistant cal | sed -e 's/^.\{3\}//' -e 's/^\(.\{15\}\)...
Prints calendar for a current month without first day of a week.
cal | sed -e 's/^.\{3\}//' -e 's/^\(.\{15\}\).\{3\}$/\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 all unique file paths under "dir1" compared to "dir2"<|im_end|> <|im_start|>assistant comm -23 <(find dir1 | sed 's/dir1/\//'| sort) <(f...
Print all unique file paths under "dir1" compared to "dir2"
comm -23 <(find dir1 | sed 's/dir1/\//'| sort) <(find dir2 | sed 's/dir2/\//'| sort) | sed 's/^\//dir1/'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Raise an error if there is a reference to a non-existent environment variable and exit the shell immediately if there is any error<|im_end|> <...
Raise an error if there is a reference to a non-existent environment variable and exit the shell immediately if there is any error
set -eu
AnishJoshi/nl2bash-custom
<|im_start|>system 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 10 lines of "y" to file "10lines.txt"<|im_end|> <|im_start|>assistant yes | head -n10 > 10lines.txt<|im_end|>
Write 10 lines of "y" to file "10lines.txt"
yes | head -n10 > 10lines.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 display all the files in the current folder excluding those that are present in the sub directory aa and display those files that start with t...
display all the files in the current folder excluding those that are present in the sub directory aa and display those files that start with the word "file"
find . \( -type d -name aa -prune \) -o \( -type f -name 'file*' -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 Get from file 'File1.txt' strings starting with 'Q', extract only part of them following after '=' sign, and print which ones are not found in...
Get from file 'File1.txt' strings starting with 'Q', extract only part of them following after '=' sign, and print which ones are not found in 'File2.txt'
grep ^Q File1.txt | cut -d= -f2- | sort | comm -23 - <
AnishJoshi/nl2bash-custom
<|im_start|>system 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 ifconfig en1 | sed -n '/inet addr/s/.*addr.\ .*/\1/p'<|im_end|>
Gets IP address of 'en1' network interface.
ifconfig en1 | sed -n '/inet addr/s/.*addr.\ .*/\1/p'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Convert a string to title case.<|im_end|> <|im_start|>assistant #!/bin/bash string="your string" echo "$string" | awk '{for(i=1;i<=NF;i++)su...
Convert a string to title case.
#!/bin/bash string="your string" echo "$string" | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}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 machine architecture, ie. x86_64<|im_end|> <|im_start|>assistant uname -m<|im_end|>
Display machine architecture, ie. x86_64
uname -m
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Write "ee" to standard output and as input to command "foo"<|im_end|> <|im_start|>assistant echo 'ee' | tee ><|im_end|>
Write "ee" to standard output and as input to command "foo"
echo 'ee' | 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 Monitor system network interface errors and drops every 5 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin...
Monitor system network interface errors and drops every 5 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<12; i++)); do sar -n EDEV 5 6 sleep 5 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Check if a file exists and is a symbolic link.<|im_end|> <|im_start|>assistant #!/bin/bash file="/path/to/your/file.txt" if [ -L "$file" ]; ...
Check if a file exists and is a symbolic link.
#!/bin/bash file="/path/to/your/file.txt" if [ -L "$file" ]; then echo "$file exists and is a symbolic link" else echo "$file does not exist or is not a symbolic link" fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system service status and send an alert if any services are not running.<|im_end|> <|im_start|>assistant #!/bin/bas...
Create a script to monitor system service status and send an alert if any services are not running.
#!/bin/bash services="ssh apache2 mysql" for service in $services; do if ! systemctl is-active --quiet $service; then echo "Service $service is not running." | mail -s "Service 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 Print the list of files modified in the last 24 hours.<|im_end|> <|im_start|>assistant #!/bin/bash find /path/to/your/directory -type f -mtim...
Print the list of files modified in the last 24 hours.
#!/bin/bash find /path/to/your/directory -type f -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 Save the user name of the current user to variable "whoami"<|im_end|> <|im_start|>assistant whoami=$<|im_end|>
Save the user name of the current user to variable "whoami"
whoami=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 Name* files under ../../$name-module and rename them by replacing 'Name' with $Name in their names<|im_end|> <|im_start|>assistant f...
Find all Name* files under ../../$name-module and rename them by replacing 'Name' with $Name in their names
find ../../$name-module -name 'Name*' -type f -exec bash -c 'mv "$1" "${1/Name/$Name}"' -- {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find files in the current directory and sub-directories, that were accessed within last hour<|im_end|> <|im_start|>assistant find -amin -60<|i...
find files in the current directory and sub-directories, that were accessed within last hour
find -amin -60
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user change the word "GHBAG" to "stream-agg" in all the file names in current folder which have the word "-GHBAG-" in their name<|im_end|> <|im_sta...
change the word "GHBAG" to "stream-agg" in all the file names in current folder which have the word "-GHBAG-" in their name
find . -name '*-GHBAG-*' -exec bash -c 'mv $0 ${0/GHBAG/stream-agg}' {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 number is divisible by another number.<|im_end|> <|im_start|>assistant #!/bin/bash num=10 divisor=2 if [ $((num % divisor)) -eq 0...
Check if a number is divisible by another number.
#!/bin/bash num=10 divisor=2 if [ $((num % divisor)) -eq 0 ]; then echo "$num is divisible by $divisor" else echo "$num is not divisible by $divisor" 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 Continuously output "y" at a rate of 10 bytes per second<|im_end|> <|im_start|>assistant yes | pv --quiet --rate-limit 10<|im_end|>
Continuously output "y" at a rate of 10 bytes per second
yes | pv --quiet --rate-limit 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 Print "$PATH" variable as input to awk script "rem_dup.awk" and concatenate the result with ":"<|im_end|> <|im_start|>assistant echo $PATH | a...
Print "$PATH" variable as input to awk script "rem_dup.awk" and concatenate the result with ":"
echo $PATH | awk -F: -f rem_dup.awk | 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 Check if *RBENV* variable is defined in global environment<|im_end|> <|im_start|>assistant tmux show-environment -g | grep RBENV<|im_end|>
Check if *RBENV* variable is defined in global environment
tmux show-environment -g | grep RBENV
AnishJoshi/nl2bash-custom
<|im_start|>system 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 SSL certificate expiration dates and renew certificates when they are close to expiry.<|im_end|> <|im_start|>assistan...
Create a script to check SSL certificate expiration dates and renew certificates when they are close to expiry.
#!/bin/bash openssl s_client -connect example.com:443 -servername example.com < /dev/null 2> /dev/null | openssl x509 -noout -enddate | awk -F= '{print $2}' # Add renewal logic here
AnishJoshi/nl2bash-custom
<|im_start|>system 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 "/path/to/dir" is a nfs mount point<|im_end|> <|im_start|>assistant mount -l | grep 'type nfs' | sed 's/.* on \ .*/\1/' | grep /path/...
Check if "/path/to/dir" is a nfs mount point
mount -l | grep 'type nfs' | sed 's/.* on \ .*/\1/' | grep /path/to/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 Monitor system paging every 10 seconds for 1 minute and display the results.<|im_end|> <|im_start|>assistant #!/bin/bash for ((i=0; i<6; i++)...
Monitor system paging every 10 seconds for 1 minute and display the results.
#!/bin/bash for ((i=0; i<6; i++)); do sar -B 10 6 sleep 10 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find all the files in the current folder and display them in the sorted order of their name<|im_end|> <|im_start|>assistant find . | sort<|im_...
find all the files in the current folder and display them in the sorted order of their name
find . | 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 Print calendar for February, March and April of year 2009 side-by-side<|im_end|> <|im_start|>assistant paste < < <<|im_end|>
Print calendar for February, March and April of year 2009 side-by-side
paste < < <
AnishJoshi/nl2bash-custom
<|im_start|>system 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 CPU temperature and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bash t...
Create a script to monitor CPU temperature and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold=80 cpu_temp=$(sensors | grep 'Core 0' | awk '{print $3}') if [ "$cpu_temp" -gt "$threshold" ]; then echo "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 Find files not matching shell pattern '*/vendor/*'<|im_end|> <|im_start|>assistant find . -not -wholename '*/vendor/*<|im_end|>
Find files not matching shell pattern '*/vendor/*'
find . -not -wholename '*/vendor/*
AnishJoshi/nl2bash-custom
<|im_start|>system 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 copy files by file extension, preserving directory structure<|im_end|> <|im_start|>assistant find -type f -name \*.txt -exec insta...
recursively copy files by file extension, preserving directory structure
find -type f -name \*.txt -exec install -D {} /dest/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 Find all files/directories under /export/home/someone directory in a remote host and upload the files/directories to ftp://somehost/tmp/<|im_...
Find all files/directories under /export/home/someone directory in a remote host and upload the files/directories to ftp://somehost/tmp/
ssh someone@somehost "cd /export/home/someone && find . -name '*' -print| xargs -n1 curl -u someone:password ftp://somehost/tmp/ -vT"
AnishJoshi/nl2bash-custom
<|im_start|>system 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<|im_end|> <|im_start|>assistant find /path/to/directory/folder{1..50} -name...
Search directories /path/to/directory/folder{1..50} for .txt files
find /path/to/directory/folder{1..50} -name '*.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 Save standard input to variable "myVar"<|im_end|> <|im_start|>assistant myVar=$<|im_end|>
Save standard input to variable "myVar"
myVar=$
AnishJoshi/nl2bash-custom
<|im_start|>system 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 xml files in some directory<|im_end|> <|im_start|>assistant I'm assuming you only want to zip files that match names in $Namese...
search for all xml files in some directory
I'm assuming you only want to zip files that match names in $Namese. In your script, try replacing the find command with: export Namese find /var/tmp/ -type f -name '*.xml'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 'foo' in all regular files under 'sources' directory tree and show the matched lines with filenames<|im_end|> <|im_start|>assistant...
Search for 'foo' in all regular files under 'sources' directory tree and show the matched lines with filenames
find sources -type f -exec grep -H 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 Create a new directory.<|im_end|> <|im_start|>assistant #!/bin/bash directory="/path/to/your/new_directory" mkdir "$directory"<|im_end|>
Create a new directory.
#!/bin/bash directory="/path/to/your/new_directory" mkdir "$directory"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user create a sub shell and search for regular/normal file with the name "myfile" in the entire file system and discard all the errors<|im_end|> <|...
create a sub shell and search for regular/normal file with the name "myfile" in the entire file system and discard all the errors
sh -c "find / -name myfile -type f -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 Check if a specific user exists and display their home directory if they do.<|im_end|> <|im_start|>assistant #!/bin/bash username="username" ...
Check if a specific user exists and display their home directory if they do.
#!/bin/bash username="username" if id -u $username >/dev/null 2>&1; then echo "Home directory for $username is: $(getent passwd $username | cut -d: -f6)" 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 the current directory tree for files and directories whose names do not end in "exe" and "dll"<|im_end|> <|im_start|>assistant find . |...
Search the current directory tree for files and directories whose names do not end in "exe" and "dll"
find . | grep -v '$'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Open executable file for command "rails" in text editor "mate"<|im_end|> <|im_start|>assistant mate `which rails`<|im_end|>
Open executable file for command "rails" in text editor "mate"
mate `which rails`
AnishJoshi/nl2bash-custom
<|im_start|>system 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 processes for all users, their user/owner, and those not attached to a terminal<|im_end|> <|im_start|>assistant ps aux<|im_end|>
show processes for all users, their user/owner, and those not attached to a terminal
ps aux
AnishJoshi/nl2bash-custom
<|im_start|>system 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 number of bytes in "$file" after decompression into variable "size"<|im_end|> <|im_start|>assistant size="$(zcat "$file" | wc -c)"<|i...
Save the number of bytes in "$file" after decompression into variable "size"
size="$(zcat "$file" | wc -c)"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files under dir and calculate their md5sum and save the output to dir.md5<|im_end|> <|im_start|>assistant find dir -type f -exec md5s...
Find all files under dir and calculate their md5sum and save the output to dir.md5
find dir -type f -exec md5sum {} + > dir.md5
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Continuously send "ok" plus newline to the program "recalcitrant.php"<|im_end|> <|im_start|>assistant yes ok | recalcitrant.php<|im_end|>
Continuously send "ok" plus newline to the program "recalcitrant.php"
yes ok | recalcitrant.php
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system login shells and send an alert if any users are assigned insecure shells.<|im_end|> <|im_start|>assistant #!...
Create a script to monitor system login shells and send an alert if any users are assigned insecure shells.
#!/bin/bash insecure_shells="$(grep -vE '/sbin/nologin|/bin/false' /etc/passwd | awk -F: '{print $1,$7}')" if [ -n "$insecure_shells" ]; then echo "Users with insecure login shells found: $insecure_shells" | mail -s "Insecure Shells Alert" user@example.com fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Replace all instances of ";" with "\n" in "bla@some.com;john@home.com"<|im_end|> <|im_start|>assistant echo "bla@some.com;john@home.com" | sed...
Replace all instances of ";" with "\n" in "bla@some.com;john@home.com"
echo "bla@some.com;john@home.com" | sed -e 's/;/\n/g'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files/directories under minimum 1 level down the $FOLDER directory and sort them<|im_end|> <|im_start|>assistant find "$FOLDER" -mind...
Find all files/directories under minimum 1 level down the $FOLDER directory and sort them
find "$FOLDER" -mindepth 1 | 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 Create a script to monitor system SELinux status and send an alert if SELinux is disabled.<|im_end|> <|im_start|>assistant #!/bin/bash if [ "...
Create a script to monitor system SELinux status and send an alert if SELinux is disabled.
#!/bin/bash if [ "$(getenforce)" = "Disabled" ]; then echo "SELinux is disabled." | mail -s "SELinux Status 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 a list of all duplicate filenames in the current directory tree if there is no white space in filenames<|im_end|> <|im_start|>assistant ...
Print a list of all duplicate filenames in the current directory tree if there is no white space in filenames
find . |sed 's,\/\$,\1/\2\t\1/\L\2,'|sort|uniq -D -f 1|cut -f 1
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all files/directories that start with 'screen' in their names under user's home directory tree<|im_end|> <|im_start|>assistant find ~ -i...
Find all files/directories that start with 'screen' in their names under user's home directory tree
find ~ -iname "screen*"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 git branch currently checked out in a working directory.<|im_end|> <|im_start|>assistant git status | grep "On branch" | cut -c 11-<|im_...
Print git branch currently checked out in a working directory.
git status | grep "On branch" | cut -c 11-
AnishJoshi/nl2bash-custom
<|im_start|>system 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 ifconfig en1 | sed -n '/inet addr/s/.*addr.\([^ ]*\) .*/\1/p'<|im_...
Gets IP address of 'en1' network interface.
ifconfig en1 | sed -n '/inet addr/s/.*addr.\([^ ]*\) .*/\1/p'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Counts number of lines returned by curl request.<|im_end|> <|im_start|>assistant curl yahoo.com --silent | wc -l<|im_end|>
Counts number of lines returned by curl request.
curl yahoo.com --silent | 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 "lynx -dump http://dslrouter/stats.html" every 10 seconds<|im_end|> <|im_start|>assistant watch --interval=10 lynx -dump http://dslrou...
Execute "lynx -dump http://dslrouter/stats.html" every 10 seconds
watch --interval=10 lynx -dump http://dslrouter/stats.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 Create a script to convert temperature from Celsius to Fahrenheit.<|im_end|> <|im_start|>assistant #!/bin/bash celsius=20 fahrenheit=$(echo "...
Create a script to convert temperature from Celsius to Fahrenheit.
#!/bin/bash celsius=20 fahrenheit=$(echo "scale=2; ($celsius * 9/5) + 32" | bc) echo "$celsius°C is equal to $fahrenheit°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 Show all running processes with name matching "postgres"<|im_end|> <|im_start|>assistant ps aux | grep postgres<|im_end|>
Show all running processes with name matching "postgres"
ps aux | grep postgres
AnishJoshi/nl2bash-custom
<|im_start|>system 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 numbers of processes in following states: running, sleeping, stopped, and defunct .<|im_end|> <|im_start|>assistant top -bn1 | grep zo...
Display numbers of processes in following states: running, sleeping, stopped, and defunct .
top -bn1 | grep zombie | awk '{print $4" "$6" "$8" "$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 files that have been modified yesterday<|im_end|> <|im_start|>assistant find /some/dir -mmin -$((currtime + )) -a -mmin +$()<|im_end|...
find all files that have been modified yesterday
find /some/dir -mmin -$((currtime + )) -a -mmin +$()
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user search for a folder junk in the home directory and create files cart1, cart2, cart3 ... cart6 in the folder junk. Discard all the errors.<|im_...
search for a folder junk in the home directory and create files cart1, cart2, cart3 ... cart6 in the folder junk. Discard all the errors.
find ~/junk -exec touch ~/junk/cart{1,2,3,4,5,6} {} \; 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 Print output of script 'trap.sh'<|im_end|> <|im_start|>assistant ~ $ . trap.sh | cat<|im_end|>
Print output of script 'trap.sh'
~ $ . trap.sh | 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 Search for first match of the regex 're' in all *.coffee files under current directory and print the file names<|im_end|> <|im_start|>assistan...
Search for first match of the regex 're' in all *.coffee files under current directory and print the file names
find . -name \*.coffee -exec awk '/re/ {print FILENAME ":" $0;exit}' {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Format each line as 3 columns based on extraneous columns<|im_end|> <|im_start|>assistant awk '{for(i=3;i<=NF;i++){print $1,$2,$i}}' file | co...
Format each line as 3 columns based on extraneous columns
awk '{for(i=3;i<=NF;i++){print $1,$2,$i}}' file | column -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 Copy all files/directories excluding *.flac files under current directory to /media/wd/network_sync/music directory<|im_end|> <|im_start|>assi...
Copy all files/directories excluding *.flac files under current directory to /media/wd/network_sync/music directory
find . -type f -iname "*.flac" -o -print0 -iname "*.mp3" -print0 -o -iname "*.wav" -print0 -o -iname "*.aac" -print0 -o -iname "*.wma" -print0 | while read -d $'\0' file; do cp -ruv "$file" "/media/wd/network_sync/music/$file"; 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 Interpret backslash sequences and delete whitespace characters in variable $FOO and save the result to variable 'FOO_NO_WHITESPACE'<|im_end|> ...
Interpret backslash sequences and delete whitespace characters in variable $FOO and save the result to variable 'FOO_NO_WHITESPACE'
FOO_NO_WHITESPACE="$"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the last line of the alphabetically sorted lines in file "set"<|im_end|> <|im_start|>assistant tail -1 <<|im_end|>
Print the last line of the alphabetically sorted lines in file "set"
tail -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 removes all files in a current folder but '*txt' files.<|im_end|> <|im_start|>assistant find . -type f -not -name '*txt' | xargs r...
Recursively removes all files in a current folder but '*txt' files.
find . -type f -not -name '*txt' | 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 Print all lines of "seq 1 10" except the last 3<|im_end|> <|im_start|>assistant seq 1 10 | perl -e'@x=<>;print@x[0..$#x-3]'<|im_end|>
Print all lines of "seq 1 10" except the last 3
seq 1 10 | perl -e'@x=<>;print@x[0..$#x-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 Print the names and sizes of regular files residing in the "tmp" directory tree<|im_end|> <|im_start|>assistant find tmp -type f -printf "%s %...
Print the names and sizes of regular files residing in the "tmp" directory tree
find tmp -type f -printf "%s %p\n" | awk '{sub(/^[^ ]+/,sprintf)}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 Get current hosts's IPv4 address.<|im_end|> <|im_start|>assistant host $ | grep "address" | grep -v "IPv6" | head -n 1 | awk '{print $4}'<|im_...
Get current hosts's IPv4 address.
host $ | grep "address" | grep -v "IPv6" | head -n 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 Display permissions, user, group, and full path for each file in the current directory tree<|im_end|> <|im_start|>assistant tree -p -u -g -f<|...
Display permissions, user, group, and full path for each file in the current directory tree
tree -p -u -g -f
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print a single line of numbers from "001" to "100"<|im_end|> <|im_start|>assistant yes | head -n 100 | awk '{printf}' ##for 001...100<|im_en...
Print a single line of numbers from "001" to "100"
yes | head -n 100 | awk '{printf}' ##for 001...100
AnishJoshi/nl2bash-custom
<|im_start|>system 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 named 'filename' in the entire filesystem<|im_end|> <|im_start|>assistant find / -name filename -print<|im_end|>
Find files/directories named 'filename' in the entire filesystem
find / -name filename -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 executable files under {} and reverse sort them<|im_end|> <|im_start|>assistant find {} -type f -depth 1 -perm +0111 | sort -r<|im_en...
Find all executable files under {} and reverse sort them
find {} -type f -depth 1 -perm +0111 | 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 Create a script that monitors system GPU fan speed and alerts if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bash ...
Create a script that monitors system GPU fan speed and alerts if it exceeds a certain threshold.
#!/bin/bash threshold=70 while true; do nvidia-smi --query-gpu=fan.speed --format=csv,noheader | awk '$1 > "$threshold" {print "High GPU fan speed: "$1"%"}' 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 Split "<file_name>" into files of at most 1024 KiB in size<|im_end|> <|im_start|>assistant split -b 1024k <file_name><|im_end|>
Split "<file_name>" into files of at most 1024 KiB in size
split -b 1024k <file_name>
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system GPU temperature and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/...
Create a script to monitor system GPU temperature and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold="70" gpu_temp=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader) if [ "$gpu_temp" -gt "$threshold" ]; then echo "GPU temperature is high: $gpu_temp°C" | mail -s "GPU 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 Print right aligned numbers from 11 to 24<|im_end|> <|im_start|>assistant yes '' | nl -ba | sed -n -e 11,24p -e 24q<|im_end|>
Print right aligned numbers from 11 to 24
yes '' | nl -ba | sed -n -e 11,24p -e 24q
AnishJoshi/nl2bash-custom
<|im_start|>system 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 current shell<|im_end|> <|im_start|>assistant ps | tail -n 4 | sed -E '2,$d;s/.* /\1/'<|im_end|>
Print the current shell
ps | tail -n 4 | sed -E '2,$d;s/.* /\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 a frequency count of column two for every file in the current directory<|im_end|> <|im_start|>assistant awk -F '\t' '{print $2}' * | sor...
Print a frequency count of column two for every file in the current directory
awk -F '\t' '{print $2}' * | sort | uniq -c | sort -nr
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system process resource usage and logs the top CPU and memory consuming processes.<|im_end|> <|im_start|>assista...
Create a script that monitors system process resource usage and logs the top CPU and memory consuming processes.
#!/bin/bash while true; do ps aux | sort -nrk 3,3 | head -n 5 ps aux | sort -nrk 4,4 | head -n 5 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 Add prefix "prefix_" to all ".jpg" files in the current directory<|im_end|> <|im_start|>assistant for filename in *.jpg; do mv "$filename" "pr...
Add prefix "prefix_" to all ".jpg" files in the current directory
for filename in *.jpg; do mv "$filename" "prefix_$filename"; done;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system fan speed and send an alert if it's too low.<|im_end|> <|im_start|>assistant #!/bin/bash threshold=1000 fan...
Create a script to monitor system fan speed and send an alert if it's too low.
#!/bin/bash threshold=1000 fan_speed=$(sensors | grep 'fan1' | awk '{print $2}') if [ "$fan_speed" -lt "$threshold" ]; then echo "System fan speed is too low." # 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 List all regular files from the current directory tree that were modified less than 60 minutes ago<|im_end|> <|im_start|>assistant find . -typ...
List all regular files from the current directory tree that were modified less than 60 minutes ago
find . -type f -mmin -60 -print0 | xargs -r0 ls -l
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user search for the word "redeem reward" in all the regular/normal files in the current folder and discard all the errors<|im_end|> <|im_start|>ass...
search for the word "redeem reward" in all the regular/normal files in the current folder and discard all the errors
find . -type f -exec grep -i “redeem reward” {} \; -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 Find all files called "file1.txt" that reside under and below /home/wsuNID/<|im_end|> <|im_start|>assistant find /home/wsuNID/ -name file1.txt...
Find all files called "file1.txt" that reside under and below /home/wsuNID/
find /home/wsuNID/ -name file1.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 List all paths to files or directories under "/data/" that start with "command-" and end with "-setup", sort the result by the version number ...
List all paths to files or directories under "/data/" that start with "command-" and end with "-setup", sort the result by the version number specified between "command-" and "-setup"
find /data/ -name 'command-*-setup' | sort -t - -V -k 2,2
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Search all .pdf files from directory tree ~/.personal/tips for "hot"<|im_end|> <|im_start|>assistant find ~/.personal/tips -type f -iname "*....
Search all .pdf files from directory tree ~/.personal/tips for "hot"
find ~/.personal/tips -type f -iname "*.pdf" -exec pdftotext '{}' - ';' | grep hot
AnishJoshi/nl2bash-custom