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解釋)