Basic Linux Commands
see directory items
zipping & unzipping
- To Know PCI device information
- To know CPU information
- To know how many disk/drives present in system
- To know how much disk space used
- How much RAM present /used/free
This will show in megabyte. -g can be used for gigabyte & -k can be used for killobyte.
- To know which services using which ports
- How to check if a port is in use on Linux
sudo lsof -i -P -n | grep LISTEN sudo netstat -tulpn | grep LISTEN sudo ss -tulpn | grep ':22'
- How can you find out which process is listening on a port on Linux
sudo netstat -tulpn | grep :443 sudo ss -tulpn | grep ':22'
- -t : Display TCP sockets/port
- -u : Show UDP sockets/port
- -l : See only listening sockets i.e. open port
- -p : Also display process name that opened port/socket
- -n : View addresses and port numbers in a numerical format. Do not use DNS to resolve names.
How to use Grep