linux磁盘管理命令总结

1、ls命令
命令功能:ls----list diertory contents 列举目录内容,默认显示当前目录内容
命令格式:ls [alhRrpFt] [dirName]..
常用参数解释:-a -----do not ignore entries starting with . 显示目录下所有内容,包括以.开头的隐藏文件、.当前目录 ..上一级目录
-l-------use a long listing format 列举目录内容详细属性,包括目录类型、目录权限、硬链接数、属主、属组、大小、最后一次修改时间、文件名
-h------with -l, print sizes in human readable format (e.g., 1K 234M 2G) 配合-l参数使用,以高可读大小单位显示目录的大小属性
-R-----list subdirectories recursively 递归显示目录下可见的文件、目录及子目录
-r------reverse order while sorting 反向排序
-t------sort by modification time 目录显示按照修改时间排序
-p-----append / indicator to directories 在目录后添加/标识符
-F-----append indicator (one of */=>@|) to entries 为不同类型的目录添加唯一标识符
实例展示:

2、mkdir命令
命令功能:mkdir --make directories 创建目录
命令格式:mkdir [-pv] directory...
常用参数解释:-p no error if existing, make parent directories as needed 递归创建多级目录
-v print a message for each created directory 显示目录创建过程
实例展示:

3、pwd命令
命令功能:pwd------Print the name of the current working directory. 打印当前工作目录(以绝对路径方式打印)
命令格式:pwd [-P|L]
常用参数解释:一般情况下,pwd命令不带任何参数,当工作目录是链接是:
-L ----link 显示链接文件路径
-P----physical 显示链接目录的实际物理路径
实例展示:

4、cd命令
命令功能:cd------Change the current directory to DIR. The default DIR is the value of the HOME 切换当前目录到指定目录,默认切换到用户的家目录。
命令格式:cd [-L|-P] [dir]
常用参数解释:一般情况下,cd命令不带任何参数,和通配符.当前目录 .. 上一级目录 -最近一次目录 ~用户的家目录。当目录是链接是:
-L ----link 切换到链接文件目录中
-P----physical 切换到实际物理路径
实例展示:

5、rmdir命令
命令功能:rmdir----remove empty directories 删除空目录
命令格式:rmdir [-pv]... DIRECTORY...
命令参数:-p ---remove DIRECTORY and its ancestors用于删除多级空目录
-v-----output a diagnostic for every directory processed 显示处理过程信息
实例展示:

6、tree命令
命令功能:tree------list contents of directories in a tree-like format. 以倒挂树格式显示目录内容
命令格式:tree [-adL] [directory..]
常用参数解释:-a----All files are printed.显示所有目录内容,包括隐藏文件,不包括.和..
-d---- List directories only. 只显示目录
-L----Max display depth of the directory tree.按需显示目录的层数
实例展示

7、df命令
命令功能:df---report file system disk space usage 显示文件系统磁盘使用信息
命令格式:df [-ih] [file]
常用参数解释:-i-----list inode information instead of block usage显示磁盘inode信息
-h 以高可读性单位显示大小属性
实例展示:

8、stat命令
命令功能:stat----display file or file system status显示文件或文件所在文件系统状态
命令格式:stat [OPTION]... FILE
常用参数解释 -f ------display file system status instead of file status显示文件所在文件系统信息
-c------use the specified FORMAT instead of the default; output a newline after each use of FORMAT,以指定的格式获取文件或文件系统信息
-t-------print the information in terse form以简洁的形式显示文件或文件系统信息
实例展示(包含FORMAT解释)


posted @ 2019-05-06 10:34  技术笨鸟  阅读(1801)  评论(0编辑  收藏  举报