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

  • linux常用命令
  • linux之常用命令
  • linux常用命令(三)
  • Linux常用命令图
  • linux常用命令及操作
  • 热门搜索
    我的世界怎么驯服龙 怎么清理内存 怎么养兔 美瞳怎么带 情绪低落怎么办 怎么减双下巴 水星路由器怎么设置 酒精肝怎么治疗 拳皇13怎么设置中文 怎么取名字