Ls-l-r/home/shiyanlou Ls-lr/home/shiyanlou
List all files and directories under the/home/shiyanlou folder for more information
Ls-l d*
Ls-l c*
Lists the details of all directories in the current directory that begin with "D", using the following command:
Ls-f/home/shiyanlou |grep/$
Show subdirectories of/home/shiyanlou
Ls-l/home/shiyanlou | grep "^d"
Ls-l/home/shiyanlou | grep ' ^d '
Show subdirectory details for/home/shiyanlou
List all files under the current working directory whose names are the beginning of G, and the newer the later, you can use the following command:
Ls-ltr g*
List all the files and directories under the current working directory; add "/" to the name, and the file name to add "*"
Ls-af
Calculate the number of files and directories in the current directory
Ls-l. | grep "^d" |wc-l
Ls-l. | grep "^-" |wc-l
Ls-l * |grep "^-" |wc-l (contains subdirectories)
Ls-l |grep "^-" |wc-l (as of the previous catalogue)
Ls-l * |grep "^d" |wc-l (when a subdirectory of the previous catalogue has a sub-catalogue)
Ls-l |grep "^d" |wc-l (2 subdirectories of the previous catalogue)
List absolute records of files (folders)
LS |sed "s:^: $PWD/:"
Lists the absolute path to all files (including hidden files) in the current directory, without recursion to the directory
Find $PWD-maxdepth 1 | Xargs Ls-ld
Recursively lists the absolute path of all files (including hidden files) under the current directory
Find $PWD | Xargs Ls-ld
Ls-tl–time-style=full-iso
Ls-ctl–time-style=long-iso
Display a list of color catalogs
Open/ETC/BASHRC and add the following line:
Alias ls= "Ls–color"
The next time you start bash, you'll be able to display a list of colored catalogs as you would in Slackware, where the meanings of colors are as follows:
1. Blue –> Directory
2. Green –> executable file
3. Red –> Compressed file
4. Light blue –> link file
5. Grey –> Other files
Show files, sort by file size
Ll-s
-h,–human-readable list file sizes in an easy-to-understand format (e.g. 1K 234M 2G)
Horizontal output
Shows the folder information of the previous folder
Ls-ld
List file and folder details by modified time
Recently modified files are displayed at the top
1. One linux command per day ls