DocumentThe ls command is used in Linux/Ubuntu to view the files in the selected directory and list the sub-directories in the current directory. It is a frequently used command in Linux/Ubuntu, it is also a very basic command. This command is used in many operations, unless you can memorize all the files on the disk and know which files and folders are in the directory, in this way, you don't need to learn this command. :) For a Linux User, if the ls command is also unknown, I personally think it cannot be a Linux User.
Ls
Format: ls [parameter] [file/directory]
Parameter description:
-A indicates listing all files, including hidden files starting "."
-D if the directory is followed by a directory, only the directory name is output.
-L indicates listing the object entries, including the Object Name, permission, owner, size, and last modification time.
-T indicates that the listed entries are sorted by the last modification time. By default, folders are sorted by name.
-C: vertically sort by column by file name
-F adds a symbol after the file name to indicate the file type
Below I will give you a few examples to illustrate:
This is the difference between ls and ls-a. If ls-a is used for viewing, You can see hidden files starting ".".
We can see that the properties of the folder upload.tar.gz under the current directory are displayed by ls-l.
The subdirectory in the current directory is followed by a slash "/"