Linux can use the "ls" command to view the directory. The ls command is the abbreviation of "list" and is applicable to all user permissions. Its main function is to display directory files in list form. The syntax is "ls option directory name".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
What is the command to view directories in Linux
The command to view files and directories in Linux is: LS
LS English Original meaning: list, the path where the command is located: /bin/ls, applicable to all user permissions, the main function is to display directory files in list form.
The syntax: ls option [-ald][file or directory]
Among them,
-a displays all files, including hidden files;
-l Detailed information display;
-d Only displays the directory name, not the content list under the directory;
-h Humanized display (hommization);
-i View the i node of any file (similar to the unique information of an ID card);
-t Sort by the change time of files and directories; you can use the first displayed file to determine the most recently modified file;
Note: Beginning with . Unless the file is a directory, it is a hidden file
##Extension information: Create directory command: mkdir, original English meaning: make directories, command path: /bin/mkdir, applicable to all user permissions, is used to create new directories. The syntax: mkdir [-p][directory name]-p Recursive creationExample: a) Create a single directory: mkdir /tmp/vae.txtb) Create multiple directories: mkdir /tmp/a.txt /tmp/b.txt Notes when using:1. The created directory already exists, then Linux will prompt us that Linux cannot create it. 2. Running the mkdir command without any parameters will create a directory in the current directory. 3. Without -p, it is wrong to say that if the upper-level directory of the newly created file does not exist, it will not be executed successfully. With or without -p, the previous directories will be created sequentially. 4. The first condition for creating a directory is that you must have access permissions in the target path where you want to create the directory. Related recommendations: "Linux Video 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!