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 Write "error" to both the log file "log" and standard error<|im_end|> <|im_start|>assistant echo "error" | tee -a log 1>&2<|im_end|>
Write "error" to both the log file "log" and standard error
echo "error" | tee -a log 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 remove all the regular/normal files in the temp folder and do not delete in the sub folders<|im_end|> <|im_start|>assistant find /tmp -maxdept...
remove all the regular/normal files in the temp folder and do not delete in the sub folders
find /tmp -maxdepth 1 -type f -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 Rename all *.jpg files under current directory by appending parent directory name at the beginning of their names<|im_end|> <|im_start|>assist...
Rename all *.jpg files under current directory by appending parent directory name at the beginning of their names
find . -name '*.jpg' -exec bash -c 'd="${1%/*}"; mv "$1" "$d/$d-${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 the largest file prefixed by its size in bytes of all files under the current directory<|im_end|> <|im_start|>assistant find . -type f -n...
List the largest file prefixed by its size in bytes of all files under the current directory
find . -type f -name '*.gz' -printf '%s %p\n'|sort -nr|head -n 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 Generate a report of top CPU-consuming processes and their CPU usage.<|im_end|> <|im_start|>assistant #!/bin/bash ps -eo pid,ppid,cmd,%mem,%c...
Generate a report of top CPU-consuming processes and their CPU usage.
#!/bin/bash ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head > cpu_consumption_report.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 Check if a string contains only alphanumeric characters and special characters.<|im_end|> <|im_start|>assistant #!/bin/bash string="abc123!@#...
Check if a string contains only alphanumeric characters and special characters.
#!/bin/bash string="abc123!@#" if [[ "$string" =~ ^[[:alnum:]!@#]+$ ]]; then echo "$string contains only alphanumeric characters and special characters" else echo "$string does not contain only alphanumeric characters and special characters" fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Truncate all non-empty regular files under the current directory<|im_end|> <|im_start|>assistant find . -type f -maxdepth 1 -not -empty -print...
Truncate all non-empty regular files under the current directory
find . -type f -maxdepth 1 -not -empty -print0 | xargs -0i sh -c "cat /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 Provide a list of all the files edited today to pr, and pipe pr's output to the printer<|im_end|> <|im_start|>assistant pr -n 'find . -type f ...
Provide a list of all the files edited today to pr, and pipe pr's output to the printer
pr -n 'find . -type f -mtime -1 -print'|lpr
AnishJoshi/nl2bash-custom
<|im_start|>system 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 motherboard temperature and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant...
Create a script to monitor system motherboard temperature and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold=50 motherboard_temp=$(sensors | grep 'temp1' | awk '{print $2}' | cut -c 2-3) if [ "$motherboard_temp" -gt "$threshold" ]; then echo "System motherboard 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 search for a word in all the java files in the current directory<|im_end|> <|im_start|>assistant find . -name "*.java" | xargs grep "Stock" f...
search for a word in all the java files in the current directory
find . -name "*.java" | xargs grep "Stock" find . -name "*.java" | xargs grep "Stock" find . -name "*.java" | xargs grep "Stock" find . -name "*.java" | xargs grep "Stock" find . -name "*.java" | xargs grep "Stock" find . -name "*.java" | xargs grep "Stock
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Traverse the filesystem just once, listing setuid files and directories into /root/suid.txt and large files into /root/big.txt.<|im_end|> <|im...
Traverse the filesystem just once, listing setuid files and directories into /root/suid.txt and large files into /root/big.txt.
find / \ , \ \
AnishJoshi/nl2bash-custom
<|im_start|>system 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 long listing of all the files in the current directory<|im_end|> <|im_start|>assistant find . -name * -exec ls -a {} \;<|im_end|>
display a long listing of all the files in the current directory
find . -name * -exec ls -a {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system Kubernetes pod status and logs any pods that are in a failed state.<|im_end|> <|im_start|>assistant #!/bi...
Create a script that monitors system Kubernetes pod status and logs any pods that are in a failed state.
#!/bin/bash while true; do kubectl get pods --field-selector=status.phase=Failed sleep 600 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system disk space usage and send an alert if it's running low.<|im_end|> <|im_start|>assistant #!/bin/bash thresho...
Create a script to monitor system disk space usage and send an alert if it's running low.
#!/bin/bash threshold=10 disk_space=$(df -h | awk '/// {print $(NF-1)}' | sed 's/%//') if [ "$disk_space" -lt "$threshold" ]; then echo "System disk space running 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 Print the list of files in a directory with their sizes and last modification times sorted by last modification time.<|im_end|> <|im_start|>as...
Print the list of files in a directory with their sizes and last modification times sorted by last modification time.
#!/bin/bash ls -l --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 SSH into "localhost" with forced pseudo-terminal allocation, execute "$heredoc", and save the output to variable "REL_DIR"<|im_end|> <|im_star...
SSH into "localhost" with forced pseudo-terminal allocation, execute "$heredoc", and save the output to variable "REL_DIR"
REL_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 Mount "nifs" filesystem "/dev/mapper/myldm" on "/mnt" as read only<|im_end|> <|im_start|>assistant mount -t ntfs -o ro /dev/mapper/myldm /mnt<...
Mount "nifs" filesystem "/dev/mapper/myldm" on "/mnt" as read only
mount -t ntfs -o ro /dev/mapper/myldm /mnt
AnishJoshi/nl2bash-custom
<|im_start|>system 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 is executable.<|im_end|> <|im_start|>assistant #!/bin/bash file="/path/to/your/file.txt" if [ -x "$file" ]; then echo "F...
Check if a file is executable.
#!/bin/bash file="/path/to/your/file.txt" if [ -x "$file" ]; then echo "File is executable" else echo "File is not executable" 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 Delete all lines matching "pattern to match" in "./infile" and make a backup with suffix ".bak"<|im_end|> <|im_start|>assistant sed -i.bak '/p...
Delete all lines matching "pattern to match" in "./infile" and make a backup with suffix ".bak"
sed -i.bak '/pattern to match/d' ./infile
AnishJoshi/nl2bash-custom
<|im_start|>system 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 numbers from 1 to 10 with 2 values per line<|im_end|> <|im_start|>assistant seq 10 | awk 'NR%2{printf("%s ", $0); next}1'<|im_end|>
Print numbers from 1 to 10 with 2 values per line
seq 10 | awk 'NR%2{printf("%s ", $0); next}1'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the line number of each matching "<phrase>" in "<filename>"<|im_end|> <|im_start|>assistant nl -b a "<filename>" | grep "<phrase>" | awk...
Print the line number of each matching "<phrase>" in "<filename>"
nl -b a "<filename>" | grep "<phrase>" | 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 Installs 'firefox' package.<|im_end|> <|im_start|>assistant yum install firefox<|im_end|>
Installs 'firefox' package.
yum install firefox
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove duplicate lines in "file_name" and print the output on stdout<|im_end|> <|im_start|>assistant awk '{print}' file_name | sort -t$'\t' -k...
Remove duplicate lines in "file_name" and print the output on stdout
awk '{print}' file_name | sort -t$'\t' -k2,2 | uniq -u --skip-fields 1 | sort -k1,1 -t$'\t' | cut -f2 -d$'\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 Executes 'true'. then makes 'xargs' fail executing 'false' and return 123 exit code.<|im_end|> <|im_start|>assistant true | xargs false<|im_en...
Executes 'true'. then makes 'xargs' fail executing 'false' and return 123 exit code.
true | xargs false
AnishJoshi/nl2bash-custom
<|im_start|>system 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 tab separated table in "table.txt" with cell borders<|im_end|> <|im_start|>assistant sed -e 's/\t/_|/g' table.txt | column -t -s '_' ...
Print a tab separated table in "table.txt" with cell borders
sed -e 's/\t/_|/g' table.txt | column -t -s '_' | awk '1;!{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 Remove leading and trailing spaces or tabs from "$string"<|im_end|> <|im_start|>assistant echo "$string" | sed -e 's/^[ \t]*//' | sed -e 's/[ ...
Remove leading and trailing spaces or tabs from "$string"
echo "$string" | sed -e 's/^[ \t]*//' | sed -e '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 find all the text files in current folder and change the extension of these files and move them to another folder<|im_end|> <|im_start|>assist...
find all the text files in current folder and change the extension of these files and move them to another folder
find . -name "*.txt" | xargs -I{} sh -c 'base=$ ; name=${base%.*} ; ext=${base##*.} ; mv "$1" "foo/${name}.bar.${ext}"' -- {}
AnishJoshi/nl2bash-custom
<|im_start|>system 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 file contents of compressed file $i<|im_end|> <|im_start|>assistant gzip -l $i<|im_end|>
List file contents of compressed file $i
gzip -l $i
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove trailing spaces from the output of 'hg st -R "$path"' and save the result in variable "var"<|im_end|> <|im_start|>assistant var=`hg st ...
Remove trailing spaces from the output of 'hg st -R "$path"' and save the result in variable "var"
var=`hg st -R "$path" | sed -e '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 Cuts off last two parts from the path $dir, and deletes resulted folder if empty.<|im_end|> <|im_start|>assistant rmdir "$(dirname $)"<|im_end...
Cuts off last two parts from the path $dir, and deletes resulted folder if empty.
rmdir "$(dirname $)"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Delete all files in the /myDir directory tree that were last modfied 7 days ago<|im_end|> <|im_start|>assistant find /myDir -mindepth 1 -mtime...
Delete all files in the /myDir directory tree that were last modfied 7 days ago
find /myDir -mindepth 1 -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 find all the xml files in a directory and pass it as an argument to a jar<|im_end|> <|im_start|>assistant find /dump -type f -name '*.xml' -ex...
find all the xml files in a directory and pass it as an argument to a jar
find /dump -type f -name '*.xml' -exec java -jar ProcessFile.jar {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 .pdf files<|im_end|> <|im_start|>assistant find / -name '*.pdf'<|im_end|>
Search for .pdf files
find / -name '*.pdf'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 variable "$module" in formatted columns<|im_end|> <|im_start|>assistant column <<< "$"<|im_end|>
Print variable "$module" in formatted columns
column <<< "$"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 mount point of the file system containing $path.<|im_end|> <|im_start|>assistant df -P "$path" | tail -1 | awk '{ print $NF}'<|im_end|>
Print mount point of the file system containing $path.
df -P "$path" | tail -1 | awk '{ print $NF}'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to monitor system IMAP packets and send an alert if it exceeds a certain threshold.<|im_end|> <|im_start|>assistant #!/bin/bas...
Create a script to monitor system IMAP packets and send an alert if it exceeds a certain threshold.
#!/bin/bash threshold="100" imap_packets=$(tcpdump -c 100 imap | grep 'packets captured' | awk '{print $1}') if [ "$imap_packets" -gt "$threshold" ]; then echo "System IMAP packets count is too high: $imap_packets" | mail -s "High IMAP Packets Alert" user@example.com fi
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the number of packets sent, received, and the percentage lost for each ping request to "google.com"<|im_end|> <|im_start|>assistant ping...
Print the number of packets sent, received, and the percentage lost for each ping request to "google.com"
ping google.com | awk '{ sent=NR-1; received+=/^.*.*$/; loss=0; } { if loss=100-(*100) } { printf "sent:%d received:%d loss:%d%%\n", sent, received, loss }'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 current directory tree whose names start with '' followed by two digits and end with '.txt' extension<|im_end...
Find all files/directories under current directory tree whose names start with '' followed by two digits and end with '.txt' extension
find . -regex ".*/[0-9][0-9]\.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 Prints help on 'yum' utility.<|im_end|> <|im_start|>assistant yum -h<|im_end|>
Prints help on 'yum' utility.
yum -h
AnishJoshi/nl2bash-custom
<|im_start|>system 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 mimetype of myfile.txt.<|im_end|> <|im_start|>assistant file --mime myfile.txt<|im_end|>
Display mimetype of myfile.txt.
file --mime myfile.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 Append the date and command ran to "/tmp/trace" after every command<|im_end|> <|im_start|>assistant PROMPT_COMMAND='echo "$(date +"%Y/%m/%d ")...
Append the date and command ran to "/tmp/trace" after every command
PROMPT_COMMAND='echo "$(date +"%Y/%m/%d ") $" >> /tmp/trace'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 directory of the full path to the current script<|im_end|> <|im_start|>assistant echo $(dirname $)<|im_end|>
Print the directory of the full path to the current script
echo $(dirname $)
AnishJoshi/nl2bash-custom
<|im_start|>system 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 process is running and display its PID if it is.<|im_end|> <|im_start|>assistant #!/bin/bash process_name="process_name" ...
Check if a specific process is running and display its PID if it is.
#!/bin/bash process_name="process_name" if pgrep -x $process_name >/dev/null; then echo "Process $process_name is running with PID: $(pgrep -x $process_name)" 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 file system integrity and send an alert if any changes are detected.<|im_end|> <|im_start|>assistant #!/bin/bash b...
Create a script to monitor file system integrity and send an alert if any changes are detected.
#!/bin/bash baseline_checksum="baseline_checksum.txt" current_checksum="current_checksum.txt" # Create baseline checksum if it doesn't exist if [ ! -f "$baseline_checksum" ]; then find / -type f -exec md5sum {} + > "$baseline_checksum" exit 0 fi # Compare current checksum with baseline md5sum -c --quiet "$ba...
AnishJoshi/nl2bash-custom
<|im_start|>system 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 the folder where temporary files would be written to, and save path to it in a 'TMPDIR' variable.<|im_end|> <|im_start|>assistant TMPDIR...
Finds the folder where temporary files would be written to, and save path to it in a 'TMPDIR' variable.
TMPDIR=`dirname $`
AnishJoshi/nl2bash-custom
<|im_start|>system 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 '“foobar”' in all files starting with '‘' and ending with '’' and contain '.' in their names in the entire filesystem and display o...
Search for '“foobar”' in all files starting with '‘' and ending with '’' and contain '.' in their names in the entire filesystem and display only the matched files
find / -name ‘*.*’ -exec grep -il “foobar” {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 Celsius to Fahrenheit.<|im_end|> <|im_start|>assistant #!/bin/bash celsius=37 fahrenheit=$(echo "scale=2; ($celsiu...
Create a script to convert Celsius to Fahrenheit.
#!/bin/bash celsius=37 fahrenheit=$(echo "scale=2; ($celsius * 9/5) + 32" | bc -l) echo "$celsius degrees Celsius is equal to $fahrenheit degrees Fahrenheit"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Set permissions of command "node" to 755<|im_end|> <|im_start|>assistant sudo chmod 755 $<|im_end|>
Set permissions of command "node" to 755
sudo chmod 755 $
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user create an archive using 'pigz' as a compress program<|im_end|> <|im_start|>assistant tar -c --use-compress-program=pigz -f tar.file dir_to_zip...
create an archive using 'pigz' as a compress program
tar -c --use-compress-program=pigz -f tar.file dir_to_zip
AnishJoshi/nl2bash-custom
<|im_start|>system 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 in the current directory tree and edit them with `vim'<|im_end|> <|im_start|>assistant find . -name "*.txt" | parallel -Xj...
Find all .txt files in the current directory tree and edit them with `vim'
find . -name "*.txt" | parallel -Xj1 --tty vim
AnishJoshi/nl2bash-custom
<|im_start|>system 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=x3;while{print shift @x;push @x,$_}'<|i...
Print all lines of "seq 1 10" except the last 3
seq 1 10 | perl -e '@x=x3;while{print shift @x;push @x,$_}'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 existing environment variables in the current shell.<|im_end|> <|im_start|>assistant env | awk -F= '/[a-zA-Z_][a-zA-Z_0-9]*=/ { if (!...
List all existing environment variables in the current shell.
env | awk -F= '/[a-zA-Z_][a-zA-Z_0-9]*=/ { if (!system) print $1 }' | sort | uniq
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all *.txt files on the vfat file system<|im_end|> <|im_start|>assistant find / -name "*.txt" -fstype vfat 2> /dev/null<|im_end|>
Find all *.txt files on the vfat file system
find / -name "*.txt" -fstype vfat 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 lines in "file1" that exist in "file2"<|im_end|> <|im_start|>assistant join -t " " -j 1 < <<|im_end|>
Print lines in "file1" that exist in "file2"
join -t " " -j 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 only mimetype of myfile.txt, without the filename.<|im_end|> <|im_start|>assistant file -bi myfile.txt<|im_end|>
Display only mimetype of myfile.txt, without the filename.
file -bi myfile.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 Adjust the timestamp of 'filename' by subtracting 2 hours from it.<|im_end|> <|im_start|>assistant touch -d "$ - 2 hours" filename<|im_end|>
Adjust the timestamp of 'filename' by subtracting 2 hours from it.
touch -d "$ - 2 hours" filename
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system process intercommunication and logs any interprocess communication failures.<|im_end|> <|im_start|>assist...
Create a script that monitors system process intercommunication and logs any interprocess communication failures.
#!/bin/bash while true; do netstat -nplt | awk '{print $7}' | grep -v 'PID/Program name' | awk -F'/' '{print $2}' | sort | uniq -c | awk '{if ($1 > 1) print "Process " $2 " has multiple listening sockets"}' 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 x* files/directories under /tmp directory whose status was changed less than 1 day ago and move them to ~/play<|im_end|> <|im_start|>assi...
Find x* files/directories under /tmp directory whose status was changed less than 1 day ago and move them to ~/play
find /tmp/ -ctime -1 -name 'x*' -exec sh -c ' exec mv "$@" ~/play/' 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 Calculate the crc32 of "testring"<|im_end|> <|im_start|>assistant echo -n teststring | gzip -1 | pigz -lv<|im_end|>
Calculate the crc32 of "testring"
echo -n teststring | gzip -1 | pigz -lv
AnishJoshi/nl2bash-custom
<|im_start|>system 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 log file size and send an alert if any log file exceeds a certain size.<|im_end|> <|im_start|>assistant #!/b...
Create a script to monitor system log file size and send an alert if any log file exceeds a certain size.
#!/bin/bash threshold="100000" log_files="/var/log/*.log" for file in $log_files; do if [ $(stat -c %s "$file") -gt "$threshold" ]; then echo "Log file $file exceeds size threshold." | mail -s "Log File Size 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 Automatically spell check file "text.txt" using "ispell" command<|im_end|> <|im_start|>assistant yes 0 | script -c 'ispell text.txt' /dev/null...
Automatically spell check file "text.txt" using "ispell" command
yes 0 | script -c 'ispell text.txt' /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 list all js files under currect directory exculde the directory which path contain "/path/to/search/exclude_me" or name isexclude_me_too_anywh...
list all js files under currect directory exculde the directory which path contain "/path/to/search/exclude_me" or name isexclude_me_too_anywhere
find /path/to/search \ -type d \ \ \ -prune \ -o \ -type f -name '*\.js' -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 Print the day at 1 day ago in 2 months from now<|im_end|> <|im_start|>assistant date -d "$(date -d "2 months" +%Y-%m-1) -1 day" +%a<|im_end|>
Print the day at 1 day ago in 2 months from now
date -d "$(date -d "2 months" +%Y-%m-1) -1 day" +%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 Find all files & directory which have write permission for group , remove the permission from group<|im_end|> <|im_start|>assistant find . -pe...
Find all files & directory which have write permission for group , remove the permission from group
find . -perm -20 -exec chmod g-w {} ; or find . -perm -20 -print | xargs chmod g-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 View history using "vim"<|im_end|> <|im_start|>assistant vim <<|im_end|>
View history using "vim"
vim <
AnishJoshi/nl2bash-custom
<|im_start|>system 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 differences between files "a.txt" and "b.txt" side-by-side and not outputting common lines to file "c.txt".<|im_end|> <|im_start|>assist...
Write differences between files "a.txt" and "b.txt" side-by-side and not outputting common lines to file "c.txt".
diff -a --suppress-common-lines -y a.txt b.txt > c.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 Read a single sample of raw audio in the form of a number between -32768 and 32767<|im_end|> <|im_start|>assistant parec --raw --channels=1 --...
Read a single sample of raw audio in the form of a number between -32768 and 32767
parec --raw --channels=1 --latency=2 | od -N2 -td2 | head -n1 | cut -d' ' -f2- | tr -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 Create a script to monitor system disk I/O performance and adjust I/O scheduler settings for optimized performance.<|im_end|> <|im_start|>assi...
Create a script to monitor system disk I/O performance and adjust I/O scheduler settings for optimized performance.
#!/bin/bash iostat -x | grep 'sda' | awk '{print $14}' > /tmp/disk_iops.txt iops=$(cat /tmp/disk_iops.txt) if [ "$iops" -gt "1000" ]; then echo "deadline" > /sys/block/sda/queue/scheduler 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 List empty directories<|im_end|> <|im_start|>assistant find -maxdepth 1 -type d | sort | while read -r dir; do n=$; let n--; if [ $n -eq ...
Find List empty directories
find -maxdepth 1 -type d | sort | while read -r dir; do n=$; let n--; if [ $n -eq 0 ]; then printf "%4d : %s\n" $n "$dir"; 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 Calculate the square of a number.<|im_end|> <|im_start|>assistant #!/bin/bash num=5 echo $((num * num))<|im_end|>
Calculate the square of a number.
#!/bin/bash num=5 echo $((num * num))
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Print the list of files in a directory with their sizes and last access times sorted by size and last access time.<|im_end|> <|im_start|>assis...
Print the list of files in a directory with their sizes and last access times sorted by size and last access time.
#!/bin/bash ls -l --time-style=long-iso /path/to/your/directory | awk '{print $5, $6, $7, $8, $9}' | sort -k 5,5n -k 4,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 Create a script to monitor system process resource usage spikes and generate reports on resource-intensive processes.<|im_end|> <|im_start|>as...
Create a script to monitor system process resource usage spikes and generate reports on resource-intensive processes.
#!/bin/bash touch /tmp/resource_usage_report.txt while true; do ps -eo pid,%cpu,%mem,cmd --sort=-%cpu | head -n 11 >> /tmp/resource_usage_report.txt ps -eo pid,%cpu,%mem,cmd --sort=-%mem | head -n 11 >> /tmp/resource_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 Replace all newlines with spaces in the contents of "file"<|im_end|> <|im_start|>assistant sed -e '{:q;N;s/\n/ /g;t q}' file<|im_end|>
Replace all newlines with spaces in the contents of "file"
sed -e '{:q;N;s/\n/ /g;t q}' file
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script that monitors system Kubernetes cluster job status and logs any jobs in a not ready state.<|im_end|> <|im_start|>assistant #!/...
Create a script that monitors system Kubernetes cluster job status and logs any jobs in a not ready state.
#!/bin/bash while true; do kubectl get jobs sleep 600 done
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Find all directories under /home/mywebsite/public_html/sites/all/modules and set their permission to 750<|im_end|> <|im_start|>assistant find ...
Find all directories under /home/mywebsite/public_html/sites/all/modules and set their permission to 750
find /home/mywebsite/public_html/sites/all/modules -type d -exec chmod 750 {} +
AnishJoshi/nl2bash-custom
<|im_start|>system 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 leaf directories that include only one occurrence of "modules"<|im_end|> <|im_start|>assistant find -regex '.*/modules\' \! -regex '....
Find all leaf directories that include only one occurrence of "modules"
find -regex '.*/modules\' \! -regex '.*/modules/.*/modules\' -type d -links 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 Create a script to find the LCM (Least Common Multiple) of two numbers.<|im_end|> <|im_start|>assistant #!/bin/bash num1=12 num2=18 lcm=$((nu...
Create a script to find the LCM (Least Common Multiple) of two numbers.
#!/bin/bash num1=12 num2=18 lcm=$((num1 * num2 / $(gcd $num1 $num2))) echo "The LCM of $num1 and $num2 is: $lcm" gcd() { num1="$1" num2="$2" while [ "$num2" -ne 0 ]; do remainder=$((num1 % num2)) num1="$num2" num2="$remainder" done echo "$num1" }
AnishJoshi/nl2bash-custom
<|im_start|>system 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 which have been modified after a specific timestamp and save the output to a file<|im_end|> <|im_star...
find all the files in the current folder which have been modified after a specific timestamp and save the output to a file
find -newer timestamp-file -type f > list-of-files
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Searche JSP's for "TODO" lines and append them all to a file with a header showing what file they came from<|im_end|> <|im_start|>assistant fo...
Searche JSP's for "TODO" lines and append them all to a file with a header showing what file they came from
for f in `find -name \*.jsp` ; do echo "==> $f" >> out.txt ; grep "TODO" $f >> out.txt ; 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 PIDs of the current user's instances of "firefox"<|im_end|> <|im_start|>assistant ps -u $ | grep firefox | awk '{printf $1}'<|im_end...
Print the PIDs of the current user's instances of "firefox"
ps -u $ | grep firefox | awk '{printf $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 bind word "pwd\n" to key code "\e[24~"<|im_end|> <|im_start|>assistant bind '"\e[24~":"pwd\n"'<|im_end|>
bind word "pwd\n" to key code "\e[24~"
bind '"\e[24~":"pwd\n"'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Prints the length and contents of the longest line in filename<|im_end|> <|im_start|>assistant cat filename | awk '{print length, $0}'|sort -n...
Prints the length and contents of the longest line in filename
cat filename | awk '{print length, $0}'|sort -nr|head -1
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to reverse a given string.<|im_end|> <|im_start|>assistant #!/bin/bash reverse_string() { str="$1" reversed="" fo...
Create a script to reverse a given string.
#!/bin/bash reverse_string() { str="$1" reversed="" for ((i=${#str}-1; i>=0; i--)); do reversed+=${str:i:1} done echo "$reversed" } reverse_string "hello"
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Remove all files/directories in the current directory without '.git' and '.gitignore'<|im_end|> <|im_start|>assistant find -mindepth 1 -depth ...
Remove all files/directories in the current directory without '.git' and '.gitignore'
find -mindepth 1 -depth -print0 | grep -vEzZ '(\.git|/\.gitignore$)' | xargs -0 rm -rvf
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user Create a script to find the smallest number divisible by each of the numbers 1 to n.<|im_end|> <|im_start|>assistant #!/bin/bash smallest_div...
Create a script to find the smallest number divisible by each of the numbers 1 to n.
#!/bin/bash smallest_divisible() { n="$1" number="$n" while true; do divisible=true for ((i=1; i<=n; i++)); do if [ $((number % i)) -ne 0 ]; then divisible=false break fi done if [ "$divisible" = true ]; 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 Generate a report summarizing the disk usage of each user's home directory.<|im_end|> <|im_start|>assistant #!/bin/bash for user_home in /hom...
Generate a report summarizing the disk usage of each user's home directory.
#!/bin/bash for user_home in /home/*; do du -sh "$user_home" 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 long listing of top ten biggest regular/normal files in the folder /usr/share/man<|im_end|> <|im_start|>assistant find /usr/share/man/...
display long listing of top ten biggest regular/normal files in the folder /usr/share/man
find /usr/share/man/ -type f -exec ls -S {} + 2>/dev/null | head
AnishJoshi/nl2bash-custom
<|im_start|>system 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 ending with undo in the current folder and calculate the total size of these files<|im_end|> <|im_start|>assistant find . -...
find all the files ending with undo in the current folder and calculate the total size of these files
find . -name "*.undo" -ls | perl -lane '$t += $F[6]; END{print $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 Print a ping request and the number of packets sent, received, and the percentage lost for each ping request to "google.com"<|im_end|> <|im_st...
Print a ping request and the number of packets sent, received, and the percentage lost for each ping request to "google.com"
ping google.com | awk '{ sent=NR-1; received+=/^.*.*$/; loss=0; } { if loss=100-(*100) } { print $0; printf "sent:%d received:%d loss:%d%%\n", sent, received, loss; }'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 ipython nbconvert with all the file/directory paths under current directory as arguments<|im_end|> <|im_start|>assistant find | xargs ipyt...
Run ipython nbconvert with all the file/directory paths under current directory as arguments
find | xargs ipython nbconvert
AnishJoshi/nl2bash-custom
<|im_start|>system 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 create a symbolic link to "$f" in "~/my-existing-links/" with name the basename of "$f"<|im_end|> <|im_start|>assistant ln -sf "$f" "~/m...
Force create a symbolic link to "$f" in "~/my-existing-links/" with name the basename of "$f"
ln -sf "$f" "~/my-existing-links/$"
AnishJoshi/nl2bash-custom
<|im_start|>system 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 CSS files under currenty directory and use sed to edit them<|im_end|> <|im_start|>assistant find . -name "*.css" -exec sed -i -r 's/#...
find all CSS files under currenty directory and use sed to edit them
find . -name "*.css" -exec sed -i -r 's/#\b/#0F0/' {} \;
AnishJoshi/nl2bash-custom
<|im_start|>system 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 total count all non-empty lines in files of a current folder.<|im_end|> <|im_start|>assistant rgrep . | wc -l<|im_end|>
Prints total count all non-empty lines in files of a current folder.
rgrep . | wc -l
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user find regular files under the current directory, whose name ends in .mbox and using awk run multiple system commands to rename each matched fil...
find regular files under the current directory, whose name ends in .mbox and using awk run multiple system commands to rename each matched file, to the same name without .mbox at the end
find . -wholename \*.mbox | awk '{new=$0; gsub("\.mbox$", "", new) ; system("mv \"" $0 "\" \"" new "\"") }'
AnishJoshi/nl2bash-custom
<|im_start|>system 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 data from HTML table in "mycode.html"<|im_end|> <|im_start|>assistant paste -d: <(grep '<th>' mycode.html | sed -e 's,</*th>,,g') <(gr...
Extract data from HTML table in "mycode.html"
paste -d: <(grep '<th>' mycode.html | sed -e 's,</*th>,,g') <(grep '<td>' mycode.html | sed -e 's,</*td>,,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 Print position number of day '9' in fourth line of calendar output for September, 2009.<|im_end|> <|im_start|>assistant cal 09 2009 | awk 'BEG...
Print position number of day '9' in fourth line of calendar output for September, 2009.
cal 09 2009 | awk 'BEGIN{day="9"}; NR==4 {col=index; print col }'
AnishJoshi/nl2bash-custom
<|im_start|>system You are an expert shell programmer. Given a natural language request, output ONLY the corresponding shell command. No explanations.<|im_end|> <|im_start|>user search for all the directories in the current folder, do not search in sub folders and run the 'pwd' command in all these directories<|im_end|...
search for all the directories in the current folder, do not search in sub folders and run the 'pwd' command in all these directories
find . -maxdepth 1 -type d \ -exec bash -c "cd '{}' && 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 Create a script that monitors system process execution permissions and logs any attempts to execute privileged commands.<|im_end|> <|im_start|...
Create a script that monitors system process execution permissions and logs any attempts to execute privileged commands.
#!/bin/bash while true; do auditctl -a exit,always -F arch=b64 -S execve -F euid=0 -k privileged_execution ausearch -k privileged_execution | grep -i 'permission denied' && echo "Privileged command execution attempted" 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 text files in the current folder<|im_end|> <|im_start|>assistant find -name "*.txt"<|im_end|>
find all text files in the current folder
find -name "*.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 SSH protocol versions and send an alert if any insecure protocol versions are enabled.<|im_end|> <|im_start|...
Create a script to monitor system SSH protocol versions and send an alert if any insecure protocol versions are enabled.
#!/bin/bash insecure_protocols="$(grep -i 'protocol' /etc/ssh/sshd_config | grep -v '2' | grep -v '^#')" if [ -n "$insecure_protocols" ]; then echo "Insecure SSH protocol versions found: $insecure_protocols" | mail -s "SSH Protocol Alert" user@example.com fi
AnishJoshi/nl2bash-custom