#CLI
#Unix
#Dev
lsof
, kill
, ifconfig
chmod
wget
who
whois
- Print user detail
who
who -b
Popular network commands
wget
used to download software, music, video from internet)
wget <address>
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
- Display
whois
information for domain
whois google.com
host
performs DNS lookups, converting domain names to IP addresses and vice-versa
host google.com
- Display numerical IP address -
route
route -n
- Listing all ports (both TCP and UDP) -
netstat
netstat -a
See active PORTs
lsof ---> list open files
- In Linux/Unix everything is
considers as a files
(pipes, sockets, directories, devices etc)
sudo lsof -i | grep LISTEN
lsof -i TCP:6379
lsof -i :6379
lsof -t -i:6379
Check my IP
Ifconfig
ifconfig
hostname -I
- Mac
- system pref > network >Ethernet/wireless
Free ports or kill app
# Kill process with process ID of pid - `kill`
kill pid
sudo kill -9 <PID>
# Kill all at once
sudo kill -9 $(sudo lsof -t -i:8000)
# Kill process using `fuser`
sudo fuser -k 8000/TCP
# Kill all processes named processname - `killall`
killall processname
Interact with threads, processes and hard disk
- Display running processes -
ps
, top
, htop
ps
top
htop
ping
(Packet INternet Groper)
ping <host
ping -c 2 google.com
ping6 google.com
ping -6 google.com
ping4 google.com
ping -4 google.com
dig
- Domain Information Groper
- Is a powerful command-line tool for querying DNS name servers.
dig google.com
Reference