Linux common shell commands ls

Source: Internet
Author: User

Linux common shell commands ls
Ls: view the file name and directory. Usage: $ ls [Option] 1. $ ls: directly enter the ls command to list all files and directories in the current directory, without displaying detailed information, such as type, size, and date permissions. 2. $ ls-l option. One record is displayed in each line and the file and directory information is displayed in a long list, including file type, size, modification date and time, permissions, users and groups. If the following content is displayed: drwxr-xr-x 2 userName groupName 4096 Sep 18 too topdrwxr-xr-x 2 userName groupName 4096 Jul 2 Documentsdrwxr-xr-x 2 userName groupName 4096 Jul 2 Downloads-rw- rw-r -- 1 userName groupName 0 Sep 18 hello.txt the output line above has 7 fields, each field has a different meaning: Field 1: file type and permissions. The first character indicates the file type. The specific conditions include: d: Directory;-: common file; s: Socket file; l: the link file rwxr-xr-x indicates the permission of the file. Field 2: Number of links. 1 indicates that only one file is linked to this file. Field 3: Owner field 4: User Group Field 5: file size, unit byte field 6: file Last modified Date Field 7: File Name 3. the $ ls-lh option displays the file size in a regular format, such as drwxr-xr-x 2 lipan 4.0 K Sep 18 Desktop 4. $ ls-F option, will use different special characters to categorize different file types init/linux-sound-base/ufw/klibc-P2s_k-gf23VtrGgO2_4pGkQgwMY.so * lsb/x86_64-linux-gnu/libcryptsetup. so.4 @ modprobe. d/xtables/hello.txt/: indicates the directory @: indicates the link file *: indicates the executable file does not exist: indicates the normal file 5. $ ls-R option, recursively listing the content of a directory 6. the $ ls-ls option lists the files and directories (in descending order) in the long list format. $ ls-a option will list all files and directories, including ". "(current directory) and" .. "(parent directory) 8. $ ls-A option to list all files and directories including hidden files or directories, excluding ". "(current directory) and" .. "(parent directory) 9. $ ls-n option. output is similar to-l option, but uid and gid are used instead of owner and user group.

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: info-contact@alibabacloud.com 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.