{"id":11317,"date":"2019-03-13T00:42:42","date_gmt":"2019-03-13T00:42:42","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11317"},"modified":"2019-03-13T00:42:42","modified_gmt":"2019-03-13T00:42:42","slug":"20-advanced-commands-for-linux-experts","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/13\/20-advanced-commands-for-linux-experts\/","title":{"rendered":"20 Advanced Commands for Linux Experts"},"content":{"rendered":"<p>Thanks for all the likes, good words and support you gave us in the first two part of this article. In the first article we discussed commands for those users who have just\u00a0<strong>switched to Linux<\/strong>\u00a0and needed the necessary knowledge to start with.<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/useful-linux-commands-for-newbies\/\" target=\"_blank\" rel=\"noopener\">20 Useful Commands for Linux Newbies<\/a><\/li>\n<\/ol>\n<p>In the second article we discussed the commands which a\u00a0<strong>middle level<\/strong>\u00a0user requires to manage his own system.<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/20-advanced-commands-for-middle-level-linux-users\/\" target=\"_blank\" rel=\"noopener\">20 Advanced Commands for Middle Level Linux Users<\/a><\/li>\n<\/ol>\n<p><strong>What Next<\/strong>? In this article I will be explaining those commands required for administrating the\u00a0<strong>Linux Server<\/strong>.<\/p>\n<div id=\"attachment_3329\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/20-advanced-commands-for-linux-experts\/linux-expert-commands\/\" rel=\"attachment wp-att-3329\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3329\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/07\/Linux-Expert-Commands.png\" alt=\"Linux System Admin Commands\" width=\"435\" height=\"321\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Linux Expert Commands<\/p>\n<\/div>\n<h3>41. Command: ifconfig<\/h3>\n<p><strong>ifconfig<\/strong>\u00a0is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.<\/p>\n<h5>Check Active Network Interfaces<\/h5>\n<pre>[avishek@tecmint ~]$ ifconfig \r\n\r\neth0      Link encap:Ethernet  HWaddr 40:2C:F4:EA:CF:0E  \r\n          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0 \r\n          inet6 addr: fe80::422c:f4ff:feea:cf0e\/64 Scope:Link \r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 \r\n          RX packets:163843 errors:0 dropped:0 overruns:0 frame:0 \r\n          TX packets:124990 errors:0 dropped:0 overruns:0 carrier:0 \r\n          collisions:0 txqueuelen:1000 \r\n          RX bytes:154389832 (147.2 MiB)  TX bytes:65085817 (62.0 MiB) \r\n          Interrupt:20 Memory:f7100000-f7120000 \r\n\r\nlo        Link encap:Local Loopback  \r\n          inet addr:127.0.0.1  Mask:255.0.0.0 \r\n          inet6 addr: ::1\/128 Scope:Host \r\n          UP LOOPBACK RUNNING  MTU:16436  Metric:1 \r\n          RX packets:78 errors:0 dropped:0 overruns:0 frame:0 \r\n          TX packets:78 errors:0 dropped:0 overruns:0 carrier:0 \r\n          collisions:0 txqueuelen:0 \r\n          RX bytes:4186 (4.0 KiB)  TX bytes:4186 (4.0 KiB)<\/pre>\n<h5>Check All Network Interfaces<\/h5>\n<p>Display details of All interfaces including disabled interfaces using \u201c<strong>-a<\/strong>\u201d argument.<\/p>\n<pre>[avishek@tecmint ~]$ ifconfig -a\r\n\r\neth0      Link encap:Ethernet  HWaddr 40:2C:F4:EA:CF:0E  \r\n          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0 \r\n          inet6 addr: fe80::422c:f4ff:feea:cf0e\/64 Scope:Link \r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 \r\n          RX packets:163843 errors:0 dropped:0 overruns:0 frame:0 \r\n          TX packets:124990 errors:0 dropped:0 overruns:0 carrier:0 \r\n          collisions:0 txqueuelen:1000 \r\n          RX bytes:154389832 (147.2 MiB)  TX bytes:65085817 (62.0 MiB) \r\n          Interrupt:20 Memory:f7100000-f7120000 \r\n\r\nlo        Link encap:Local Loopback  \r\n          inet addr:127.0.0.1  Mask:255.0.0.0 \r\n          inet6 addr: ::1\/128 Scope:Host \r\n          UP LOOPBACK RUNNING  MTU:16436  Metric:1 \r\n          RX packets:78 errors:0 dropped:0 overruns:0 frame:0 \r\n          TX packets:78 errors:0 dropped:0 overruns:0 carrier:0 \r\n          collisions:0 txqueuelen:0 \r\n          RX bytes:4186 (4.0 KiB)  TX bytes:4186 (4.0 KiB) \r\n\r\nvirbr0    Link encap:Ethernet  HWaddr 0e:30:a3:3a:bf:03  \r\n          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0\r\n          UP BROADCAST MULTICAST  MTU:1500  Metric:1\r\n          RX packets:0 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0 \r\n          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)<\/pre>\n<h5>Disable an Interface<\/h5>\n<pre>[avishek@tecmint ~]$ ifconfig eth0 down<\/pre>\n<h5>Enable an Interface<\/h5>\n<pre>[avishek@tecmint ~]$ ifconfig eth0 up<\/pre>\n<h5>Assign IP Address to an Interface<\/h5>\n<p>Assign \u201c192.168.1.12\u201d as the IP address for the interface eth0.<\/p>\n<pre>[avishek@tecmint ~]$ ifconfig eth0 192.168.1.12<\/pre>\n<h5>Change Subnet Mask of Interface eth0<\/h5>\n<pre>[avishek@tecmint ~]$ ifconfig eth0 netmask 255.255.255.<\/pre>\n<h5>Change Broadcast Address of Interface eth0<\/h5>\n<pre>[avishek@tecmint ~]$ ifconfig eth0 broadcast 192.168.1.255<\/pre>\n<h5>Assign IP Address, Netmask and Broadcast to Interface eth0<\/h5>\n<pre>[avishek@tecmint ~]$ ifconfig eth0 192.168.1.12 netmask 255.255.255.0 broadcast 192.168.1.255<\/pre>\n<p><strong>Note<\/strong>: If using a wireless network you need to use command \u201c<strong>iwconfig<\/strong>\u201c. For more \u201c<strong>ifconfig<\/strong>\u201d command examples and usage, read\u00a0<a href=\"https:\/\/www.tecmint.com\/ifconfig-command-examples\/\" target=\"_blank\" rel=\"noopener\">15 Useful \u201cifconfig\u201d Commands<\/a>.<\/p>\n<h3>42. Command: netstat<\/h3>\n<p><strong>netstat<\/strong>\u00a0command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc..,<\/p>\n<h5>List All Network Ports<\/h5>\n<pre>[avishek@tecmint ~]$ netstat -a\r\n\r\nActive UNIX domain sockets (servers and established)\r\nProto RefCnt Flags       Type       State         I-Node   Path\r\nunix  2      [ ACC ]     STREAM     LISTENING     741379   \/run\/user\/user1\/keyring-I5cn1c\/gpg\r\nunix  2      [ ACC ]     STREAM     LISTENING     8965     \/var\/run\/acpid.socket\r\nunix  2      [ ACC ]     STREAM     LISTENING     18584    \/tmp\/.X11-unix\/X0\r\nunix  2      [ ACC ]     STREAM     LISTENING     741385   \/run\/user\/user1\/keyring-I5cn1c\/ssh\r\nunix  2      [ ACC ]     STREAM     LISTENING     741387   \/run\/user\/user1\/keyring-I5cn1c\/pkcs11\r\nunix  2      [ ACC ]     STREAM     LISTENING     20242    @\/tmp\/dbus-ghtTjuPN46\r\nunix  2      [ ACC ]     STREAM     LISTENING     13332    \/var\/run\/samba\/winbindd_privileged\/pipe\r\nunix  2      [ ACC ]     STREAM     LISTENING     13331    \/tmp\/.winbindd\/pipe\r\nunix  2      [ ACC ]     STREAM     LISTENING     11030    \/var\/run\/mysqld\/mysqld.sock\r\nunix  2      [ ACC ]     STREAM     LISTENING     19308    \/tmp\/ssh-qnZadSgJAbqd\/agent.3221\r\nunix  2      [ ACC ]     STREAM     LISTENING     436781   \/tmp\/HotShots\r\nunix  2      [ ACC ]     STREAM     LISTENING     46110    \/run\/user\/ravisaive\/pulse\/native\r\nunix  2      [ ACC ]     STREAM     LISTENING     19310    \/tmp\/gpg-zfE9YT\/S.gpg-agent\r\n....<\/pre>\n<h5>List All TCP Ports<\/h5>\n<pre>[avishek@tecmint ~]$ netstat -at\r\n\r\nActive Internet connections (servers and established)\r\nProto Recv-Q Send-Q Local Address           Foreign Address         State      \r\ntcp        0      0 localhost:mysql         *:*                     LISTEN     \r\ntcp        0      0 *:5901                  *:*                     LISTEN     \r\ntcp        0      0 *:5902                  *:*                     LISTEN     \r\ntcp        0      0 *:x11-1                 *:*                     LISTEN     \r\ntcp        0      0 *:x11-2                 *:*                     LISTEN     \r\ntcp        0      0 *:5938                  *:*                     LISTEN     \r\ntcp        0      0 localhost:5940          *:*                     LISTEN     \r\ntcp        0      0 ravisaive-OptiPl:domain *:*                     LISTEN     \r\ntcp        0      0 ravisaive-OptiPl:domain *:*                     LISTEN     \r\ntcp        0      0 localhost:ipp           *:*                     LISTEN     \r\ntcp        0      0 ravisaive-OptiPle:48270 ec2-23-21-236-70.c:http ESTABLISHED\r\ntcp        0      0 ravisaive-OptiPle:48272 ec2-23-21-236-70.c:http TIME_WAIT  \r\ntcp        0      0 ravisaive-OptiPle:48421 bom03s01-in-f22.1:https ESTABLISHED\r\ntcp        0      0 ravisaive-OptiPle:48269 ec2-23-21-236-70.c:http ESTABLISHED\r\ntcp        0      0 ravisaive-OptiPle:39084 channel-ecmp-06-f:https ESTABLISHED\r\n...<\/pre>\n<h5>Show Statistics for All Ports<\/h5>\n<pre>[avishek@tecmint ~]$ netstat -s\r\n\r\nIp:\r\n    4994239 total packets received\r\n    0 forwarded\r\n    0 incoming packets discarded\r\n    4165741 incoming packets delivered\r\n    3248924 requests sent out\r\n    8 outgoing packets dropped\r\nIcmp:\r\n    29460 ICMP messages received\r\n    566 input ICMP message failed.\r\n    ICMP input histogram:\r\n        destination unreachable: 98\r\n        redirects: 29362\r\n    2918 ICMP messages sent\r\n    0 ICMP messages failed\r\n    ICMP output histogram:\r\n        destination unreachable: 2918\r\nIcmpMsg:\r\n        InType3: 98\r\n        InType5: 29362\r\n        OutType3: 2918\r\nTcp:\r\n    94533 active connections openings\r\n    23 passive connection openings\r\n    5870 failed connection attempts\r\n    7194 connection resets received\r\n....<\/pre>\n<p>OK! For some reason if you want not to resolve host, port and user name as a output of netstat.<\/p>\n<pre>[avishek@tecmint ~]$ netstat -an<\/pre>\n<p>Fine, you may need to get the output of netstat continuously till interrupt instruction is passed (<strong>ctrl+c<\/strong>).<\/p>\n<pre>[avishek@tecmint ~]$ netstat -c<\/pre>\n<p>For more \u201c<strong>netstat<\/strong>\u201d command examples and usage, see the article\u00a0<a href=\"https:\/\/www.tecmint.com\/20-netstat-commands-for-linux-network-management\/\" target=\"_blank\" rel=\"noopener\">20 Netstat Command Examples<\/a>.<\/p>\n<h3>43. Command: nslookup<\/h3>\n<p>A network utility program used to obtain information about Internet servers. As its name suggests, the utility finds name server information for domains by querying\u00a0<strong>DNS<\/strong>.<\/p>\n<pre>[avishek@tecmint ~]$ nslookup tecmint.com \r\n\r\nServer:\t\t192.168.1.1 \r\nAddress:\t192.168.1.1#53 \r\n\r\nNon-authoritative answer: \r\nName:\ttecmint.com \r\nAddress: 50.16.67.239<\/pre>\n<h5>Query Mail Exchanger Record<\/h5>\n<pre>[avishek@tecmint ~]$ nslookup -query=mx tecmint.com \r\n\r\nServer:\t\t192.168.1.1 \r\nAddress:\t192.168.1.1#53 \r\n\r\nNon-authoritative answer: \r\ntecmint.com\tmail exchanger = 0 smtp.secureserver.net. \r\ntecmint.com\tmail exchanger = 10 mailstore1.secureserver.net. \r\n\r\nAuthoritative answers can be found from:<\/pre>\n<h5>Query Name Server<\/h5>\n<pre>[avishek@tecmint ~]$ nslookup -type=ns tecmint.com \r\n\r\nServer:\t\t192.168.1.1 \r\nAddress:\t192.168.1.1#53 \r\n\r\nNon-authoritative answer: \r\ntecmint.com\tnameserver = ns3404.com. \r\ntecmint.com\tnameserver = ns3403.com. \r\n\r\nAuthoritative answers can be found from:<\/pre>\n<h5>Query DNS Record<\/h5>\n<pre>[avishek@tecmint ~]$ nslookup -type=any tecmint.com \r\n\r\nServer:\t\t192.168.1.1 \r\nAddress:\t192.168.1.1#53 \r\n\r\nNon-authoritative answer: \r\ntecmint.com\tmail exchanger = 10 mailstore1.secureserver.net. \r\ntecmint.com\tmail exchanger = 0 smtp.secureserver.net. \r\ntecmint.com\tnameserver = ns06.domaincontrol.com. \r\ntecmint.com\tnameserver = ns3404.com. \r\ntecmint.com\tnameserver = ns3403.com. \r\ntecmint.com\tnameserver = ns05.domaincontrol.com. \r\n\r\nAuthoritative answers can be found from:<\/pre>\n<h5>Query Start of Authority<\/h5>\n<pre>[avishek@tecmint ~]$ nslookup -type=soa tecmint.com \r\n\r\nServer:\t\t192.168.1.1 \r\nAddress:\t192.168.1.1#53 \r\n\r\nNon-authoritative answer: \r\ntecmint.com \r\n\torigin = ns3403.hostgator.com \r\n\tmail addr = dnsadmin.gator1702.hostgator.com \r\n\tserial = 2012081102 \r\n\trefresh = 86400 \r\n\tretry = 7200 \r\n\texpire = 3600000 \r\n\tminimum = 86400 \r\n\r\nAuthoritative answers can be found from:<\/pre>\n<h5>Query Port Number<\/h5>\n<p>Change the port number using which you want to connect<\/p>\n<pre>[avishek@tecmint ~]$ nslookup -port 56 tecmint.com\r\n\r\nServer:\t\ttecmint.com\r\nAddress:\t50.16.76.239#53\r\n\r\nName:\t56\r\nAddress: 14.13.253.12<\/pre>\n<p><strong>Read Also<\/strong>\u00a0:\u00a0<a href=\"https:\/\/www.tecmint.com\/8-linux-nslookup-commands-to-troubleshoot-dns-domain-name-server\/\" target=\"_blank\" rel=\"noopener\">8 Nslookup Commands<\/a><\/p>\n<h3>44. Command: dig<\/h3>\n<p><strong>dig<\/strong>\u00a0is a tool for querying\u00a0<strong>DNS<\/strong>\u00a0nameservers for information about host addresses, mail exchanges, nameservers, and related information. This tool can be used from any Linux (<strong>Unix<\/strong>) or\u00a0<strong>Macintosh OS X<\/strong>\u00a0operating system. The most typical use of\u00a0<strong>dig<\/strong>\u00a0is to simply query a single host.<\/p>\n<pre>[avishek@tecmint ~]$ dig tecmint.com\r\n\r\n; &lt;&lt;&gt;&gt; DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 &lt;&lt;&gt;&gt; tecmint.com \r\n;; global options: +cmd \r\n;; Got answer: \r\n;; -&gt;&gt;HEADER&lt;<\/pre>\n<h5>Turn Off Comment Lines<\/h5>\n<pre>[avishek@tecmint ~]$ dig tecmint.com +nocomments \r\n\r\n; &lt;&lt;&gt;&gt; DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 &lt;&lt;&gt;&gt; tecmint.com +nocomments \r\n;; global options: +cmd \r\n;tecmint.com.\t\t\tIN\tA \r\ntecmint.com.\t\t14400\tIN\tA\t40.216.66.239 \r\n;; Query time: 418 msec \r\n;; SERVER: 192.168.1.1#53(192.168.1.1) \r\n;; WHEN: Sat Jun 29 13:53:22 2013 \r\n;; MSG SIZE  rcvd: 45<\/pre>\n<h5>Turn Off Authority Section<\/h5>\n<pre>[avishek@tecmint ~]$ dig tecmint.com +noauthority \r\n\r\n; &lt;&lt;&gt;&gt; DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 &lt;&lt;&gt;&gt; tecmint.com +noauthority \r\n;; global options: +cmd \r\n;; Got answer: \r\n;; -&gt;&gt;HEADER&lt;<\/pre>\n<h5>Turn Off Additional Section<\/h5>\n<pre>[avishek@tecmint ~]$ dig  tecmint.com +noadditional \r\n\r\n; &lt;&lt;&gt;&gt; DiG 9.9.2-P1 &lt;&lt;&gt;&gt; tecmint.com +noadditional\r\n;; global options: +cmd\r\n;; Got answer:\r\n;; -&gt;&gt;HEADER&lt;<\/pre>\n<h5>Turn Off Stats Section<\/h5>\n<pre>[avishek@tecmint ~]$ dig tecmint.com +nostats \r\n\r\n; &lt;&lt;&gt;&gt; DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 &lt;&lt;&gt;&gt; tecmint.com +nostats \r\n;; global options: +cmd \r\n;; Got answer: \r\n;; -&gt;&gt;HEADER&lt;<\/pre>\n<h5>Turn Off Answer Section<\/h5>\n<pre>[avishek@tecmint ~]$ dig tecmint.com +noanswer \r\n\r\n; &lt;&lt;&gt;&gt; DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 &lt;&lt;&gt;&gt; tecmint.com +noanswer \r\n;; global options: +cmd \r\n;; Got answer: \r\n;; -&gt;&gt;HEADER&lt;<\/pre>\n<h5>Disable All Section at Once<\/h5>\n<pre>[avishek@tecmint ~]$ dig tecmint.com +noall \r\n\r\n; &lt;&lt;&gt;&gt; DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 &lt;&lt;&gt;&gt; tecmint.com +noall \r\n;; global options: +cmd<\/pre>\n<p><strong>Read Also<\/strong>\u00a0:\u00a0<a href=\"https:\/\/www.tecmint.com\/10-linux-dig-domain-information-groper-commands-to-query-dns\/\" target=\"_blank\" rel=\"noopener\">10 Linux Dig Command Examples<\/a><\/p>\n<h3>45. Command: uptime<\/h3>\n<p>You have just connected to your\u00a0<strong>Linux Server Machine<\/strong>\u00a0and founds Something unusual or malicious, what you will do? Guessing\u2026. NO, definitely not you could run\u00a0<strong>uptime<\/strong>\u00a0to verify what happened actually when the server was unattended.<\/p>\n<pre>[avishek@tecmint ~]$ uptime\r\n\r\n14:37:10 up  4:21,  2 users,  load average: 0.00, 0.00, 0.04<\/pre>\n<h3>46. Command: wall<\/h3>\n<p>one of the most important command for administrator,\u00a0<strong>wall<\/strong>\u00a0sends a message to everybody logged in with their\u00a0<strong>mesg<\/strong>\u00a0permission set to \u201c<strong>yes<\/strong>\u201c. The message can be given as an argument to\u00a0<strong>wall<\/strong>, or it can be sent to wall\u2019s standard input.<\/p>\n<pre>[avishek@tecmint ~]$ wall \"we will be going down for maintenance for one hour sharply at 03:30 pm\"\r\n\r\nBroadcast message from root@localhost.localdomain (pts\/0) (Sat Jun 29 14:44:02 2013): \r\n\r\nwe will be going down for maintenance for one hour sharply at 03:30 pm<\/pre>\n<h3>47. command: mesg<\/h3>\n<p>Lets you control if people can use the \u201c<strong>write<\/strong>\u201d command, to send text to you over the screen.<\/p>\n<pre>mesg [<strong>n<\/strong>|<strong>y<\/strong>]\r\n<strong>n<\/strong> - prevents the message from others popping up on the screen.\r\n<strong>y<\/strong> \u2013 Allows messages to appear on your screen.<\/pre>\n<h3>48. Command: write<\/h3>\n<p>Let you send text directly to the screen of another Linux machine if \u2018<strong>mesg<\/strong>\u2019 is \u2018<strong>y<\/strong>\u2019.<\/p>\n<pre>[avishek@tecmint ~]$ write ravisaive<\/pre>\n<h3>49. Command: talk<\/h3>\n<p>An enhancement to\u00a0<strong>write<\/strong>\u00a0command,\u00a0<strong>talk<\/strong>\u00a0command lets you talk to the logged in users.<\/p>\n<pre>[avishek@tecmint ~]$ talk ravisaive<\/pre>\n<p><strong>Note<\/strong>: If\u00a0<strong>talk<\/strong>\u00a0command is not installed, you can always\u00a0<strong>apt<\/strong>\u00a0or\u00a0<strong>yum<\/strong>\u00a0the required packages.<\/p>\n<pre>[avishek@tecmint ~]$ yum install talk\r\nOR\r\n[avishek@tecmint ~]$ apt-get install talk<\/pre>\n<h3>50. Command: w<\/h3>\n<p>what command \u2018<strong>w<\/strong>\u2019 seems you funny? But actually it is not. t\u2019s a command, even if it\u2019s just one letter long! The command \u201c<strong>w<\/strong>\u201d is a combination of\u00a0<strong>uptime<\/strong>\u00a0and\u00a0<strong>who<\/strong>\u00a0commands given one immediately after the other, in that order.<\/p>\n<pre>[avishek@tecmint ~]$ w\r\n\r\n15:05:42 up  4:49,  3 users,  load average: 0.02, 0.01, 0.00 \r\nUSER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT \r\nserver   tty7     :0               14:06    4:43m  1:42   0.08s pam: gdm-passwo \r\nserver   pts\/0    :0.0             14:18    0.00s  0.23s  1.65s gnome-terminal \r\nserver   pts\/1    :0.0             14:47    4:43   0.01s  0.01s bash<\/pre>\n<h3>51. Command: rename<\/h3>\n<p>As the name suggests, this command rename files. rename will rename the specified files by replacing the first occurrence from the file name.<\/p>\n<pre>Give the file names a1, a2, a3, a4.....1213<\/pre>\n<p>Just type the command.<\/p>\n<pre> rename a1 a0 a?\r\n rename a1 a0 a??<\/pre>\n<h3>52. Command: top<\/h3>\n<p>Displays the processes of\u00a0<strong>CPU<\/strong>. This command refresh automatically, by default and continues to show\u00a0<strong>CPU<\/strong>processes unless interrupt-instruction is given.<\/p>\n<pre>[avishek@tecmint ~]$ top\r\n\r\ntop - 14:06:45 up 10 days, 20:57,  2 users,  load average: 0.10, 0.16, 0.21\r\nTasks: 240 total,   1 running, 235 sleeping,   0 stopped,   4 zombie\r\n%Cpu(s):  2.0 us,  0.5 sy,  0.0 ni, 97.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st\r\nKiB Mem:   2028240 total,  1777848 used,   250392 free,    81804 buffers\r\nKiB Swap:  3905532 total,   156748 used,  3748784 free,   381456 cached\r\n\r\n  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+ COMMAND                                                                                                            \r\n23768 ravisaiv  20   0 1428m 571m  41m S   2.3 28.9  14:27.52 firefox                                                                                                            \r\n24182 ravisaiv  20   0  511m 132m  25m S   1.7  6.7   2:45.94 plugin-containe                                                                                                    \r\n26929 ravisaiv  20   0  5344 1432  972 R   0.7  0.1   0:00.07 top                                                                                                                \r\n24875 ravisaiv  20   0  263m  14m  10m S   0.3  0.7   0:02.76 lxterminal                                                                                                         \r\n    1 root      20   0  3896 1928 1228 S   0.0  0.1   0:01.62 init                                                                                                               \r\n    2 root      20   0     0    0    0 S   0.0  0.0   0:00.06 kthreadd                                                                                                           \r\n    3 root      20   0     0    0    0 S   0.0  0.0   0:17.28 ksoftirqd\/0                                                                                                        \r\n    5 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kworker\/0:0H                                                                                                       \r\n    7 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kworker\/u:0H                                                                                                       \r\n    8 root      rt   0     0    0    0 S   0.0  0.0   0:00.12 migration\/0                                                                                                        \r\n    9 root      20   0     0    0    0 S   0.0  0.0   0:00.00 rcu_bh                                                                                                             \r\n   10 root      20   0     0    0    0 S   0.0  0.0   0:26.94 rcu_sched                                                                                                          \r\n   11 root      rt   0     0    0    0 S   0.0  0.0   0:01.95 watchdog\/0                                                                                                         \r\n   12 root      rt   0     0    0    0 S   0.0  0.0   0:02.00 watchdog\/1                                                                                                         \r\n   13 root      20   0     0    0    0 S   0.0  0.0   0:17.80 ksoftirqd\/1                                                                                                        \r\n   14 root      rt   0     0    0    0 S   0.0  0.0   0:00.12 migration\/1                                                                                                        \r\n   16 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kworker\/1:0H                                                                                                       \r\n   17 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 cpuset                                                                                                             \r\n   18 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 khelper                                                                                                            \r\n   19 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kdevtmpfs                                                                                                          \r\n   20 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 netns                                                                                                              \r\n   21 root      20   0     0    0    0 S   0.0  0.0   0:00.04 bdi-default                                                                                                        \r\n   22 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kintegrityd                                                                                                        \r\n   23 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kblockd                                                                                                            \r\n   24 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 ata_sff<\/pre>\n<p>Read Also :\u00a0<a href=\"https:\/\/www.tecmint.com\/12-top-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">12 TOP Command Examples<\/a><\/p>\n<h3>53. Command: mkfs.ext4<\/h3>\n<p>This command create a new\u00a0<strong>ext4<\/strong>\u00a0file system on the specified device, if wrong device is followed after this command, the whole block will be wiped and formatted, hence it is suggested not to run this command unless and until you understand what you are doing.<\/p>\n<pre>Mkfs.ext4 \/dev\/sda1 (sda1 block will be formatted)\r\nmkfs.ext4 \/dev\/sdb1 (sdb1 block will be formatted)<\/pre>\n<p><strong>Read More<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/what-is-ext2-ext3-ext4-and-how-to-create-and-convert-linux-file-systems\/\" target=\"_blank\" rel=\"noopener\">What is Ext4 and How to Create and Convert<\/a><\/p>\n<h3>54. Command: vi\/emacs\/nano<\/h3>\n<p><strong>vi<\/strong>\u00a0(visual),\u00a0<strong>emacs<\/strong>,\u00a0<strong>nano<\/strong>\u00a0are some of the most commonly used editors in Linux. They are used oftenly to edit text, configuration,\u2026 files. A quick guide to work around vi and nano is, emacs is a.<\/p>\n<h5>vi-editor<\/h5>\n<pre>[avishek@tecmint ~]$ touch a.txt (creates a text file a.txt) \r\n[avishek@tecmint ~]$ vi a.txt (open a.txt with vi editor)<\/pre>\n<p>[press \u2018<strong>i<\/strong>\u2019 to enter insert mode, or you won\u2019t be able to type-in anything]<\/p>\n<pre>echo \"Hello\"  (your text here for the file)<\/pre>\n<ol>\n<li><strong>alt+x<\/strong>\u00a0(exit insert mode, remember to keep some space between the last letter.<\/li>\n<li><strong>ctrl+x<\/strong>\u00a0command or your last word will be deleted).<\/li>\n<li><strong>:wq!<\/strong>\u00a0(saves the file, with the current text, remember \u2018!\u2019 is to override).<\/li>\n<\/ol>\n<h5>nano editor<\/h5>\n<pre>[avishek@tecmint ~]$ nano a.txt (open a.txt file to be edited with nano)<\/pre>\n<pre>edit, with the content, required<\/pre>\n<p>ctrl +x (to close the editor). It will show output as:<\/p>\n<pre>Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ?                    \r\n Y Yes \r\n N No           ^C Cancel<\/pre>\n<p>Click \u2018<strong>y<\/strong>\u2019 to yes and enter file name, and you are done.<\/p>\n<h3>55. Command: rsync<\/h3>\n<p><strong>Rsync<\/strong>\u00a0copies files and has a\u00a0<strong>-P<\/strong>\u00a0switch for a progress bar. So if you have rsync installed, you could use a simple alias.<\/p>\n<pre>alias cp='rsync -aP'<\/pre>\n<p>Now try to copy a large file in terminal and see the output with remaining items, similar to a progress bar.<\/p>\n<p>Moreover, Keeping and Maintaining backup is one of the most important and boring work a system administrator, needs to perform. Rsync is a very nice tool (there exists, several other) to create and maintain backup, in terminal.<\/p>\n<pre>[avishek@tecmint ~]$ rsync -zvr IMG_5267\\ copy\\=33\\ copy\\=ok.jpg ~\/Desktop\/ \r\n\r\nsending incremental file list \r\nIMG_5267 copy=33 copy=ok.jpg \r\n\r\nsent 2883830 bytes  received 31 bytes  5767722.00 bytes\/sec \r\ntotal size is 2882771  speedup is 1.00<\/pre>\n<p><strong>Note<\/strong>:\u00a0<strong>-z<\/strong>\u00a0for compression, -v for verbose and -r for recursive.<\/p>\n<h3>56. Command: free<\/h3>\n<p>Keeping track of memory and resources is as much important, as any other task performed by an administrator, and \u2018<strong>free<\/strong>\u2018 command comes to rescue here.<\/p>\n<h5>Current Usage Status of Memory<\/h5>\n<pre>[avishek@tecmint ~]$ free\r\n\r\n             total       used       free     shared    buffers     cached\r\nMem:       2028240    1788272     239968          0      69468     363716\r\n-\/+ buffers\/cache:    1355088     673152\r\nSwap:      3905532     157076    3748456<\/pre>\n<h5>Tuned Output in KB, or MB, or GB<\/h5>\n<pre>[avishek@tecmint ~]$ free -b\r\n\r\n             total       used       free     shared    buffers     cached\r\nMem:    2076917760 1838272512  238645248          0   71348224  372670464\r\n-\/+ buffers\/cache: 1394253824  682663936\r\nSwap:   3999264768  160845824 3838418944<\/pre>\n<pre>[avishek@tecmint ~]$ free -k\r\n\r\n             total       used       free     shared    buffers     cached\r\nMem:       2028240    1801484     226756          0      69948     363704\r\n-\/+ buffers\/cache:    1367832     660408\r\nSwap:      3905532     157076    3748456<\/pre>\n<pre>[avishek@tecmint ~]$ free -m\r\n\r\n             total       used       free     shared    buffers     cached\r\nMem:          1980       1762        218          0         68        355\r\n-\/+ buffers\/cache:       1338        641\r\nSwap:         3813        153       3660<\/pre>\n<pre>[avishek@tecmint ~]$ free -g\r\n\r\n             total       used       free     shared    buffers     cached\r\nMem:             1          1          0          0          0          0\r\n-\/+ buffers\/cache:          1          0\r\nSwap:            3          0          3<\/pre>\n<h5>Check Current Usage in Human Readable Format<\/h5>\n<pre>[avishek@tecmint ~]$ free -h\r\n\r\n             total       used       free     shared    buffers     cached\r\nMem:          1.9G       1.7G       208M         0B        68M       355M\r\n-\/+ buffers\/cache:       1.3G       632M\r\nSwap:         3.7G       153M       3.6G<\/pre>\n<h5>Check Status Contineously After Regular Interval<\/h5>\n<pre>[avishek@tecmint ~]$ free -s 3\r\n\r\n             total       used       free     shared    buffers     cached\r\nMem:       2028240    1824096     204144          0      70708     364180\r\n-\/+ buffers\/cache:    1389208     639032\r\nSwap:      3905532     157076    3748456\r\n\r\n             total       used       free     shared    buffers     cached\r\nMem:       2028240    1824192     204048          0      70716     364212\r\n-\/+ buffers\/cache:    1389264     638976\r\nSwap:      3905532     157076    3748456<\/pre>\n<p><strong>Read Also<\/strong>\u00a0:\u00a0<a href=\"https:\/\/www.tecmint.com\/10-examples-of-linux-free-command\/\" target=\"_blank\" rel=\"noopener\">10 Examples of Free Command<\/a><\/p>\n<h3>57. Command: mysqldump<\/h3>\n<p>Ok till now you would have understood what this command actually stands for, from the name of this command.<strong>mysqldump<\/strong>\u00a0commands dumps (backups) all or a particular database data into a given a file.For example,<\/p>\n<pre>[avishek@tecmint ~]$ mysqldump -u root -p --all-databases &gt; \/home\/server\/Desktop\/backupfile.sql<\/pre>\n<p><strong>Note<\/strong>:\u00a0<strong>mysqldump<\/strong>\u00a0requires mysql to be running and correct password for authorisation. We have covered some useful \u201c<strong>mysqldump<\/strong>\u201d commands at\u00a0<a href=\"https:\/\/www.tecmint.com\/mysql-backup-and-restore-commands-for-database-administration\/\" target=\"_blank\" rel=\"noopener\">Database Backup with mysqldump Command<\/a><\/p>\n<h3>58. Command: mkpasswd<\/h3>\n<p>Make a hard-to-guess, random password of the length as specified.<\/p>\n<pre>[avishek@tecmint ~]$ mkpasswd -l 10\r\n\r\nzI4+Ybqfx9<\/pre>\n<pre>[avishek@tecmint ~]$ mkpasswd -l 20 \r\n\r\nw0Pr7aqKk&amp;hmbmqdrlmk<\/pre>\n<p><strong>Note<\/strong>:\u00a0<strong>-l 10<\/strong>\u00a0generates a random password of\u00a0<strong>10<\/strong>\u00a0characters while\u00a0<strong>-l 20<\/strong>\u00a0generates a password of character\u00a0<strong>20<\/strong>, it could be set to anything to get desired result. This command is very useful and implemented in scripting language oftenly to generate random passwords. You might need to\u00a0<strong>yum<\/strong>\u00a0or\u00a0<strong>apt<\/strong>\u00a0the \u2018expect\u2019 package to use this command.<\/p>\n<pre>[root@tecmint ~]# yum install expect \r\nOR\r\n[root@tecmint ~]# apt-get install expect<\/pre>\n<h3>59. Command: paste<\/h3>\n<p>Merge two or more text files on lines using. Example. If the content of file1 was:<\/p>\n<pre>1 \r\n2 \r\n3 \r\n\r\nand file2 was: \r\n\r\na \r\nb \r\nc \r\nd \r\nthe resulting file3 would be: \r\n\r\n1\u00a0\u00a0\u00a0 a \r\n2\u00a0\u00a0\u00a0 b \r\n3\u00a0\u00a0\u00a0 c \r\n\u00a0\u00a0\u00a0\u00a0 d<\/pre>\n<h3>60.Command: lsof<\/h3>\n<p><strong>lsof<\/strong>\u00a0stands for \u201c<strong>list open files<\/strong>\u201d and displays all the files that your system has currently opened. It\u2019s very useful to figure out which processes uses a certain file, or to display all the files for a single process. Some useful\u00a0<a href=\"https:\/\/www.tecmint.com\/10-lsof-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">10 lsof Command<\/a>\u00a0examples, you might be interested in reading.<\/p>\n<pre>[avishek@tecmint ~]$ lsof \r\n\r\nCOMMAND     PID   TID            USER   FD      TYPE     DEVICE SIZE\/OFF       NODE NAME\r\ninit          1                  root  cwd       DIR        8,1     4096          2 \/\r\ninit          1                  root  rtd       DIR        8,1     4096          2 \/\r\ninit          1                  root  txt       REG        8,1   227432     395571 \/sbin\/init\r\ninit          1                  root  mem       REG        8,1    47080     263023 \/lib\/i386-linux-gnu\/libnss_files-2.17.so\r\ninit          1                  root  mem       REG        8,1    42672     270178 \/lib\/i386-linux-gnu\/libnss_nis-2.17.so\r\ninit          1                  root  mem       REG        8,1    87940     270187 \/lib\/i386-linux-gnu\/libnsl-2.17.so\r\ninit          1                  root  mem       REG        8,1    30560     263021 \/lib\/i386-linux-gnu\/libnss_compat-2.17.so\r\ninit          1                  root  mem       REG        8,1   124637     270176 \/lib\/i386-linux-gnu\/libpthread-2.17.so\r\ninit          1                  root  mem       REG        8,1  1770984     266166 \/lib\/i386-linux-gnu\/libc-2.17.so\r\ninit          1                  root  mem       REG        8,1    30696     262824 \/lib\/i386-linux-gnu\/librt-2.17.so\r\ninit          1                  root  mem       REG        8,1    34392     262867 \/lib\/i386-linux-gnu\/libjson.so.0.1.0\r\ninit          1                  root  mem       REG        8,1   296792     262889 \/lib\/i386-linux-gnu\/libdbus-1.so.3.7.2\r\ninit          1                  root  mem       REG        8,1    34168     262840 \/lib\/i386-linux-gnu\/libnih-dbus.so.1.0.0\r\ninit          1                  root  mem       REG        8,1    95616     262848 \/lib\/i386-linux-gnu\/libnih.so.1.0.0\r\ninit          1                  root  mem       REG        8,1   134376     270186 \/lib\/i386-linux-gnu\/ld-2.17.so\r\ninit          1                  root    0u      CHR        1,3      0t0       1035 \/dev\/null\r\ninit          1                  root    1u      CHR        1,3      0t0       1035 \/dev\/null\r\ninit          1                  root    2u      CHR        1,3      0t0       1035 \/dev\/null\r\ninit          1                  root    3r     FIFO        0,8      0t0       1714 pipe\r\ninit          1                  root    4w     FIFO        0,8      0t0       1714 pipe\r\ninit          1                  root    5r     0000        0,9        0       6245 anon_inode\r\ninit          1                  root    6r     0000        0,9        0       6245 anon_inode\r\ninit          1                  root    7u     unix 0xf5e91f80      0t0       8192 @\/com\/ubuntu\/upstart\r\ninit          1                  root    8w      REG        8,1     3916        394 \/var\/log\/upstart\/teamviewerd.log.1 (deleted)<\/pre>\n<p>This is not the end, a\u00a0<strong>System Administrator<\/strong>\u00a0does a lot of stuff, to provide you such a nice interface, upon which you work. System Administration is actually an art of learning and implementing in a very much perfect way. We will try to get you with all other necessary stuff which a linux professional must learn, linux in its basic actually itself, is a process of learning and learning.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/20-advanced-commands-for-linux-experts\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Thanks for all the likes, good words and support you gave us in the first two part of this article. In the first article we discussed commands for those users who have just\u00a0switched to Linux\u00a0and needed the necessary knowledge to start with. 20 Useful Commands for Linux Newbies In the second article we discussed the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/13\/20-advanced-commands-for-linux-experts\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;20 Advanced Commands for Linux Experts&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11317","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=11317"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11317\/revisions"}],"predecessor-version":[{"id":11318,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11317\/revisions\/11318"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}