Home > Operation and Maintenance > Linux Operation and Maintenance > What is the command to view a directory in Linux?

What is the command to view a directory in Linux?

王林
Release: 2020-05-18 16:11:37
Original
5394 people have browsed it

What is the command to view a directory in Linux?

Under Linux, you can use the ls command to view the directory.

ls command can list all contents in the current directory.

The syntax format of the ls command is:

# ls  [-选项]  [文件名或者目录名]
Copy after login

In Linux, the ls command is one of the most commonly used commands, because the directory contents must be viewed at any time on the command line. If you do not add any options, the ls command only lists the files and directory names in the current directory. For example, if you want to view the contents of the /etc directory, you can use the following command:

# ls /etc
Copy after login

If you want to To list all files in the current directory, you can use the following command:

# ls -a
Copy after login

Recommended tutorial: linux tutorial

The above is the detailed content of What is the command to view a directory in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template