Linux OR macOS Commands

Check all users have any cron job

for user in $(cut -f1 -d: /etc/passwd); do echo "> User: " $user; crontab -u $user -l; done

Find big 50 files or folders from your current directory

find -type f -exec du -Sh {} + | sort -rh | head -n 50

Check disk uses

df -h

Check RAM and SWAP memory uses

free -h

Check CPU details

lscpu

Check CPU and memory utilization with process name

top

Login to the server using the SSH command

# change ~/file.pem with your .pem file path
# change ubuntu with your user name
# change 192.168.0.2 with your public ip address

# login with username and pem file

ssh -i ~/file.pem ubuntu@192.168.0.2

# login with username and password

ssh ubuntu@192.168.0.2

Leave a Reply