0% found this document useful (0 votes)
2 views

some unix command

The ls command in Unix/Linux lists files and directories, providing details such as permissions, sizes, and timestamps. The detailed listing option (-l) offers extensive information about each file, while the -a option shows hidden files and -lh presents sizes in a human-readable format. The command 'ls -alh' combines these features to display all files with detailed, easily understandable information.

Uploaded by

Robert Renner
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

some unix command

The ls command in Unix/Linux lists files and directories, providing details such as permissions, sizes, and timestamps. The detailed listing option (-l) offers extensive information about each file, while the -a option shows hidden files and -lh presents sizes in a human-readable format. The command 'ls -alh' combines these features to display all files with detailed, easily understandable information.

Uploaded by

Robert Renner
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

ls command

The ls command in Unix/Linux is used to list files and directories in the current
working directory or a specified directory.

It provides information such as file names, directories, and optionally file


permissions, sizes, and timestamps.

-----Detailed Listing (-l):

Lists files in a long format, providing detailed information such as:

File permissions: Access rights for the file.

Number of links: Number of hard links to the file.

Owner: The user who owns the file.

Group: The group that owns the file.

File size: Size of the file in bytes.

Timestamp: The last modification time of the file.

Filename: The name of the file or directory

Examples:

drwxr-xr-x 2 user group 4096 Sep 19 10:30 folder1

-rw-r--r-- 1 user group 123 Sep 19 10:30 file1.txt

-----Show Hidden Files (-a):

-----List in Human-Readable Format (-lh):

---Lists files in a human-readable format,

showing file sizes in KB, MB, or GB rather than in bytes.

Example:

-rw-r--r-- 1 user group 1.2M Sep 19 10:30 largefile.log

-----Sorting by File Size (-lS):

-----ls -alh: This command will:

1. List all files (including hidden ones).


2. Show detailed information in human-readable format (KB, MB, GB).

You might also like