User Tools

Site Tools


docs:linux_commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docs:linux_commands [2025/06/18 09:20] – Added namei sysadmdocs:linux_commands [2026/04/16 09:08] (current) – Fixed gramma sysadm
Line 1: Line 1:
 ====== Linux Commands ====== ====== Linux Commands ======
  
-Quick summary of common used program in Linux.+Quick summary of useful program in Linux for sysadmin purposesTo get a full description of each one __have a look at their [[https://linux.die.net/man/|man pages]]__, by doing ''man //command//''
 + 
 +---- 
 + 
 +====== Files ====== 
 + 
 +=== plocate === 
 +Powerful file finder on the whole system, run after ''sudo updatedb''. Need to be explicitly installed.\\ 
 + 
 +Syntax:\\ 
 +''plocate test.txt'' 
 + 
 +Output: 
 +<code> 
 +/home/admin/test.txt 
 +</code>
  
 ---- ----
  
 === tree === === tree ===
-Print a folder structure.\\+Print a folder structure. Need to be explicitly installed.\\
  
-Command:\\ +Syntax:\\ 
-''tree /home/admin/TreeFolder/''\\+''tree /home/admin/TreeFolder/''
  
-Output:\\+Output:
 <code> <code>
 /home/admin/TreeFolder/ /home/admin/TreeFolder/
Line 22: Line 37:
  
 === namei === === namei ===
-Follow a pathname until a terminal point is found.\\+Follow a pathname until a terminal point is found. Need to be explicitly installed.\\
  
-Command:\\ +Syntax:\\ 
-''namei /home/admin/''\\+''namei /home/admin/''
  
-Output:\\+Output:
 <code> <code>
 f: /home/admin/ f: /home/admin/
Line 35: Line 50:
 </code> </code>
  
- --- //[[lorenzo.cesana@becloudsolutions.com|Lorenzo Cesana]] 2025/06/18 09:18//+---- 
 + 
 +====== Logs ====== 
 + 
 +=== tail === 
 +Print last n rows of a file. Useful to save live updates to a logfile by redirecting the output. The following example is capturing all SIP request to analyze them later with [[https://www.wireshark.org/|Wireshark]].\\ 
 + 
 +Syntax:\\ 
 +''tail -f /etc/servicepattern/sipprocessor.log > test.log'' 
 + 
 +Output:\\ 
 +In this example, none.\\ 
 +Download the file and open it in Wireshark (or manually). 
 + 
 +---- 
 + 
 +====== Networking ====== 
 + 
 +=== netstat === 
 +Let you see running program listening on ports. Many more options in the manpage, use it with ''grep'' to look for a specific port.\\ 
 + 
 +Syntax:\\ 
 +''netstat -tulpn'' 
 + 
 +Output: 
 +<code> 
 +Active Internet connections (only servers) 
 +Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     
 +tcp        0      0 0.0.0.0:5355            0.0.0.0:              LISTEN      345/systemd-resolve  
 +tcp        0      0 127.0.0.1:25            0.0.0.0:              LISTEN      699/exim4            
 +tcp        0      0 0.0.0.0:443             0.0.0.0:              LISTEN      3247/nginx: master   
 +tcp        0      0 127.0.0.53:53           0.0.0.0:              LISTEN      345/systemd-resolve  
 +tcp        0      0 0.0.0.0:80              0.0.0.0:              LISTEN      3247/nginx: master   
 +tcp        0      0 127.0.0.54:53           0.0.0.0:              LISTEN      345/systemd-resolve  
 +tcp        0      0 0.0.0.0:22              0.0.0.0:              LISTEN      62083/sshd: /usr/sb  
 +tcp6            0 :::5355                 :::                   LISTEN      345/systemd-resolve  
 +tcp6            0 :::5000                 :::                   LISTEN      3905/node /home/adm  
 +tcp6            0 ::1:25                  :::*                    LISTEN      699/exim4            
 +tcp6            0 :::80                   :::                   LISTEN      3247/nginx: master   
 +tcp6            0 :::22                   :::                   LISTEN      62083/sshd: /usr/sb  
 +udp        0      0 127.0.0.54:53           0.0.0.0:                          345/systemd-resolve  
 +</code> 
 + 
 + 
 +Syntax:\\ 
 +''netstat -tulpn | grep 5000'' 
 + 
 +Output: 
 +<code> 
 +tcp6            0 :::5000                 :::                   LISTEN      3905/node /home/adm 
 +</code> 
 + 
 + 
 + --- //[[lorenzo.cesana@becloudsolutions.com|Lorenzo Cesana]] 2026/04/16 09:07//
docs/linux_commands.1750238425.txt.gz · Last modified: by sysadm

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki