Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use ls command in linux system

Shulou Source: shulou.com Published: 2022-06-02 01:11:01 09月23日 Update

This article will explain in detail how to use the ls command in linux system, Xiaobian thinks it is quite practical, so share it with you as a reference, I hope you can gain something after reading this article.

The ls command is the most commonly used command in linux. The ls command is short for list. By default ls prints a list of the current directory. If ls specifies another directory, it displays a list of files and folders in the specified directory.

Through the ls command you can not only view the files contained in the linux folder, but also view file permissions (including directories, folders, file permissions), view directory information, etc. The ls command is used in many daily linux operations.

1. Introduction to ls command

ls command format: ls [options] [directory name].

ls command function: List all subdirectories and files in the target directory.

Description of the parameter options of the ls command:

-a, lists all files in the directory, including files marked with. implicit file at the beginning

-l List file details

-t Sort by file modification time

-A, list except. and... Any item other than (hidden file)

-R, list all subdirectories at the same time (files, don't use this if you have a lot of files in your directory)

-S Sort by file size

-1 List only one file per line

-h Use "K","M","G" to display file and directory sizes.

This is the most common ls command.

About "how to use ls command in linux system" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.

Tags: File command directory folder article system information size subdirectory subdirectory that is commonly used more permissions list sort good practical useful content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Apple vpn Microsoft MariaDB