Ls command: Ten interview-level questions-Episode 2
As xiaobian has been a little busy recently and has not had time to knock on it very quickly, now let's take a look at the second article about listing ls commands. If you have forgotten what you mentioned in the first article, let's take a look at the first article:
Ls command: 15 interview-level questions for Linux-Episode 1
Here is an example of the 'LS' command for your convenience.
1. here you need to output the path content, but do not output the user and user group to which it belongs.
The a. ls command lists the file information in full format and uses Option-l
ls -l
B. output the user
ls -l --author
C. Output here we do not output the user
ls -g
D. the user and user group are not output here.
ls -Gl
2. output the file size of the current path in readable format
Here we need to use-h (human-readable) and option-l or-s in combination with the ls command.
ls -hl
ls -hs
Option-h uses the power of 1024. The output file size is measured in K, M, and G.
The power of 3.1024 is standard. What size formats does the ls command support?
Here there is a-si and-h which are similar. The difference is that the power of 1000 is used.
ls -si
This can also be used in full format output.
ls -si -l
4. You must separate the output path content with commas. Can this be done? What if it can be done in the complete format?
OK, LINUX ls command output path content, separated by commas, with option-m can be horizontally separated, ls command cannot be Vertical Split content.
ls -m
But in the full format list,-m is invalid.
ls -ml
5. Is there any way to put the output path content upside down. For example, reverse output
You can use option-r in the preceding scenario. Option-r can be used for reverse command output. It can also be used in the complete format output-l.
ls -r
ls -rl
For more details, please continue to read the highlights on the next page:
Author: GuiltyMan: For more information, visit the linux community.
Help House Original translation channel: http://www.bkjia.com/topicnews.aspx? Tid = 15