Skip to content

ll MacOS Command Guide

The ll command in MacOS is a shortcut for the ls -l command, which is used to display detailed information about files in a directory. This command provides a list of files along with their permissions, owner, group, size, modification date, and name. By using the ll command, you can quickly view important details about files without having to use multiple commands. This can help you easily identify specific files, track their permissions, and manage your directory more effectively. By mastering the ll command, you can streamline your file management tasks and improve your overall efficiency when working in the MacOS terminal.

ll Syntax:

Terminal window
ll [option] [parameter]

Options:

OptionDescription
-lList in long format
-aList all entries including hidden files
-hHuman-readable format
-tSort by modification time
-rReverse the order of the list
-SSort by file size
-RRecursive list
-GEnable colorized output
-dList directory entries themselves
-FAppend indicator characters to entries

Parameters:

ParameterDescription
filenameThe name of the file or directory to be listed

ll Command Samples:

List files in long format

Terminal window
ll -l

Displays a detailed list of files in the current directory.

List all files including hidden files

Terminal window
ll -a

Lists all files in the current directory, including hidden files.

Sort files by modification time

Terminal window
ll -t

Displays files in the current directory sorted by modification time with the most recently modified files listed first.

Display inode number for each file

Terminal window
ll -i

Shows the inode number for each file in the current directory.

Use a specific format to display file information

Terminal window
ll -F

Displays file information in a specified format, indicating file types with special symbols.

Display sizes in human-readable format

Terminal window
ll -h

Shows file sizes in a human-readable format such as kilobytes or megabytes.

Combine multiple options for detailed information

Terminal window
ll -lah

Combines options to display a detailed list of all files in the directory, including hidden files, with human-readable sizes.

How do I use ll in MacOS?

To use the ll command in MacOS, execute the following command:

Terminal window
ll -l

What are the different options I can use with ll in MacOS?

The ll command in MacOS supports various options such as displaying hidden files, sorting by size or time, and showing sizes in human-readable format. Example:

Terminal window
ll -aS

How can I list directories in a tree-like structure using ll in MacOS?

You can display directories in a tree-like structure by using the tree command along with ll in MacOS. Example:

Terminal window
tree -L 2 | ll

How can I view only specific file types using ll in MacOS?

To view only specific file types, you can filter the output using the grep command with ll in MacOS. Example:

Terminal window
ll | grep ".txt"

How do I sort the output by modification time using ll in MacOS?

You can sort the output by modification time in descending order by using the t option with ll in MacOS. Example:

Terminal window
ll -lt

How can I view file permissions in symbolic mode using ll in MacOS?

To display file permissions in symbolic mode, you can use the ll command with the symbolic option in MacOS. Example:

Terminal window
ll -l@

Applications of the ll command

  • Quickly view file permissions
  • View file ownership
  • View file size
  • View last modification date and time
  • Identify symbolic links
  • Easily see hidden files
  • Sort files by various criteria