>
Home

登龙(DLonng)

选择大于努力

Linux 系统基础 - 系统管理命令


版权声明:本文为 DLonng 原创文章,可以随意转载,但必须在明确位置注明出处!

This time to introduce the linux system management and network command.

System Command

sudo

Using sudo to let super user do :

sudo su root

su

Using su to switch user :

sudo su user_name

export

Using export to export path :

export tmp_path=/home/orange

# print tmp_path
$tmp_path

# cd /home/orange
cd $tmp_path

shutdown / poweroff / halt / reboot

Using above command to shutdown linux :

# shutdown now
sudo shutdown -h now

# shutdown at time
sudo shutdown -h 20:30

# reboot now
sudo shutdown -r now

# shutdown now
poweroff

# reboot now
reboot

# shutdown now
halt

ps

Using ps to show current process :

ps [-aux]

kill

Using kill to kill a process :

sudo kill [process_pid]

top

Using top to dynamic show current run process :

top

free

Using free to show current memory usage :

free

uname

Using uname to show system information :

uname [-a]

uptime

Using uptime to show how long the system has been running :

uptime

clear

Using clear to clear screen :

clear

cal

Using cal to show calendar :

cal

data / time

Using date / time to show current time :

# Thu Jun 15 16:44:14 CST 2017
data

# real	0m0.000s
# user	0m0.000s
# sys	0m0.000s
time 

dmesg

Using dmesg to show system run time log :

dmesg

dumpe2fs

Using dump2fs to show super block information :

dumpe2fs -h /dev/sda

Network Command

netstat

Using netstat to show network status :

# -e : display ethernet statistics
# -r : display routing table information 
# -a : display all valid connection lists
# -n : display valid list of valid connection
netstat [-e] [-r] [-a] [-n]

ping

Using ping to check if the connection to the host is smooth :

ping 127.0.0.1

ifconfig

Using ifconfig to show and set ip address :

# show ip
ifconfig

# set ip
sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0

DLonng at 07/04/17