User Tools

Site Tools


linux_commands

Linux Commands

Below are a list of useful Linux commands

Find release version of Linux

lsb_release -a

Append contents within file

cat <<EOF | tee -a /etc/ssh/sshd_config
permitrootlogon yes
EOF

Replace contents within a file

cat <<EOF | tee /etc/ssh/sshd_config
permitrootlogon yes
EOF

Find and Replace contents within a file

sed -i 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config

Change directory back one level to another folder

cd ../test2

Delete folder

rm -rf folder

Delete file

rm file

Copy files within one folder to another

cp * ../test2

Create empty file

touch filename

Find out if a website supports HTTP2 Protocol

curl -I --http2 -s http://coffee.orionmail.org | grep HTTP

Check HTTP Header

curl -vs http://coffee.orionmail.org

Ensure APT packages cannot be auto-updated

apt-mark hold kubeadm kubelet kubectl

See status of a Service

systemctl status docker

Restart service

systemctl restart docker

User GREP to find text within a file

cat /etc/ssh/sshd_config | grep permit

Find file in File System

find / -name sasl_passwd

Disk Usage for Folders

du -shc

s Displays the total size for the Directory. It does not display the totals for subdirectories

h Prints sizes in human readable format

c Prints grant total for all sizes

linux_commands.txt · Last modified: by 127.0.0.1