Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - ls command under linux
ls command under linux

In Linux, the ls command is one of the most commonly used commands, used to list files and subdirectories in a directory. By using different options, you can obtain different forms of output. The following are some commonly used ls command options.

ls: Simply list the files and subdirectories in the current directory.

ls -l: Displays detailed information about files and subdirectories in a detailed list, including file permissions, owner, size, modification time, etc.

ls -a: Displays all files and subdirectories, including hidden files starting with .

ls -h: Displays the size of files and subdirectories in human-readable format.

ls -t: Sort by last modification time, the latest files or subdirectories will be displayed at the top.

ls -r: Display files and subdirectories in reverse order.

You can also use multiple options together, such as ls -l -a or ls -lhtr. Additionally, there are several other options available to further customize the output, you can view the full documentation of the ls command and learn more options and usage via the man

ls command.