linux系統基本操作(1),linux系統基本操作

來源:互聯網
上載者:User

linux系統基本操作(1),linux系統基本操作

隨手寫寫

1.基本命令。

(1) ls  (list directory content)

ls .  目前的目錄;

ls ..  上一層目錄;

ls -l  以列表形式列出;

ls -a  列出所有檔案 -all;

ls -h  有帶單位  -human-readable;

ls -t  以時間順序排列 -time;

ls -R  遞迴  列出所有目錄下的所有資訊包括子目錄;

(2) touch 

如果檔案不存在,建立檔案;如果檔案存在,更新檔案時間,不會改變檔案內容;

(3)mkdir   建立一個目錄

mkdir  directorys    建立單級目錄  可多個;
mkdir  directory1/directory2  如果1不存在,則 -p 建立多級目錄;

(4)cd     change working directory

cd    到家目錄;
cd  ~ 到家目錄;
cd  - 到上一次跳轉過來的目錄(從哪來回哪去);
cd  / 到根目錄;

(5)rm   remove files or directorys

rm  -r  刪除一個目錄;
rm  -f  刪除時不提示 強制移除;

(6)cp  copy file or directory

cp file1  file2  將file1拷到file2;

cp file1  directory  將檔案拷到目錄下;

cp file1 file2 directory3 file...n  directory  將檔案或者目錄拷到一個目錄下但是必須保證最後一個是目錄;

cp *.c   AAA   拷所有以.c結尾的檔案到AAA目錄下;

\cp     覆蓋模式   不提示是否覆蓋;

cp directory1  directory2 -r  如果directory2不存在 直接拷,  如果directory2存在,拷到directory2下一級目錄下;

(7)mv  move  剪下或者重新命名
mv file1 file2
mv directory1 directory2  如果directory2 不存在 就重新命名,如果directory2 存在 剪下到directory2目錄下;

 

(10)關機指令
shutdown
halt
halt -p -f   直接切電源
init 0
restart   重啟
reboot

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.