1. head命令
选项:
-n
-c
[ root@qls ~]
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
[ root@qls ~]
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
== =
[ root@qls ~]
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
[ root@qls ~]
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
polkitd:x:999:998:User for polkitd:/:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
[ root@qls ~]
root:[ root@qls ~]
2. tail命令
选项:
-n
-c
-f
-F
[ root@qls ~]
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
polkitd:x:999:998:User for polkitd:/:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
[ root@qls ~]
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
== =
[ root@qls ~]
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
[ root@qls ~]
ogin
[ root@qls ~]
[ root@qls ~]
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
polkitd:x:999:998:User for polkitd:/:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
hello
[ root@qls ~]
[ root@qls ~]
tail: cannot open ‘test.log’ for reading: No such file or directory
tail: no files remaining
[ root@qls ~]
tail: cannot open ‘test.log’ for reading: No such file or directory
tail: ‘test.log’ has appeared; following end of new file
test
3. tailf命令
tailf == == tail -f
当文件内容没有发生变化时,tailf不会去读取磁盘中的信息,减少磁盘的读写 ,tail -f 当文件内容没有发生变化时,会一直向磁盘进行读取
选项:
-n
4. locate命令
[ root@qls ~]
选项:
-i
-r
/var/lib/mlocate/mlocate.db
[ root@qls ~]
[ root@qls ~]
/etc/passwd
/etc/passwd-
/etc/pam.d/passwd
/etc/security/opasswd
/root/passwd
/usr/bin/gpasswd
/usr/bin/grub2-mkpasswd-pbkdf2
/usr/bin/passwd
/usr/lib/firewalld/services/kpasswd.xml
[ root@qls ~]
/usr/bin/hostnamectl
/usr/share/bash-completion/completions/hostnamectl
/usr/share/man/man1/hostnamectl.1.gz
/usr/share/zsh/site-functions/_hostnamectl
[ root@qls ~]
[ root@qls ~]
[ root@qls ~]
/root/hostnamectl
/usr/bin/hostnamectl
/usr/share/bash-completion/completions/hostnamectl
/usr/share/man/man1/hostnamectl.1.gz
/usr/share/zsh/site-functions/_hostnamectl
[ root@qls ~]
[ root@qls ~]
/root/hostnamectl
/usr/bin/hostnamectl
/usr/share/bash-completion/completions/hostnamectl
/usr/share/man/man1/hostnamectl.1.gz
/usr/share/zsh/site-functions/_hostnamectl
[ root@qls ~]
/opt/HOSTNAMEctl
/root/hostnamectl
/usr/bin/hostnamectl
/usr/share/bash-completion/completions/hostnamectl
/usr/share/man/man1/hostnamectl.1.gz
/usr/share/zsh/site-functions/_hostnamectl
[ root@qls ~]
/etc/hostname
/etc/selinux/targeted/active/modules/100/hostname
/usr/bin/hostname
/usr/bin/nmtui-hostname
/usr/lib64/gettext/hostname
5. which命令
[ root@qls ~]
/usr/bin/ping
[ root@qls ~]
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[ root@qls ~]
/usr/bin/cp
[ root@qls ~]
iputils-20160308-10.el7.x86_64
[ root@qls ~]
iputils-20160308-10.el7.x86_64
6. whereis命令
选项:
-b
-m
-s
[ root@qls ~]
ping: /usr/bin/ping /usr/share/man/man8/ping.8.gz
[ root@qls ~]
ping: /usr/bin/ping
[ root@qls ~]
ping: /usr/share/man/man8/ping.8.gz
7. type命令
选项:
-a
-p
help命令可以显示系统中所有的内置命令
[ root@qls ~]
ping is /usr/bin/ping
[ root@qls ~]
cd is a shell builtin
[ root@qls ~]
cd is a shell builtin
cd is /usr/bin/cd
[ root@qls ~]
/usr/bin/ping
[ root@qls ~]
/usr/bin/cd
8. find命令
选项:
-type
f
d
l
s
p
-name
-iname
语法:
选项,条件 干什么
命令 地区 类型 名称 动作 默认动作就是打印
[ root@qls ~]
/etc/hostname
[ root@qls ~]
[ root@qls ~]
total 0
-rw-r--r--. 1 root root 0 Jul 10 10:32 hostname
-rw-r--r--. 1 root root 0 Jul 10 10:32 hostnamectl
[ root@qls ~]
[ root@qls ~]
[ root@qls ~]
total 0
-rw-r--r--. 1 root root 0 Jul 10 10:32 hostname
-rw-r--r--. 1 root root 0 Jul 10 10:32 hostnamectl
-rw-r--r--. 1 root root 0 Jul 10 10:32 test_hostname
-rw-r--r--. 1 root root 0 Jul 10 10:33 test_hostname.txt
[ root@qls ~]
/opt/hostname
[ root@qls ~]
/opt/hostname
/opt/hostnamectl
[ root@qls ~]
/opt/hostname
/opt/test_hostname
[ root@qls ~]
/opt/hostname
/opt/hostnamectl
/opt/test_hostname
/opt/test_hostname.txt
[ root@qls ~]
[ root@qls ~]
/opt/hostname
/opt/hostnamectl
/opt/test_hostname
/opt/test_hostname.txt
/opt/.hostname.log
[ root@qls ~]
/opt/HOSTNAMECTL
9. rz命令
[ root@qls ~]
选项:
-E
[ root@qls ~]
[ root@qls ~]
total 16
-rw-r--r--. 1 root root 13140 Jul 7 12:23 day03.md
[ root@qls ~]
[ root@qls ~]
total 32
-rw-r--r--. 1 root root 13140 Jul 7 12:23 day03.md
-rw-r--r--. 1 root root 13140 Jul 7 12:23 day03.md.0
10. sz命令
[ root@qls ~]
11. wget命令
[ root@qls ~]
选项:
-O
-q
--limit-rate= 10k
[ root@qls ~]
--2020-07-10 11:57:50-- http://www.baidu.com/
Resolving www.baidu.com ( www.baidu.com) .. . 112.80.248.75, 112.80.248.76
Connecting to www.baidu.com ( www.baidu.com) | 112.80.248.75| :80.. . connected.
HTTP request sent, awaiting response.. . 200 OK
Length: 2381 ( 2.3K) [ text/html]
Saving to: ‘index.html’
100%[ == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = > ] 2,381 --.-K/s in 0.008s
2020-07-10 11:57:51 ( 290 KB/s) - ‘index.html’ saved [ 2381/2381]
[ root@qls ~]
--2020-07-10 12:00:16-- http://nginx.org/download/nginx-1.18.0.tar.gz
Resolving nginx.org ( nginx.org) .. . 95.211.80.227, 62.210.92.35, 2001:1af8:4060:a004:21::e3
Connecting to nginx.org ( nginx.org) | 95.211.80.227| :80.. . connected.
HTTP request sent, awaiting response.. . 200 OK
Length: 1039530 ( 1015K) [ application/octet-stream]
Saving to: ‘nginx-1.18.0.tar.gz’
100%[ == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = > ] 1,039,530 282KB/s in 3.6s
2020-07-10 12:00:20 ( 282 KB/s) - ‘nginx-1.18.0.tar.gz’ saved [ 1039530/1039530]
[ root@qls ~]
total 1020
-rw-r--r--. 1 root root 2381 Jul 10 11:57 index.html
-rw-r--r--. 1 root root 1039530 Apr 21 22:33 nginx-1.18.0.tar.gz
[ root@qls ~]
--2020-07-10 12:01:41-- http://nginx.org/download/nginx-1.18.0.tar.gz
Resolving nginx.org ( nginx.org) .. . 62.210.92.35, 95.211.80.227, 2001:1af8:4060:a004:21::e3
Connecting to nginx.org ( nginx.org) | 62.210.92.35| :80.. . connected.
HTTP request sent, awaiting response.. . 200 OK
Length: 1039530 ( 1015K) [ application/octet-stream]
Saving to: ‘/opt/nginx.tar.gz’
100%[ == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = > ] 1,039,530 272KB/s in 3.7s
2020-07-10 12:01:46 ( 272 KB/s) - ‘/opt/nginx.tar.gz’ saved [ 1039530/1039530]
[ root@qls ~]
total 1016
-rw-r--r--. 1 root root 0 Jul 10 10:32 hostname
-rw-r--r--. 1 root root 0 Jul 10 10:32 hostnamectl
drwxr-xr-x. 2 root root 6 Jul 10 10:39 HOSTNAMECTL
-rw-r--r--. 1 root root 1039530 Apr 21 22:33 nginx.tar.gz
[ root@qls ~]
[ root@qls ~]
total 2100
-rw-r--r--. 1 root root 41240 Mar 23 00:20 032220_1620_Zabbix1.png
-rw-r--r--. 1 root root 9810 Jul 8 00:06 download.html
-rw-r--r--. 1 root root 2381 Jul 10 11:57 index.html
-rw-r--r--. 1 root root 1039530 Apr 21 22:33 nginx-1.18.0.tar.gz
-rw-r--r--. 1 root root 1047223 Jul 7 23:59 nginx-1.19.1.tar.gz
[ root@qls ~]
[ root@qls ~]
[ root@qls ~]
--2020-07-10 12:11:13-- http://nginx.org/download/nginx-1.18.0.tar.gz
Resolving nginx.org ( nginx.org) .. . 62.210.92.35, 95.211.80.227, 2001:1af8:4060:a004:21::e3
Connecting to nginx.org ( nginx.org) | 62.210.92.35| :80.. . connected.
HTTP request sent, awaiting response.. . 200 OK
Length: 1039530 ( 1015K) [ application/octet-stream]
Saving to: ‘nginx-1.18.0.tar.gz’
32% [ == == == == == == == == == == == == > ] 335,872 10.0KB/s eta 70s
12. curl命令
选项:
-o
-s
[ root@qls ~]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2381 100 2381 0 0 311 0 0:00:07 0:00:07 --:--:-- 657
[ root@qls ~]
total 1356
-rw-r--r--. 1 root root 2381 Jul 10 12:15 baidu.html
[ root@qls ~]