Shell Commands and Examples - ilya-khadykin/notes-outdated GitHub Wiki

Useful shell commands and exaples

OS version

lsb_release -a # Ubuntu specific version information

uname -a

Network

Donwload files with cURL

curl -OL example.com/code.zip
# -O -> save file using the same name as on the server
# -L -> follow redirects
netstat -tlpn | grep mysql

Processes

Get executable by PID

Copy the process id from ps -e command and then run the following:

ps x | grep <process-id>

ps -ef | grep mysql

grep port /etc/mysql/my.cnf

grep -riI ssmtp /var/log  # finds ssmtp logs
date

cal

df

free

pwd

cd

ls
⚠️ **GitHub.com Fallback** ⚠️