Home  >  Article  >  Operation and Maintenance  >  How to view directory in linux

How to view directory in linux

尚
Original
2019-12-30 16:54:159915browse

How to view directory in linux

The command to view files and directories in Linux is: LS

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

Syntax

ls [-alrtAFR] [name...]

Parameters:

-a Display all files and directories (ls defaults to file names or directory names starting with "." Treated as hidden files and will not be listed)

-l In addition to the file name, the file type, permissions, owner, file size and other information are also listed in detail

-r Files are displayed in reverse order (originally in English alphabetical order)

-t List files in order of creation time

-A Same as -a, but do not list "." (Current directory) and ".." (parent directory)

-F Add a symbol after the listed file name; for example, add "*" for executable files and "/"## for directories.

#-R If there are files in the directory, the following files will also be listed in sequence

Example

List all files under the root directory (\) 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

Recommended related articles and tutorials:

linux tutorial

The above is the detailed content of How to view directory in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn