linux常用命令之檔案處理

來源:互聯網
上載者:User

linux常用命令之檔案處理

命令名稱:touch

所在路徑:/bin.touch

執行許可權:所有使用者

 

oot@localhost tmp]# touch list.txt[root@localhost tmp]# touch /root/list.txt[root@localhost tmp]# touch program files[root@localhost tmp]# ll總計 52drwxr-xr-x 2 root root 4096 12-01 13:05 china-rw-r--r-- 1 root root    0 12-01 13:43 filesdrwx------ 3 root root 4096 11-30 19:15 gconfd-root-rw------- 1 root root  630 12-01 13:08 grub.confdrwx------ 2 root root 4096 11-30 19:15 keyring-n4KWUI-rw-r--r-- 1 root root    0 12-01 13:36 list.txtsrwxr-xr-x 1 root root    0 11-30 19:15 mapping-rootdrwx------ 2 root root 4096 12-01 12:10 orbit-root-rw-r--r-- 1 root root    0 12-01 13:43 program-rw-r--r-- 1 root root    5 12-01 13:00 scim-bridge-0.3.0.lockfile-0@localhost:0.0srwxr-xr-x 1 root root    0 11-30 20:10 scim-bridge-0.3.0.socket-0@localhost:0.0srw------- 1 root root    0 11-30 19:16 scim-helper-manager-socket-rootsrw------- 1 root root    0 11-30 19:16 scim-panel-socket:0-rootsrw------- 1 root root    0 11-30 19:15 scim-socket-frontend-rootdrwx------ 2 root root 4096 11-30 19:15 ssh-mibWGs4219drwx------ 2 root root 4096 11-30 19:15 virtual-root.tyft1adrwxr-xr-x 2 root root 4096 11-30 21:48 vmware-config0drwxrwxrwt 4 root root 4096 11-30 18:13 VMwareDnDdrwxr-xr-x 2 root root 4096 11-30 19:13 vmware-rootdrwx------ 2 root root 4096 11-30 19:15 vmware-root-2083992326[root@localhost tmp]# touch " profile file"[root@localhost tmp]# lschinafilesgconfd-rootgrub.confkeyring-n4KWUIlist.txtmapping-rootorbit-root profile fileprogramscim-bridge-0.3.0.lockfile-0@localhost:0.0scim-bridge-0.3.0.socket-0@localhost:0.0scim-helper-manager-socket-rootscim-panel-socket:0-rootscim-socket-frontend-rootssh-mibWGs4219virtual-root.tyft1avmware-config0VMwareDnDvmware-rootvmware-root-2083992326[root@localhost tmp]# 

 

命令名稱:cat

命令所在路徑:/bin/cat

執行許可權:所有使用者

 

[root@localhost tmp]# cat /etc/issueRed Hat Enterprise Linux Server release 5.4 (Tikanga)Kernel \r on an \m[root@localhost tmp]# cat -n /etc/issue     1  Red Hat Enterprise Linux Server release 5.4 (Tikanga)     2  Kernel \r on an \m     3[root@localhost tmp]# 

命令名稱:tac

 

所在路徑:/usr/bin/tac

 

[root@localhost tmp]# cat /etc/issueRed Hat Enterprise Linux Server release 5.4 (Tikanga)Kernel \r on an \m[root@localhost tmp]# cat -n /etc/issue     1  Red Hat Enterprise Linux Server release 5.4 (Tikanga)     2  Kernel \r on an \m     3[root@localhost tmp]# [root@localhost tmp]# tac /etc/issueKernel \r on an \mRed Hat Enterprise Linux Server release 5.4 (Tikanga)[root@localhost tmp]# tac -n /etc/issuetac:無效選項 -- n請嘗試執行“tac --help”來擷取更多資訊。

命令名稱:more 只能向下翻頁

 

所在路徑:/bin/more

空格 f q

命令名稱:less

page UP (向上一頁)

進行收索

 

[root@localhost tmp]# less /etc/services 

命令名稱:head 、tail

 

 

[root@localhost tmp]# head  /etc/services # /etc/services:# $Id: services,v 1.42 2006/02/23 13:09:23 pknirsch Exp $## Network services, Internet style## Note that it is presently the policy of IANA to assign a single well-known# port number for both TCP and UDP; hence, most entries here have two entries# even if the protocol doesn't support UDP operations.# Updated from RFC 1700, ``Assigned Numbers'' (October 1994).  Not all ports# are included, only the more common ones.[root@localhost tmp]# head -1  /etc/services # /etc/services:[root@localhost tmp]# 

 

 

[root@localhost tmp]# tail -f  /etc/services  #動態變化nimspooler      48001/udp                       # Nimbus Spoolernimhub          48002/tcp                       # Nimbus Hubnimhub          48002/udp                       # Nimbus Hubnimgtw          48003/tcp                       # Nimbus Gatewaynimgtw          48003/udp                       # Nimbus Gatewaycom-bardac-dw   48556/tcp                       # com-bardac-dwcom-bardac-dw   48556/udp                       # com-bardac-dwiqobject        48619/tcp                       # iqobjectiqobject        48619/udp                       # iqobject

命令名稱:ln

永久連結可以進行同步更新,但不能誇分區,不能針對目錄建立永久連結

 

[root@localhost tmp]# ln -s /etc/issue /tmp/issue.soft[root@localhost tmp]# ln  /etc/issue /tmp/issue.hard[root@localhost tmp]# ln -l /etc/issueln:無效選項 -- l請嘗試執行“ln --help”來擷取更多資訊。[root@localhost tmp]# ls -l /etc/issue-rw-r--r-- 2 root root 74 2009-08-04 /etc/issue[root@localhost tmp]# ls -l /tmp/issue*-rw-r--r-- 2 root root 74 2009-08-04 /tmp/issue.hardlrwxrwxrwx 1 root root 10 12-01 14:36 /tmp/issue.soft -> /etc/issue[root@localhost tmp]# [root@localhost tmp]# ls -i /etc/issue /tmp/issue.soft /tmp/issue.hard 1573051 /etc/issue  1573051 /tmp/issue.hard   917638 /tmp/issue.soft[root@localhost tmp]# 

 


 

聯繫我們

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