歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> Linux常用命令(1)

Linux常用命令(1)

日期:2017/3/3 11:35:35   编辑:Linux技術

1. cd:change directory 切換當前目錄至XX cd 後不加任何參數,切換到家目錄

cd ~ 直接切換至家目錄

cd - 在之前目錄和當前目錄之間來回切

2. ls:list 列出指定路徑下所有子目錄和文件-a, --all

do not ignore entries starting with .

列出當前目錄中的所有文件,包括以.開關不的隱藏文件

-d, --directory

list directory entries instead of contents, and do not dereference symbolic links

顯示目錄本身而不是其下的文件,不間接引用象征鏈接

-i, --inode (index node)

print the index number of each file

顯示文件的索引節點號

-l use a long listing format

列出文件的詳細信息

-r, --reverse

reverse order while sorting

逆序顯示

-R, --recursive

list subdirectories recursively

遞規顯示子目錄

3. mkdir:make directory 創建目錄 mkdir [OPTION]... DIRECTORY...

-p, --parents

no error if existing, make parent directories as needed

創建目錄,如果路徑中某些目錄不存在,系統將自動創建這些目錄

4. touch 創建文件 touch [OPTION]... FILE...

5. rm:remove 刪除一個目錄中的一個或多個文件或目錄 rm [OPTION]... FILE...

-f, --force

ignore nonexistent files, never prompt

忽略不存在的文件,永不提示

-i prompt before every removal

刪除之前提示

-r, -R, --recursive

remove directories and their contents recursively

遞規地刪除目錄和它下面的內容

rm不能直接刪除一個目錄,如果想刪除目錄的話要加上-r(rm: cannot remove `www': Is a directory)

本文出自 “後知後覺” 博客,請務必保留此出處http://7777778.blog.51cto.com/7767778/1796110

Copyright © Linux教程網 All Rights Reserved