Linux system commands
1. execute instructions and view help
------ man function instruction can be used to view the object specific parameters available format.For example: man man -------- view help man the function of
man -help (h) ------- help documentation
Man operation instruction buttons do
space bar | Down |
---|---|
[Page Down] | Down |
[Page Up] | Page Up |
[home] | [Directly to the home page] |
[end] | [Go directly to the last page] |
/Key words | From top to bottom search keywords |
? Key words | From the first search keywords |
n | Navigate to the next search keywords, |
N | Positioned on a keyword to search |
q | Exit Help Documentation |
2. The work order system used
(1) echo: View or string variablessuch as echo $ SHELL ------ View SHELL variable
echo $ HOSTNAME ----- View hostname
(2) date: the date or time display / setting system
parameter | effect |
---|---|
%H | Hour (00-23) |
%t | Tab [TAB key] |
%I | Hour (01-12) |
%M | Min (00-59) |
%S | Sec (00-60) |
%X | Equivalent% H:% M:% S |
%FROM | The time zone |
%p | Display local AM or PM |
%A | Day of the week (sunday-saturday) |
date ----------------- view the current time of the system time
date "+% Y-% m-% d% H:% M:% S" ------ ------ view the current time system time (according to "year - month - day hours: minutes: seconds" format)
date "+% the Z-" -------- viewing area when the local system
date "+ "when the local system area view -------- A%
" is area -------- view the local system DATE "% P +
DATE" + J% "-------- local system Check Time zone
(3) restart and shutdown reboot the shutdown
(. 4) Download wget wget [parameters] Download
3. The system-state detecting instruction
(1) ifconfig ----- See the machine configuration and the current network status card
(2) uname -a ------ View system kernel version
(3) uptime ------ See detailed version information system
(4) free -m (g) ----- check the system memory
(5) last ----- See sign a record of all the systems
(6) history ------ View command history have been executed
4. The working directory command
(1) pwd ------- display the current working directory
(2) cd ----------------- path switching operation
cd - 切换到上一次的目录
cd ~ 切换到家目录
cd .. 切换到上级目录
(3) ls ------------ view the files in a directory
ls -a 查看全部文件
ls -d 仅看目录本身
ls -h 易读的文件容量(如K,mg)
ls -l 显示文件的详细信息
The text file editing instruction
(1) cat ----------- view plain text files (short) cat -n 显示行号(包括空行)
cat -b 显示行号(不包括空行)
cat -A 显示出“不可见”的符号,如空格,tab键等等
Information (2) wc -------------- statistics specified text
wc -l 只显示行数
wc -w 只显示单词数
wc -c 只显示字节数
6. File directory management command
(1) touch -------------- create a blank file with the modified file timetouch -a 近修改访问时间
touch -m 近修改更改时间
touch -d 同时修改访问时间和更改时间
touch -t 要修改成的时间
(2) mkdir ------ create a blank folder
mkdir -m 默认的文件目录权限
mkdir -v 显示创建的过程
mkdir -p 连续创建多层目录
(3) cp ------- copy a file or directory
cp -p 保留原始文件的属性
cp -d 若对象为“链接文件”,保留链接文件的属性
cp -r 递归持续复制
cp -i 若目标文件存在则询问呢是否覆盖
cp -a 相当于-pdr
(4) rm ---------- delete files or directories
rm -f 忽略警告信息
rm -i 删除前先询问
rm -r 删除文件夹