linux常用命令(十三)

2025-10-26 16:23:37

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常用命令(十三)

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
相关推荐
  • 阅读量:78
  • 阅读量:111
  • 阅读量:77
  • 阅读量:119
  • 阅读量:92
  • 猜你喜欢