linux常用命令之目录处理

发布时间:2022-11-22 13:57:56阅读:58次
系统大全为您提供目录处理命令 : ls所在路径 /bin/ls执行权限:所有用户?12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849[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权限:所有用户?123[root@localhost~]#mkdir/tmpina/testmkdir:无法创建目录“/tmpina/test”:没有那个文件或目录[root@localhost~]#mkdir-p/tmpina/test命令名称:cd所在路径:shell内置命令执行权限:所有用户命令名称:pwd所在路径:/bin/pwd执行权限:所有用户?12345678mkdir:无法创建目录“/tmpina/test”:没有那个文件或目录[root@localhost~]#mkdir-p/tmpina/test[root@localhost~]#[root@localhost~]#cd/tmpina/test[root@localhosttest]#pwd/tmpina/test[root@localhosttest]#cd..[root@localhostchina]#命令名称:rmdir(删除空目录)所在路径:/bin/rmdir?12345678910111213141516171819202122[root@localhostchina]#rmdir/tmpina/test[root@localhostchina]#cd/tmp[root@localhosttmp]#ll总计48drwxr-xr-x2rootroot409612-0113:05chinadrwx------3rootroot409611-3019:15gconfd-rootdrwx------2rootroot409611-3019:15keyring-n4KWUIsrwxr-xr-x1rootroot011-3019:15mapping-rootdrwx------2rootroot409612-0112:10orbit-root-rw-r--r--1rootroot512-0113:00scim-bridge-0.3.0.lockfile-0@localhost:0.0srwxr-xr-x1rootroot011-3020:10scim-bridge-0.3.0.socket-0@localhost:0.0srw-------1rootroot011-3019:16scim-helper-manager-socket-rootsrw-------1rootroot011-3019:16scim-panel-socket:0-rootsrw-------1rootroot011-3019:15scim-socket-frontend-rootdrwx------2rootroot409611-3019:15ssh-mibWGs4219drwx------2rootroot409611-3019:15virtual-root.tyft1adrwxr-xr-x2rootroot409611-3021:48vmware-config0drwxrwxrwt4rootroot409611-3018:13VMwareDnDdrwxr-xr-x2rootroot409611-3019:13vmware-rootdrwx------2rootroot409611-3019:15vmware-root-2083992326[root@localhosttmp]#rmdir/tmprmdir:/tmp:目录非空命令名称:cp所在路径:/bin权限:所有用户?12[root@localhosttmp]#cp-pr/tmp/test/root#复制目录需要参数r保持原有属性需要参数p[root@localhosttmp]#命令名称:mv剪切和改名不需要参数-r-p所在路径:/bin/mv执行权限:所有用户?12345678910111213[root@localhost~]#mvinstall.loginstall3.log[root@localhost~]#ll总计59964-rw-------1rootroot126511-3020:59anaconda-ks.cfgdrwxr-xr-x3rootroot409611-3013:52Desktop-rw-r--r--1rootroot2726511-3020:58install3.log-rw-r--r--1rootroot367111-3020:57install.log.syslogdrwxr-xr-x2rootroot409612-0113:09test-rw-r--r--1rootroot420711-3020:27test2.txt-rw-r--r--1rootroot77911-3016:28test.txt-r--r--r--1rootroot6126057211-3021:44VMwareTools-9.6.2-1688356.tar.gzdrwxr-xr-x7rootroot40962014-03-22vmware-tools-distrib[root@localhost~]#目录名称:rm所在路径:/bin/rm执行权限:所有用户?12345678[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   以上就是系统大全给大家介绍的如何使的方法都有一定的了解了吧,好了,如果大家还想了解更多的资讯,那就赶紧点击系统大全官网吧。本文来自系统大全http://www.win7cn.com/如需转载请注明!推荐:win7纯净版