Common

1.How to check the NIC traffic in real time? How to view historical NIC traffic?

yum install -y sysstat# install sysstat package, get sar command
sar -n DEV# view NIC traffic, default 10 minutes update
sar -n DEV 1 10# is displayed once in a second, showing a total of 10 times
sar -n DEV -f /var/log/sa/sa22  #View the traffic log for the specified date
sar -q -f -f /var/log/sa/sa22

2.Show running process

$ps -aux
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2900  1428 ?        Ss   10:43   0:01 /sbin/init
root         2  0.0  0.0      0     0 ?        S    10:43   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    10:43   0:00 [migration/0]
root         4  0.0  0.0      0     0 ?        S    10:43   0:00 [ksoftirqd/0]

#STAT: S = sleeping , s = main process, Z =zombie process

$ps -elf
F S UID        PID  PPID  C PRI  NI ADDR SZ WCHAN  STIME TTY          TIME CMD
4 S root         1     0  0  80   0 -   725 -      10:43 ?        00:00:01 /sbin/init
1 S root         2     0  0  80   0 -     0 -      10:43 ?        00:00:00 [kthreadd]
1 S root         3     2  0 -40   - -     0 -      10:43 ?        00:00:00 [migration/0]
1 S root         4     2  0  80   0 -     0 -      10:43 ?        00:00:00 [ksoftirqd/0]
1 S root         5     2  0 -40   - -     0 -      10:43 ?        00:00:00 [migration/0]

3.Show openning ports

4.How to check the network connection status

5.Change IP.

6. Set multiple IP in one NIC

7.How do I check if a NIC is connected to a switch?

8.NAT

NAT is Network Address Translation. This is a protocol that provides a way for multiple computers on a common network to share single connection to the Internet.

9.Transfer files larger than 10K in the current directory to the /tmp directory.

Last updated