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 倒叙显示每一行(相对于每一行的字母)

示例:

posted on 2018-11-14 16:15  g2zh  阅读(255)  评论(0编辑  收藏  举报