Copied to clipboard

ls

ls is a commonly used command line instruction used to display a list of contents in a directory. It can also display detailed information about files and directories, such as file type, access permissions, owner, and more.

Example

  • ls: Show files and directories in the current directory.
  • ls -l: Show files and directories in the current directory with their attributes and permissions displayed in detail.
  • ls -a: Show all files and directories in the current directory, including hidden files and directories.
  • ls -al: Show all files and directories in the current directory, including hidden files and directories, with their attributes and permissions displayed in detail.
  • ls /path/to/directory: Show files and directories in the specified directory.
  • ls *.txt: Show all files in the current directory with the extension .txt.
  • ls -lh: Show files and directories in the current directory in a human-readable format, with file size displayed in bytes.