Directory Management ls CD pwd mkdir rmdir tree
################################################################
LS: Display directory
CD: Switch directories
PWD: Show current directory
mkdir: Creating a Directory
RMDIR: Deleting a directory
Tree: Show Directory tree
################################################################
1>, ls:list directory contents list Contents
-L: Long format
File type
-: Universal Documents
D: Catalog file
B: Block devices (blocks)
C: Character file (character)
L: Compliant with link file (symbolic link files)
P: Command pipeline file (socket)
[Email protected] ~]# ls-ld/tmp
DRWXRWXRWT. 5 root root 4096 November 10:36/tmp
File permissions + Master (owner) + genus (group) + File size (size, Unit bytes)
-A: Shows all protections. Start with hidden files
. Current directory: Parent Directory
-H: Unit conversion
-D: Display the directory's own properties
-R: Reverse Display
-R: Recursive display
-i:index Nod,inode
--full Time: Show Details
[Email protected] ~]# ls/tmp/-al--full time
LS: Unable to access time: No file or directory
/tmp/:
Total Dosage 40
DRWXRWXRWT. 5 root root 4096 2016-11-14 08:26:25.138197188 +0800.
Dr-xr-xr-x. Root root 4096 2016-11-08 09:12:14.244789696 +0800..
DRWXRWXRWT. 2 root root 4096 2016-11-08 09:12:13.873794359 +0800. Ice-unix
DRWX------. 2 root root 16384 2016-07-20 00:21:08.000000000 +0800 lost+found
DRWX------. 2 root root 4096 2016-11-14 08:26:25.138197188 +0800 ssh-djisj35919
-rw-r--r--. 1 root root 2016-11-10 14:32:13.405295895 +0800 tmp.txt
-rw-r--r--. 1 James Root 2016-11-10 15:26:34.029648704 +0800 t.txt
################################################################
2>, Cd:change directory
CD ~username: Specify the user's home directory
CD-: Current directory and previous directory switch
[Email protected] ~]# cd/etc/
[Email protected] etc]# CD-
/root
[Email protected] ~]# CD-
/etc
################################################################
3> pwd:printing working directory displays the current working directory
[Email protected] ~]# pwd
/root
################################################################
4>,mkdir: Create a single empty directory by default
-P: Recursively create a directory
-V: Display creation information
[Email protected] ~]# MKDIR/TMP/TEST12-PV
mkdir: The directory "/tmp/test12" has been created
[Email protected] ~]# mkdir/tmp/test13
[Email protected] ~]# mkdir/tmp/test13-p
[Email protected] ~]# MKDIR/TMP/TEST14/T/T1/T2/T3/T4-PV
mkdir: The directory "/TMP/TEST14/T/T1/T2/T3" has been created
mkdir: The directory "/TMP/TEST14/T/T1/T2/T3/T4" has been created
[Email protected] ~]# MKDIR/TMP/TEST14/T/T1/T2/T3/T4/T5/T6
mkdir: Unable to create directory "/TMP/TEST14/T/T1/T2/T3/T4/T5/T6": No file or directory
################################################################
5>,rmdir: Only 1 empty directories can be deleted by default
-P: Recursively Delete empty directories
-V: Show Delete Information
[Email protected] ~]# RMDIR/TMP/TEST14/T/T1/T2/T3/T4-PV
RMDIR: Deleting directory "/TMP/TEST14/T/T1/T2/T3/T4"
RMDIR: Deleting directory "/TMP/TEST14/T/T1/T2/T3"
RMDIR: Deleting directory "/tmp/test14/t/t1/t2"
RMDIR: Deleting directory "/tmp/test14/t/t1"
RMDIR: Deleting directory "/tmp/test14/t"
RMDIR: Deleting directory "/tmp/test14"
RMDIR: Deleting directory "/tmp"
RmDir: Delete directory "/tmp" failure: Device or resource busy
################################################################
6,>,tree: Show directory tree
[Email protected] ~]# tree/tmp/
/tmp/
├──1btest2
├──23btest2
├──atest2
├──btest2
├──file-2016-11-15-19-10-06.txt
################################################################
This article is from the "James Zhan Linux Advanced ops" blog, so be sure to keep this source http://jameszhan.blog.51cto.com/10980469/1873664
Linux Basic article -05,linux directory Management ls CD pwd mkdir rmdir tree