Linux 常用命令(二)

一、chattr   --change file attributes on a linux file system  更改文件属性

  The format of a symbolic mode is +-=[acdeijstuADST].

  The operator ‘+’ causes the selected attributes to be added to the
  existing attributes of the files; ‘-’ causes them to be removed; and
  ‘=’ causes them to be the only attributes that the files have.

  The letters ‘acdeijstuADST’ select the new attributes for the files:
  append only (a), compressed (c), no dump (d), extent format (e),
  immutable (i), data journalling (j), secure deletion (s), no tail-
  merging (t), undeletable (u), no atime updates (A), synchronous
  directory updates (D), synchronous updates (S), and top of directory
  hierarchy (T).

说明:

  a:append only  仅可追加 

  i:immutable  不可改变的

二、lsattr  --list file attributes on a linux second extended file system 显示文件的扩展属性

示例:

三、chown  --change file owner and group 更改文件属主和用户组

格式:

  chown owner:group  文件

四、chgrp  --change group ownership 更改文件用户组

  格式:chgrp  group  文件

  示例:

 

五、cat  --concatenate files and print on the standard output 连接文件和打印输出

连接文件示例:

SYNOPSIS
cat [OPTION]... [FILE]...

DESCRIPTION
Concatenate FILE(s), or standard input, to standard output.

-b, --number-nonblank

number nonempty output lines 显示非空行行号

示例:

-E, --show-ends

display $ at end of each line 在每行末尾显示$

示例:

-n, --number
number all output lines 显示所有行行号

-s, --squeeze-blank
suppress repeated empty output lines 将所有空行显示为一行空行

示例:

-T, --show-tabs

display TAB characters as ^I 将制表符:tab显示为:^|

六、tac  --concatenate files and print files in reverse 和cat相反 倒叙显示(相对于行)

示例:

七、rev  --reverse lines of a file or files 倒叙显示每一行(相对于每一行的字母)

示例:

转载于:https://www.cnblogs.com/gaogzhen/p/9958523.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值