Linux For DevOps | Network & Process Commands

Linux For DevOps | Network & Process Commands

In this blog we will cover linux network commands along with process management command.

Network

  1. 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
    
    image.png
  2. 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
    
    image.png
  3. 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
    
    image.png
  4. 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
    
  5. ip :- This command is used to show or manipulate routing, devices, and tunnels. Example :- ip addr Shows addresses assigned to all network interfaces
    $ ip addr show
    
    image.png Example :- To add ip address to a network.
    $ ip addr add 192.168.0.1/24 dev enp0s3
    
    image.png Example :- To delete ip address from network interface.
    $ ip addr del 192.168.0.1/24 dev enp0s3
    
    image.png
  6. ifconfig :- ifconfig is a system administration utility in Unix-like operating systems for network interface configuration.
    $ ifconfig
    
    image.png
  7. netstat :- Netstat command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc.,
    $ netstat -pnltu
    
    image.png 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.
    $ man ping
    $ man whois
    $ man dig
    $ man wget
    $ man ip
    $ man ifconfig
    $ man netstat
    

Process Management

  1. 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
    $ ps
    
    image.png Example :- To display processes with lots of details.
    $ ps aux
    
    image.png
  2. 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.
    $ kill <process id>
    
    image.png Example :- To kill running process with name proc.
    $ kill proc
    
    image.png
  3. bg :- This command in linux is used to place foreground jobs in background.
    $ bg
    
    image.png
  4. fg :- fg command in linux used to put a background job in foreground. Example :- Bring recent jon to foreground.
    $ fg
    
    image.png Example :- bring job n to foreground.
    $ fg <jobname>
    
    image.png 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.
    $ man ps
    $ man kill
    $ man bg
    $ man fg
    

Did you find this article valuable?

Support Dheeraj Choudhary by becoming a sponsor. Any amount is appreciated!