Skip to content

Latest commit

 

History

History
88 lines (78 loc) · 1.89 KB

README.md

File metadata and controls

88 lines (78 loc) · 1.89 KB

ls

list storage


Description

List information about the FILE(s) of the current directory. It sorts the files alphabetically if tags are not specified.

Syntax

ls [OPTIONS/FlAGS] [FILE]

Options/Flags

  • List files one per line.

    $ ls -1
  • List all files, including hidden files.

    $ ls -a
  • List all files in long listing format.

    $ ls -l
  • List all files with trailing directory names and indicating what type files are by putting a slash after directories and a star after executable files

    $ ls -F
  • List all files with long format, permissions, ownership, size and modification date of all files.

    $ ls - la
  • Long formated list sorted by size in descending order.

    $ ls -lS
  • Long formated list sorted by modification date, oldest being first of all files.

    $ ls - ltr
  • List files with size displayed using human-readable units such as KiB, MiB, GiB.

    $ ls -h
  • List directories only.

    $ ls -d */
  • List file entries by column.

    $ ls -C
  • List files with their respective index number.

    $ ls -i

    OR

    $ ls --inode
  • List files by sorting with respect to time, newest first.

    $ ls -t

Exit Status

  • 0 = OK
  • 1 = Minor problem --> can't access a directory/file.
  • 2 = Major problem --> can't access command line arguments.

Author

  • Richard M. Stallman
  • David MacKenzie.

Copyright

Copyright © 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later. This is free software, you are free to change and redistribute the information. There is NO WARRANTY, to the extent permitted by law.