Linux ls command details how to use Linux ls command

Source: Internet
Author: User
Tags parent directory

The Linux ls command is used to display the content in the specified working directory (list the files and subdirectories contained in the current working directory ).

Syntax

Ls [-alrtAFR] [name...]

Parameters:

  • -A: displays all files and directories. (if the file name or directory name starts with "." is specified in ls, it is regarded as a hidden file and will not be listed)
  • -L in addition to the file name, the file type, permission, owner, file size, and other information are listed in detail.
  • -R: Display files in reverse order (originally in alphabetical order)
  • -T list files in the order of creation time
  • -A is the same as-a, but does not list "." (Current Directory) and ".." (parent directory)
  • -F add a symbol after the name of the listed File. For example, add "*" to the executable file and add "/" to the directory "/"
  • -R if the directory contains files, the following files are listed in sequence.

Instance

List all directories under the root directory:

# Ls/

Bin dev lib media net root srv upload www

Boot etc lib64 misc opt sbin sys usr

Home lost + found mnt proc selinux tmp var

List all files whose names start with "s" in the current working directory:

Ls-ltr s *

List all the following directories and file details in the/bin directory:

Ls-lR/bin

List all files and directories in the current working directory. Add "/" After the directory name, and add "*" after the executable file name "*":

Ls-AF

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: 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.