[Infrastructure] Linux command, shell script collection

Contents

-** Network command ** -** Server command **

Network command

◆ netstat -anp

--Get port usage

$ netstat -anp
 Proto     Local Address         Foreign Address      State
  TCP        0.0.0.0:53             0.0.0.0:0        LISTENING
  TCP        0.0.0.0:80             0.0.0.0:0        LISTENING 

◆ ipconfig

--ipconfig: Windows command environment --ifconfig: UNIX command environment

//Checking the network environment
$ ipconfig /all
$ ipconfig addr show

◆ hostname

--Check the server host name

$ hostname
$ uname -n
$ uname -a //Detail View

route

◆ Displaying the contents of the routing table

--Metric: Route with a small metric value is registered in the routing table as the optimal destination route.

$ route print
Network Destination   Netmask    Gateway       Interface   Metric
    0.0.0.0          0.0.0.0   192.168.1.254  192.168.1.10   1

◆ Add routing (Linux)

//IP address: 192.168.30.0 Gateway: 192.168.1.254 Subnet mask: 255.255.255.0
$ route add -net 192.168.30.0 gw 192.168.1.254 metric 1 netmask 255.255.255.0 eth0

Server command

◆ w

--Simple output of the current `` server status''

$ w
 16:40:10 up  1:26,  1 user,  load average: 0.00, 0.01, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
vagrant  pts/0    10.0.2.2         15:28    0.00s  0.17s  0.00s w

◆ vmstat

--Display various ``` resource usage` ``

$ vmstat 1 3   //3 process display in 1 second unit
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0  59188 140888 162272 1216520    3    3     6    88    6    7  2  1 94  3  0
 0  0  59188 140880 162272 1216548    0    0     0     0  186  366  1  0 99  0  0
 0  0  59188 140880 162272 1216548    0    0     0     0  168  362  1  1 99  0  0

◆ iostat

--Display CPU usage'' with option "-c" --Display usage status of I/O device `` with option "-d"

$ iostat
Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
vda               0.46         2.63         9.55    2239142    8134170
vdb               0.00         0.00         0.00       1754          8

References

-Command collection often used as an infrastructure engineer -[Ionice] command-change disk I/O priority -12 commands for "what if" that occurs in IT infrastructure

Recommended Posts

[Infrastructure] Linux command, shell script collection
Linux [shell command]
Linux command collection
Shell script command replacement
linux command error collection 1
[Note] Useful linux command collection
Linux command # 4
Linux command # 3
Linux command # 5
Shell script numerical calculation bc command
Shell script basics # 2
linux at command
[Linux] Search command
Linux command <Basic 2>
pip command collection
Linux [directory command]
Linux server command
Linux # Command Memo 1
Linux command [read]
Linux Command Summary
[Basic] linux command
[Linux] Command / Knowledge
My linux command
Linux command <Basic 1>
Linux mkdir command
Linux command basics
[Linux] Git command
Linux (command memory)
[Linux] Volume configuration command
Linux command cheat sheet
Linux command (sequential update)
[Copy and paste OK] Basic Linux command collection [18 selections]
Linux basic command memorandum
Linux command [File operation]
A shell script that puts Webmin into Alpine Linux
[Linux] Basic command summary
Shell script special variables
Linux command for self-collection
Shell script @ study memo
[Infrastructure] While command summary
Linux command line shortcut
[Linux] Copy data from Linux to Windows with a shell script
[Linux] Write a deployment tool using rsync with a shell script
curl command show http status code in response (#Linux #Shell)
linux sar command CPU usage
[Linux] tar.gz compression / decompression command
What is Linux? [Command list]
Let's try a shell script
Easy df command on Linux
Linux tar xz command memo
Until the shell finds the command
Linux Command Dictionary (for myself)
linux: create original Terminal command
Linux command memorandum [for beginners]
Linux PC spec check command
[Linux] User / group command summary
[Linux Nginx] Command collection used for initial setting of Web server
Shell script (Linux, macOS) that outputs the date of the last week
Check the HTTP status code response with the curl command (#Linux #Shell)