linux熱門檔案管理命令(2)

來源:互聯網
上載者:User

標籤:檔案管理   linux   

  1. 建立檔案
    touch  建立檔案或個更新檔案的時間戳記。 如果檔案不存在,就建立新檔案,如果檔案存在,就更新檔案的時間戳記。

      例如:在uzz目錄下建立1.txt,在uzz的xk目錄下建立2.txt

   [[email protected] uzz]# touch 1.txt   [[email protected] uzz]# touch xk/2.txt   [[email protected] uzz]# ls   1.txt  xk   [[email protected] uzz]# ls xk   2.txt  wlgc   [[email protected] uzz]#

   2. 查看檔案

      cat 目錄名/檔案名稱

   [[email protected] xk]# cat /etc/sysconfig/network-scripts/ifcfg-eth0   DEVICE=eth0   HWADDR=00:0c:29:06:1c:66   TYPE=Ethernet   UUID=3bfb0110-c5ed-446c-856e-530bb2097725   ONBOOT=yes   NM_CONTROLLED=yes   BOOTPROTO=none   USERCTL=no   IPV6INIT=no   IPADDR=192.168.80.222   NETMASK=255.255.255.0   GATEWAY=192.168.80.1   DNS1=8.8.8.8   [[email protected] xk]#

3. 移動/複製檔案/檔案夾

      cp  拷貝檔案/檔案夾

      格式:cp 參數 源 目標

      例如:將uzz/xk下的2.txt拷貝到uzz下:

   [[email protected] xk]# cp 2.txt /uzz   [[email protected] xk]# ls /uzz   1.txt  2.txt  xk   [[email protected] xk]#

      mv  移動檔案/檔案夾

      格式:mv 參數 源 目標

      例如:將uzz下的1.txt移動到uzz/xk檔案夾中

   [[email protected] uzz]# mv 1.txt xk   [[email protected] uzz]# ls xk   1.txt  2.txt  wlgc   [[email protected] uzz]#

 4.使用 vi 編輯檔案

     vi 檔案名稱

     然後按a或i進入編輯模式,對文本進行編輯,編輯完成後按esc,然後按shift+: 輸入wq 斷行符號儲存      並退出

     例如:編輯uzz下的2.txt,輸入內容:1 2 3 4

  [[email protected] uzz]# ls    2.txt  xk    [[email protected] uzz]# vi 2.txt        1 2 3 4     ~    ~    ~    ~    "2.txt" 1L, 8C written    [[email protected] uzz]# cat 2.txt    1 2 3 4    [[email protected] uzz]#


本文出自 “技術成就夢想” 部落格,請務必保留此出處http://xuxiaoliang.blog.51cto.com/10882951/1921174

linux熱門檔案管理命令(2)

聯繫我們

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