Command line tools

ls

ls: list directory contents.

The ls command is used to list the contents of a directory. It is one of the most commonly used commands when working in the command line. The ls command can be used with various options to display different types of information about files and directories.

Examples

Linux/macOS

List the contents of the current directory:

ls

List the contents of a specific directory:

ls /path/to/directory

List the contents with more details (permissions, ownership, size, modification date):

ls -l

List all files, including hidden ones (starting with a dot):

ls -a

Combine options to list all files with details:

ls -la

List the contents with human-readable file sizes:

ls -lh

Windows (PowerShell)

PowerShell supports ls as an alias for its Get-ChildItem cmdlet. The behavior and options are somewhat different from Unix systems but provide similar functionality.

List files and directories:

ls

List all files, including hidden ones:

ls -Force

List all files with detailed information:

ls -Long

You can also use the Get-ChildItem cmdlet directly with similar options:

Get-ChildItem -Force
© 2024-2025 GitByBit.All rights reserved.

Hi! I'm Alex, creator of GitByBit.

And this is Gitopedia—a reference that summarizes knowledge in my Git course.

Gitopedia is designed to be a personal knowledge base. When you progress through the main Git course in VS Code, you unlock all of these topics, one by one, bit by bit. This gives you time to digest the information and gradually build the mental model of Git. Here's an example of how it works:

Learning directly in VS Code lets you practice Git exactly as you would in real life, doing real jobs, writing real code. In addition, the course has access to your actual terminal, so it can point out mistakes, suggest workarounds, etc.

The course is FREE, there are no Ads or other bullshit. There are optional premium add-ons you can purchase, mainly to support my work (regrettably, I have to eat every day), but that's totally up to you.

Learn Git in VS Code