HANDY UNIX & LINUX Command:

Khemnath chauhan
1 min readSep 13, 2021
# Download binary from Internet using curl utility:
$ curl -L https://github.com/aquasecurity/kube-bench/releases/download/v0.4.0/kube-bench_0.4.0_linux_amd64.tar.gz -o kube-bench_0.4.0_linux_amd64.tar.gz
# Sed search and replace String.
$ sed -i 's/SEARCH_REGEX/REPLACEMENT/g' <InputFile>
#
To make the pattern match case insensitive, use the I flag
$ sed -i 's/me/you/gI' <Inputfile.txt>
#find and replace a string that contains the delimiter character (/) you’ll need to use the backslash (\) to escape the slash.
$ sed -i 's/\/bin\/bash/\/usr\/bin\/zsh/g' <Inputfile.txt>
#

View additional process details in same line using PS command, in below command we fetch the process details and sorted by rss column.

Check if the package is install in Linux.

# Test whether nginx is installed.
$ rpm -qa nginx
# Check the software installed using yum.
$ yum list installed |grep httpd

Regularly used tar command.

# Create a tar file Example.tar for the folder Example
$ tar -cvf Example.tar Example
# Create a tar.gz file- Example.tar.gz for the folder Example
$ tar -cvfz Example.tar.gz Example
# Extract Tar File.
$ tar -xvf kube-bench_0.4.0_linux_amd64.tar.gz

--

--