In this blog we will cover linux network commands along with process management command.
Network
- ping :- Ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol network. It is available for virtually all operating systems that have networking capability, including most embedded network administration software.
$ ping www.google.com
- whois :- You can use the whois command in Linux to find out information about a domain, such as the owner of the domain, the owner’s contact information, and the nameservers that the domain is using.
$ whois -H google.com
- dig :- dig command stands for Domain Information Groper. It is used for retrieving information about DNS name servers. It is basically used by network administrators. It is used for verifying and troubleshooting DNS problems and to perform DNS lookups. Dig command replaces older tools such as nslookup and host.
$ dig google.com
- wget :- GNU Wget is a command-line utility for downloading files from the web. With Wget, you can download files using HTTP, HTTPS, and FTP protocols. Wget provides a number of options allowing you to download multiple files, resume downloads, limit the bandwidth, recursive downloads, download in the background, mirror a website, and much more.
wget http://dheeraj3choudhary.com/sample.py
- ip :- This command is used to show or manipulate routing, devices, and tunnels.
Example :- ip addr Shows addresses assigned to all network interfaces
Example :- To add ip address to a network.$ ip addr show
Example :- To delete ip address from network interface.$ ip addr add 192.168.0.1/24 dev enp0s3
$ ip addr del 192.168.0.1/24 dev enp0s3
- ifconfig :- ifconfig is a system administration utility in Unix-like operating systems for network interface configuration.
$ ifconfig
- netstat :- Netstat command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc.,
It is very important and recommended to use "man" command for every linux command we use as this command in Linux is used to display the user manual of any command that we can run on the terminal. It provides a detailed view of the command which includes NAME, SYNOPSIS, DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUES, ERRORS, FILES, VERSIONS, EXAMPLES, AUTHORS. Make sure to go through below commands for better understanding.$ netstat -pnltu
$ man ping $ man whois $ man dig $ man wget $ man ip $ man ifconfig $ man netstat
Process Management
- ps :- The ps command, short for Process Status, is a command line utility that is used to display or view information related to the processes running in a Linux system.
Example :- To show all running processes
Example :- To display processes with lots of details.$ ps
$ ps aux
- kill :-In Unix and Unix-like operating systems, kill is a command used to send a signal to a process
Example :- To kill running process with process id.
Example :- To kill running process with name proc.$ kill <process id>
$ kill proc
- bg :- This command in linux is used to place foreground jobs in background.
$ bg
- fg :- fg command in linux used to put a background job in foreground.
Example :- Bring recent jon to foreground.
Example :- bring job n to foreground.$ fg
It is very important and recommended to use "man" command for every linux command we use as this command in Linux is used to display the user manual of any command that we can run on the terminal. It provides a detailed view of the command which includes NAME, SYNOPSIS, DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUES, ERRORS, FILES, VERSIONS, EXAMPLES, AUTHORS. Make sure to go through below commands for better understanding.$ fg <jobname>
$ man ps $ man kill $ man bg $ man fg