Difference between revisions of "Miscellaneous Linux Commands"

From TheBestLinux.com
Jump to navigation Jump to search
Line 4: Line 4:
 
Display all network interface names on any Linux system from the shell:
 
Display all network interface names on any Linux system from the shell:
 
<pre style="color:blue">ifconfig | grep BROADCAST | cut -d " " -f1 | sed 's/.$//' </pre>
 
<pre style="color:blue">ifconfig | grep BROADCAST | cut -d " " -f1 | sed 's/.$//' </pre>
 +
<br />
 +
Most Linux machines will only display one network interface, such as shown on my Slackware 14.1 Virtual Machine Server:
 +
<pre style="color:blue">eth0 </pre>
 +
<br />
 +
Other systems may have more than one, such as those with virtual machine software.
 
Sample output from my Fedora 20 VirtualBox server:
 
Sample output from my Fedora 20 VirtualBox server:
 
<pre style="color:blue">em1
 
<pre style="color:blue">em1
 
virbr0</pre>
 
virbr0</pre>
 +
<br />
 +
And here is a sample output from my Fedora 17 (Beefy Miracle) laptop running VMWare:
 +
<pre style="color:blue">p5p1                                                                         
 +
vmnet1                                                                       
 +
vmnet8</pre>
 
<h3>
 
<h3>
 
The "ps" Process Command Syntax
 
The "ps" Process Command Syntax

Revision as of 13:51, 17 November 2014

Shell Commands

Display all network interface names on any Linux system from the shell:

ifconfig | grep BROADCAST | cut -d " " -f1 | sed 's/.$//' 


Most Linux machines will only display one network interface, such as shown on my Slackware 14.1 Virtual Machine Server:

eth0 


Other systems may have more than one, such as those with virtual machine software. Sample output from my Fedora 20 VirtualBox server:

em1
virbr0


And here is a sample output from my Fedora 17 (Beefy Miracle) laptop running VMWare:

p5p1                                                                           
vmnet1                                                                         
vmnet8

The "ps" Process Command Syntax


To show all executing processes:

$ ps ax


To show all processed running by a specific user(This example shows all processes running by the Apache WebServer):

$ ps -U apache