Ls command: Ten interview-level questions-Episode 2

Source: Internet
Author: User

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: Tid = 15

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.