linux常用命令之目录处理下载
系统大全为您分享
目录处理命令 : 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
权限:所有用户
?
1
2
3
[root@localhost ~]# mkdir /tmp
ina/test
mkdir: 无法创建目录 “/tmp
ina/test”: 没有那个文件或目录
[root@localhost ~]# mkdir -p /tmp
ina/test
命令名称:cd
所在路径:shell 内置命令
执行权限:所有用户
命令名称:pwd
所在路径:/bin/pwd
执行权限:所有用户
?
1
2
3
4
5
6
7
8
mkdir: 无法创建目录 “/tmp
ina/test”: 没有那个文件或目录
[root@localhost ~]# mkdir -p /tmp
ina/test
[root@localhost ~]#
[root@localhost ~]# cd /tmp
ina/test
[root@localhost test]# pwd
/tmp
ina/test
[root@localhost test]# cd ..
[root@localhost china]#
命令名称:rmdir (删除空目录)
所在路径:/bin/rmdir
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[root@localhost china]# rmdir /tmp
ina/test
[root@localhost china]# cd /tmp
[root@localhost tmp]# ll
总计 48
drwxr-xr-x 2 root root 4096 12-01 13:05 china
drwx—— 3 root root 4096 11-30 19:15 gconfd-root
drwx—— 2 root root 4096 11-30 19:15 keyring-n4KWUI
srwxr-xr-x 1 root root 0 11-30 19:15 mapping-root
drwx—— 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.0
srwxr-xr-x 1 root root 0 11-30 20:10 scim-bridge-0.3.0.socket-0@localhost:0.0
srw——- 1 root root 0 11-30 19:16 scim-helper-manager-socket-root
srw——- 1 root root 0 11-30 19:16 scim-panel-socket:0-root
srw——- 1 root root 0 11-30 19:15 scim-socket-frontend-root
drwx—— 2 root root 4096 11-30 19:15 ssh-mibWGs4219
drwx—— 2 root root 4096 11-30 19:15 virtual-root.tyft1a
drwxr-xr-x 2 root root 4096 11-30 21:48 vmware-config0
drwxrwxrwt 4 root root 4096 11-30 18:13 VMwareDnD
drwxr-xr-x 2 root root 4096 11-30 19:13 vmware-root
drwx—— 2 root root 4096 11-30 19:15 vmware-root-2083992326
[root@localhost tmp]# rmdir /tmp
rmdir: /tmp: 目录非空
命令名称:cp
所在路径:/bin
权限:所有用户
?
1
2
[root@localhost tmp]# cp -pr /tmp/test /root # 复制目录 需要参数r 保持原有属性需要参数 p
[root@localhost tmp]#
命令名称:mv 剪切和改名 不需要参数-r -p
所在路径:/bin/mv
执行权限:所有用户
?
1
2
3
4
5
6
7
8
9
10
11
12
13
[root@localhost ~]# mv install.log install3.log
[root@localhost ~]# ll
总计 59964
-rw——- 1 root root 1265 11-30 20:59 anaconda-ks.cfg
drwxr-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.syslog
drwxr-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.gz
drwxr-xr-x 7 root root 4096 2014-03-22 vmware-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纯净版
下载仅供下载体验和测试学习,不得商用和正当使用。