笔记2

[root@localhost ~]#
[root@localhost ~]# cat /etc/passwd | tail -n 10 | sort
avahi❌70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
bgx❌5001:1003:2018new student:/home/bgx:/bin/bash
gnome-initial-setup❌989:983::/run/gnome-initial-setup/:/sbin/nologin
mysql❌987:1004::/home/mysql:/sbin/nologin
nginx❌988:982:Nginx web server:/var/lib/nginx:/sbin/nologin
ntp❌38:38::/etc/ntp:/sbin/nologin
postfix❌89:89::/var/spool/postfix:/sbin/nologin
sshd❌74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
tcpdump❌72:72:😕:/sbin/nologin
yyj❌1000:1000:yyj:/home/yyj:/bin/bash
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# cat /etc/passwd | tail -n 10
gnome-initial-setup❌989:983::/run/gnome-initial-setup/:/sbin/nologin
sshd❌74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
avahi❌70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
postfix❌89:89::/var/spool/postfix:/sbin/nologin
ntp❌38:38::/etc/ntp:/sbin/nologin
tcpdump❌72:72:😕:/sbin/nologin
yyj❌1000:1000:yyj:/home/yyj:/bin/bash
nginx❌988:982:Nginx web server:/var/lib/nginx:/sbin/nologin
bgx❌5001:1003:2018new student:/home/bgx:/bin/bash
mysql❌987:1004::/home/mysql:/sbin/nologin
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# cat /etc/passwd | tail -n 10 | sort -t 'i' - k
sort: cannot read: k: 没有那个文件或目录
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# cat /etc/passwd | tail -n 10 | sort -t 'i' -k
sort:选项需要一个参数 -- k
Try 'sort --help' for more information.
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# cat /etc/passwd | tail -n 10 | sort -t 'i' -k 3
bgx❌5001:1003:2018new student:/home/bgx:/bin/bash
yyj❌1000:1000:yyj:/home/yyj:/bin/bash
sshd❌74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
avahi❌70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
mysql❌987:1004::/home/mysql:/sbin/nologin
ntp❌38:38::/etc/ntp:/sbin/nologin
tcpdump❌72:72:😕:/sbin/nologin
nginx❌988:982:Nginx web server:/var/lib/nginx:/sbin/nologin
gnome-initial-setup❌989:983::/run/gnome-initial-setup/:/sbin/nologin
postfix❌89:89::/var/spool/postfix:/sbin/nologin
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# cat /etc/passwd | tail -n 10 | sort -t 'i' -k 3 -n
avahi❌70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
bgx❌5001:1003:2018new student:/home/bgx:/bin/bash
gnome-initial-setup❌989:983::/run/gnome-initial-setup/:/sbin/nologin
mysql❌987:1004::/home/mysql:/sbin/nologin
nginx❌988:982:Nginx web server:/var/lib/nginx:/sbin/nologin
ntp❌38:38::/etc/ntp:/sbin/nologin
postfix❌89:89::/var/spool/postfix:/sbin/nologin
sshd❌74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
tcpdump❌72:72:😕:/sbin/nologin
yyj❌1000:1000:yyj:/home/yyj:/bin/bash
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# ls -lh
总用量 11M
drwxr-xr-x. 2 root root 112 8月 19 15:57 123
-rw-r--r--. 1 root root 20 8月 2 10:22 1888.txt
-rw-r--r--. 1 root root 2.2K 8月 9 21:40 1.sh
-rw-r--r--. 1 root root 13K 7月 14 18:49 ALTER
-rw-------. 1 root root 1.5K 7月 14 15:10 anaconda-ks.cfg
-rw-r--r--. 1 root root 61 8月 2 10:22 copy_test.txt
-rw-r--r--. 1 root root 0 7月 14 15:32 file
-rw-r--r--. 1 root root 1.7K 7月 14 15:13 initial-setup-ks.cfg
-rw-r--r--. 1 root root 40 8月 2 10:22 line.txt
-rw-r--r--. 1 root root 9.6M 8月 19 15:53 secure.zip
drwxr-xr-x. 4 root root 227 8月 2 11:05 shell
-rw-r--r--. 1 root root 61 8月 2 10:11 test.txt
-rw-r--r--. 1 root root 3.6K 8月 2 11:45 tmp2.txt
-rw-r--r--. 1 root root 277K 8月 2 11:29 tmp.txt
-rw-r--r--. 1 root root 122K 5月 14 2020 yum-utils-1.1.31-54.el7_8.noarch.rpm
drwxr-xr-x. 2 root root 6 7月 14 15:13 公共
drwxr-xr-x. 2 root root 6 7月 14 15:13 模板
drwxr-xr-x. 2 root root 6 7月 14 15:13 视频
drwxr-xr-x. 2 root root 6 7月 14 15:13 图片
drwxr-xr-x. 2 root root 6 7月 14 15:13 文档
drwxr-xr-x. 2 root root 6 7月 14 15:13 下载
drwxr-xr-x. 2 root root 6 7月 14 15:13 音乐
drwxr-xr-x. 2 root root 6 7月 14 15:13 桌面
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# ls -lh | sort
drwxr-xr-x. 2 root root 112 8月 19 15:57 123
drwxr-xr-x. 2 root root 6 7月 14 15:13 公共
drwxr-xr-x. 2 root root 6 7月 14 15:13 模板
drwxr-xr-x. 2 root root 6 7月 14 15:13 视频
drwxr-xr-x. 2 root root 6 7月 14 15:13 图片
drwxr-xr-x. 2 root root 6 7月 14 15:13 文档
drwxr-xr-x. 2 root root 6 7月 14 15:13 下载
drwxr-xr-x. 2 root root 6 7月 14 15:13 音乐
drwxr-xr-x. 2 root root 6 7月 14 15:13 桌面
drwxr-xr-x. 4 root root 227 8月 2 11:05 shell
-rw-------. 1 root root 1.5K 7月 14 15:10 anaconda-ks.cfg
-rw-r--r--. 1 root root 0 7月 14 15:32 file
-rw-r--r--. 1 root root 122K 5月 14 2020 yum-utils-1.1.31-54.el7_8.noarch.rpm
-rw-r--r--. 1 root root 13K 7月 14 18:49 ALTER
-rw-r--r--. 1 root root 1.7K 7月 14 15:13 initial-setup-ks.cfg
-rw-r--r--. 1 root root 20 8月 2 10:22 1888.txt
-rw-r--r--. 1 root root 2.2K 8月 9 21:40 1.sh
-rw-r--r--. 1 root root 277K 8月 2 11:29 tmp.txt
-rw-r--r--. 1 root root 3.6K 8月 2 11:45 tmp2.txt
-rw-r--r--. 1 root root 40 8月 2 10:22 line.txt
-rw-r--r--. 1 root root 61 8月 2 10:11 test.txt
-rw-r--r--. 1 root root 61 8月 2 10:22 copy_test.txt
-rw-r--r--. 1 root root 9.6M 8月 19 15:53 secure.zip
总用量 11M
[root@localhost ~]#
[root@localhost ~]# ls -lh | sort -k 5 -n
-rw-r--r--. 1 root root 0 7月 14 15:32 file
总用量 11M
-rw-------. 1 root root 1.5K 7月 14 15:10 anaconda-ks.cfg
-rw-r--r--. 1 root root 1.7K 7月 14 15:13 initial-setup-ks.cfg
-rw-r--r--. 1 root root 2.2K 8月 9 21:40 1.sh
-rw-r--r--. 1 root root 3.6K 8月 2 11:45 tmp2.txt
drwxr-xr-x. 2 root root 6 7月 14 15:13 公共
drwxr-xr-x. 2 root root 6 7月 14 15:13 模板
drwxr-xr-x. 2 root root 6 7月 14 15:13 视频
drwxr-xr-x. 2 root root 6 7月 14 15:13 图片
drwxr-xr-x. 2 root root 6 7月 14 15:13 文档
drwxr-xr-x. 2 root root 6 7月 14 15:13 下载
drwxr-xr-x. 2 root root 6 7月 14 15:13 音乐
drwxr-xr-x. 2 root root 6 7月 14 15:13 桌面
-rw-r--r--. 1 root root 9.6M 8月 19 15:53 secure.zip
-rw-r--r--. 1 root root 13K 7月 14 18:49 ALTER
-rw-r--r--. 1 root root 20 8月 2 10:22 1888.txt
-rw-r--r--. 1 root root 40 8月 2 10:22 line.txt
-rw-r--r--. 1 root root 61 8月 2 10:11 test.txt
-rw-r--r--. 1 root root 61 8月 2 10:22 copy_test.txt
drwxr-xr-x. 2 root root 112 8月 19 15:57 123
-rw-r--r--. 1 root root 122K 5月 14 2020 yum-utils-1.1.31-54.el7_8.noarch.rpm
drwxr-xr-x. 4 root root 227 8月 2 11:05 shell
-rw-r--r--. 1 root root 277K 8月 2 11:29 tmp.txt
[root@localhost ~]#
[root@localhost ~]# ls -lh | sort -k 3 -n
drwxr-xr-x. 2 root root 112 8月 19 15:57 123
drwxr-xr-x. 2 root root 6 7月 14 15:13 公共
drwxr-xr-x. 2 root root 6 7月 14 15:13 模板
drwxr-xr-x. 2 root root 6 7月 14 15:13 视频
drwxr-xr-x. 2 root root 6 7月 14 15:13 图片
drwxr-xr-x. 2 root root 6 7月 14 15:13 文档
drwxr-xr-x. 2 root root 6 7月 14 15:13 下载
drwxr-xr-x. 2 root root 6 7月 14 15:13 音乐
drwxr-xr-x. 2 root root 6 7月 14 15:13 桌面
drwxr-xr-x. 4 root root 227 8月 2 11:05 shell
-rw-------. 1 root root 1.5K 7月 14 15:10 anaconda-ks.cfg
-rw-r--r--. 1 root root 0 7月 14 15:32 file
-rw-r--r--. 1 root root 122K 5月 14 2020 yum-utils-1.1.31-54.el7_8.noarch.rpm
-rw-r--r--. 1 root root 13K 7月 14 18:49 ALTER
-rw-r--r--. 1 root root 1.7K 7月 14 15:13 initial-setup-ks.cfg
-rw-r--r--. 1 root root 20 8月 2 10:22 1888.txt
-rw-r--r--. 1 root root 2.2K 8月 9 21:40 1.sh
-rw-r--r--. 1 root root 277K 8月 2 11:29 tmp.txt
-rw-r--r--. 1 root root 3.6K 8月 2 11:45 tmp2.txt
-rw-r--r--. 1 root root 40 8月 2 10:22 line.txt
-rw-r--r--. 1 root root 61 8月 2 10:11 test.txt
-rw-r--r--. 1 root root 61 8月 2 10:22 copy_test.txt
-rw-r--r--. 1 root root 9.6M 8月 19 15:53 secure.zip
总用量 11M
[root@localhost ~]#

posted on 2025-12-18 09:35  爱尔奎特‘殷’  阅读(2)  评论(0)    收藏  举报