Difference between revisions of "Ls"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 22: Line 22:
 
== Flags ==
 
== Flags ==
 
<code>-F</code> appends symbols to filenames. These symbols show useful information about files.<ref>https://unix.stackexchange.com/questions/82357/what-do-the-symbols-displayed-by-ls-f-mean</ref>
 
<code>-F</code> appends symbols to filenames. These symbols show useful information about files.<ref>https://unix.stackexchange.com/questions/82357/what-do-the-symbols-displayed-by-ls-f-mean</ref>
  @ means symbolic link (or that the file has extended attributes).
+
  @ means symbolic link (or that the file has [[extended attributes]]).
 
  * means executable.
 
  * means executable.
 
  = means socket.
 
  = means socket.

Revision as of 16:06, 13 August 2020

ls is a command to list files, directories and symbolic links in Linux and Unix-like operating systems include in the coreutils package in Ubuntu.


Linux Examples

  • ls
  • ll (alias from ls -laF)
    • ll -h
  • ls -l
  • ls -la
  • ls -lh
  • ls -lhaR
  • One line listing with sizes using ls and find: ls -ldh $(find /path/to/search/)
  • Sort by size:
    • ls -lhS
    • ls -lR | grep '^-' | sort -rnk5 (sort will not work if ls is used with -h)
    • Including full path: ls -ld $(find ./) | sort -rnk5 | more
-su: /bin/ls: Argument list too long
-d list directories themselves, not their contents

Flags

-F appends symbols to filenames. These symbols show useful information about files.[1]

@ means symbolic link (or that the file has extended attributes).
* means executable.
= means socket.
| means named pipe.
> means door.
/ means directory.

Related terms

See also

  • https://unix.stackexchange.com/questions/82357/what-do-the-symbols-displayed-by-ls-f-mean
  • Advertising: