linux常用命令(十)

2025-12-17 11:43:22

1、stat:查看文件或者文件系统的状态 

[root@shell ~]# stat /etc/profile

  File: `/etc/profile'

  Size: 1960            Blocks: 8          IO Block: 4096   regular file

Device: 803h/2051d      Inode: 916149      Links: 1

Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)

Access: 2019-08-12 21:11:20.351122580 +0800

Modify: 2018-04-27 00:29:06.486815851 +0800

Change: 2018-04-27 00:29:06.488815797 +0800

linux常用命令(十)

2、参数

-c :格式化

%a : 查看文件属性

[root@shell ~]# stat -c %a /etc/hosts

644

linux常用命令(十)

3、%Y 按时间戳格式成时间戳

[root@shell ~]# stat -c %Y /etc/hosts

1263302902

[root@shell ~]

linux常用命令(十)

4、seq命令

用于以指定增量从首数开始打印数字到尾数,即产生从某个数到另外一个数之间的所有整数,并且可以对整数的格式、宽度、分割符号进行控制

产生5以内的整数

[root@shell ~]# seq 5

1

2

3

4

5

linux常用命令(十)

5、输出0-10的整数,增量为2

[root@shell ~]# seq 0 2 10

0

2

4

6

8

10

linux常用命令(十)

6、输出5-10之间的整数,要求宽度一致

[root@shell ~]# seq -w 5 10

05

06

07

08

09

10

linux常用命令(十)

7、不换行输出1-5的序列

[root@shell ~]# seq -s " " 5

1 2 3 4 5

linux常用命令(十)

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