Saturday, April 3, 2021

5 Linux Shell tricks to remember

 

if you type in a command and it needs Sudo, just type in sudo !! (bang, bang), it will run the command you just type without sudo with sudo....  speed

CTRL + K will removes all text at the curser

CTRL + W will remove words in command line

TOP questions

What version of Linux are you using ?

uname -a

What ip address is assigned

ip addr show

How would you check for drive space

df -h

How would show the size of a folder

du -sh foldername

How would you check for open ports, listening

netstate -tulpn  (you need root to see the program)

How would check CPU and system usage

top

How would you find help for a command

man netstat

User and groups

cat /etc/group

    review this file, look for root and if anyone was added, look at wheel and if anyone was added.

cat /etc/shadow

    review this file, you will need sudo, Look for users and make sure they have :$6$ for 512 encryption

cat /etc/passwd

    review this file and match up the nologin for users or service accounts