网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 生活知识 知识问答

linux常用命令(十三)

时间:2026-02-19 03:03:49

1、chown

利用 chown 将指定文件的拥有者改为指定的用户或组

将文件 1.txt 的拥有者设为 root,组的使用者 admin :

[root@gongsi-A shell]# chown root.admin 1.txt 

linux常用命令(十三)

2、将a目录下的所有文件与子目录的拥有者皆设为 root,组的使用者 admin

[root@gongsi-A shell]# chown root.admin a -R

linux常用命令(十三)

3、ping命令向网络主机发送ICMP回传请求

[root@gongsi-A shell]# ping 192.168.20.1

linux常用命令(十三)

4、参数

-c2 表示ping 2次

 -i 1 间隔时间1秒

 -w 1 超时时间

[root@gongsi-A shell]# ping -c 2 -w 2 -i 2 192.168.20.1  

PING 192.168.20.1 (192.168.20.1) 56(84) bytes of data.

64 bytes from 192.168.20.1: icmp_seq=1 ttl=64 time=0.450 ms

linux常用命令(十三)

5、uniq

Linux uniq 命令用于检查及删除文本文件中重复出现的行列,一般与 sort 命令结合使用。

原有文件

[root@gongsi-A shell]# cat 1.txt

nihao 1

nihao 1

nihao 1

a 1

a 1

a 1

linux常用命令(十三)

6、参数 -c (count) -d(仅显示重复的行) -u(仅显示没有重复的行)

[root@gongsi-A shell]# uniq -c 1.txt 

      3 nihao 1

      3 a 1

[root@gongsi-A shell]# uniq -d 1.txt 

nihao 1

a 1

linux常用命令(十三)

linux常用命令(十三)

© 2026 一点资料
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com