linux常用命令之目录处理

本文发布时间: 2019-Mar-22
目录处理命令 : ls所在路径 /bin/ls执行权限:所有用户[root@localhost ~]# lsanaconda-ks.cfg install.log.syslog VMwareTools-9.6.2-1688356.tar.gzDesktop test2.txt vmware-tools-distribinstall.log test.txt[root@localhost ~]# ls -alh总计 59Mdrwxr-x--- 19 root root 4.0K 11-30 20:33 .drwxr-xr-x 24 root root 4.0K 11-30 19:11 ..-rw------- 1 root root 1.3K 11-30 20:59 anaconda-ks.cfg-rw------- 1 root root 4.8K 11-30 20:33 .bash_history-rw-r--r-- 1 root root 24 2006-07-13 .bash_logout-rw-r--r-- 1 root root 191 11-30 19:25 .bash_profile-rw-r--r-- 1 root root 176 2006-07-13 .bashrcdrwx------ 2 root root 4.0K 11-30 21:42 .chewingdrwx------ 3 root root 4.0K 11-30 17:50 .config-rw-r--r-- 1 root root 100 2006-07-13 .cshrcdrwxr-xr-x 3 root root 4.0K 11-30 13:52 Desktop-rw------- 1 root root 26 11-30 21:42 .dmrcdrwxr-x--- 2 root root 4.0K 11-30 21:43 .eggcupsdrwx------ 4 root root 4.0K 11-30 19:15 .gconfdrwx------ 2 root root 4.0K 12-01 12:11 .gconfddrwxr-xr-x 3 root root 4.0K 11-30 21:42 .gnomedrwx------ 6 root root 4.0K 11-30 21:42 .gnome2drwx------ 2 root root 4.0K 11-30 21:42 .gnome2_privatedrwxr-xr-x 2 root root 4.0K 11-30 21:43 .gstreamer-0.10-rw-r--r-- 1 root root 81 11-30 21:42 .gtkrc-1.2-gnome2-rw------- 1 root root 567 11-30 19:15 .ICEauthority-rw-r--r-- 1 root root 27K 11-30 20:58 install.log-rw-r--r-- 1 root root 3.6K 11-30 20:57 install.log.syslogdrwx------ 3 root root 4.0K 11-30 21:43 .metacitydrwx------ 4 root root 4.0K 11-30 13:52 .mozilla-rw------- 1 root root 40 11-30 20:20 .mysql_historydrwxr-xr-x 3 root root 4.0K 11-30 21:42 .nautilusdrwxr-xr-x 3 root root 4.0K 11-30 21:42 .redhatdrwx------ 4 root root 4.0K 11-30 13:49 .scim-rw-r--r-- 1 root root 129 2006-07-13 .tcshrc-rw-r--r-- 1 root root 4.2K 11-30 20:27 test2.txt-rw-r--r-- 1 root root 16K 11-30 20:27 .test2.txt.swp-rw-r--r-- 1 root root 779 11-30 16:28 test.txtdrwx------ 2 root root 4.0K 11-30 21:43 .Trash-rw------- 1 root root 5.4K 11-30 20:33 .viminfo-r--r--r-- 1 root root 59M 11-30 21:44 VMwareTools-9.6.2-1688356.tar.gzdrwxr-xr-x 7 root root 4.0K 2014-03-22 vmware-tools-distrib-rw-r--r-- 1 root root 9.6K 11-30 20:33 .xsession-errors[root@localhost ~]# ls -i425993 anaconda-ks.cfg 426072 test2.txt426023 Desktop 426065 test.txt425986 install.log 426054 VMwareTools-9.6.2-1688356.tar.gz425987 install.log.syslog 458753 vmware-tools-distrib命令名称: mkdir所在路径:/bin/mkdir权限:所有用户[root@localhost ~]# mkdir /tmp/china/testmkdir: 无法创建目录 “/tmp/china/test”: 没有那个文件或目录[root@localhost ~]# mkdir -p /tmp/china/test命令名称:cd所在路径:shell 内置命令执行权限:所有用户命令名称:pwd所在路径:/bin/pwd执行权限:所有用户mkdir: 无法创建目录 “/tmp/china/test”: 没有那个文件或目录[root@localhost ~]# mkdir -p /tmp/china/test[root@localhost ~]# [root@localhost ~]# cd /tmp/china/test[root@localhost test]# pwd/tmp/china/test[root@localhost test]# cd ..[root@localhost china]# 命令名称:rmdir (删除空目录)所在路径:/bin/rmdir[root@localhost china]# rmdir /tmp/china/test[root@localhost china]# cd /tmp[root@localhost tmp]# ll总计 48drwxr-xr-x 2 root root 4096 12-01 13:05 chinadrwx------ 3 root root 4096 11-30 19:15 gconfd-rootdrwx------ 2 root root 4096 11-30 19:15 keyring-n4KWUIsrwxr-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 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]# rmdir /tmprmdir: /tmp: 目录非空命令名称:cp所在路径:/bin/cp权限:所有用户[root@localhost tmp]# cp -pr /tmp/test /root # 复制目录 需要参数r 保持原有属性需要参数 p[root@localhost tmp]# 命令名称:mv 剪切和改名 不需要参数-r -p所在路径:/bin/mv执行权限:所有用户[root@localhost ~]# mv install.log install3.log[root@localhost ~]# ll总计 59964-rw------- 1 root root 1265 11-30 20:59 anaconda-ks.cfgdrwxr-xr-x 3 root root 4096 11-30 13:52 Desktop-rw-r--r-- 1 root root 27265 11-30 20:58 install3.log-rw-r--r-- 1 root root 3671 11-30 20:57 install.log.syslogdrwxr-xr-x 2 root root 4096 12-01 13:09 test-rw-r--r-- 1 root root 4207 11-30 20:27 test2.txt-rw-r--r-- 1 root root 779 11-30 16:28 test.txt-r--r--r-- 1 root root 61260572 11-30 21:44 VMwareTools-9.6.2-1688356.tar.gzdrwxr-xr-x 7 root root 4096 2014-03-22 vmware-tools-distrib[root@localhost ~]# 目录名称:rm所在路径:/bin/rm执行权限:所有用户[root@localhost tmp]# mkdir temp[root@localhost tmp]# cd [root@localhost ~]# cp /etc/grub.conf /tmp/temp[root@localhost ~]# rm -f /tmp/temp/grub.conf [root@localhost ~]# rm /tmp/temprm: 无法删除目录“/tmp/temp”: 是一个目录[root@localhost ~]# rm -r /tmp/temprm:是否删除 目录 “/tmp/temp”? y


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

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