-d, --directory
list directory entries instead of contents, and do not dereference symbolic links
list directory , replacing the contents of this symbolic link are not shielded how to understand it , please explain the great God , the best example , thank you.
------ Solution ---------------------------------------- ----
$] ls *
dir1:
file_in_dir1
dir2:
file_in_dir2
$] ls -d *
dir1 dir2
$] tree
.
├── dir1
│ └── file_in_dir1
└── dir2
└── file_in_dir2
2 directories, 2 files
$] ls dir*
dir1:
file_in_dir1
dir2:
file_in_dir2
$] ls dir* -d
dir1 dir2
You can use wildcards to appreciate differences.
If ls followed by a number of parameters , including the directory if not with the-d , it will display the files in that directory with -d time , only the directory name itself
--- --- Solution --------------------------------------------
If ls-ld behind is a directory , then only shows the properties of this directory does not display the directory of the file attributes.
-d parameter to remove it, on the contrary, only shows the properties directory of the file is not displayed in this directory attributes.
------ For reference only -------------------------------------- -
-d list only directories, not including content, not reference symbolic links
actually only lists the current directory
eg: ls-d only .
The ls-d / etc displays / etc
------ For reference only --------------- ------------------------
Well you mentioned two examples I know that I want to ask that ls-d under what specific role does the list only , or ls-d dir dir behind I think it no practical usefulness ah god was able to answer the next big Thank you
------ For reference only -------------------------------- -------
whether there are files with directory information .
------ For reference only -------------------------------------- -
Wentasy can as an example to talk upstairs detail what thank god
------ For reference only ---------------------------------------
did not understand -d What is the purpose
I am more commonly used is ls-alh
------ For reference only ----------------------- ----------------
没有评论:
发表评论