linux 常用命令

來源:互聯網
上載者:User

標籤:

    日期時間

    date 國內時間 CST;

    date -u 格林尼治時間 UTC;

    date +%Y:%m:%d 格式化時間;

    date -s "21:05:00" 設定時間;

    clock 查看主板時間;

    cal 查看日曆;

    uptime 系統啟動資訊;

    輸出、查看命令

    echo: 顯示輸入的內容;

    cat: 顯示檔案內容;

    more: 用於翻頁顯示檔案內容,只能向下翻頁;

    less: 翻頁顯示檔案內容,帶上下翻頁;

    head: 顯示檔案頭幾行,預設10行  -n參數為指定顯示行數;

    tail: 顯示檔案的末尾幾行,預設10行 -n參數為指定顯示行數,-f追蹤顯示檔案更新,一般用於查看日誌;

    查看硬體資訊

    lspci: 查看PCI裝置 -v查看詳細資料;

    lsusb: 查看USB裝置 -v查看詳細資料;

    lsmod: 查看載入的模組(windows的驅動);

    歸檔釋放壓縮解壓縮

    zip 壓縮檔

    unzip 解壓縮檔案

    gzip 壓縮檔

    tar 歸檔檔案(打包命令,沒有壓縮)

    tar -cvf filename.tar filename;

    tar -xvf filename.tar (釋放檔案);

    尋找

    locate keyword 此命令需要預先建立資料庫,資料庫預設每天更新一次,可用updatedb命令手工建立、更新資料庫;

    find 尋找位置 尋找參數

    find /home/hhl/ -name *aabbcc* 以檔案名稱尋找;

    find /home/hhl/  -name *.conf;

    find / -perm 777 以許可權尋找;

    find / -type d 尋找所有目錄;

    find / -type l 尋找所有連結;

    find . -name "a*" -exec ls -l {} \; 查到所有以a開頭的檔案,並以ls -l形式列出;

linux 常用命令

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.