linux常用命令之文件处理

本文发布时间: 2019-Mar-22
命令名称: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 on an m[root@localhost tmp]# cat -n /etc/issue 1 Red Hat Enterprise Linux Server release 5.4 (Tikanga) 2 Kernel 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 on an m[root@localhost tmp]# cat -n /etc/issue 1 Red Hat Enterprise Linux Server release 5.4 (Tikanga) 2 Kernel on an m 3[root@localhost tmp]# [root@localhost tmp]# tac /etc/issueKernel 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命令名称:lesspage 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]#


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:10pm
栏目列表