Difference between revisions of "Ls"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
* <code>ls</code> | * <code>ls</code> | ||
* <code>ls -lhaR</code> | * <code>ls -lhaR</code> | ||
− | * One line listing with sizes using ls and find: <code>[[ls]] -ldh $([[ | + | * One line listing with sizes using ls and find: <code>[[ls]] -ldh $([[find]] /path/to/search/)</code> |
* Sort by size: | * Sort by size: | ||
** <code>ls -lR | grep '^-' | sort -rnk5</code> (sort will not work if ls is used with -h) | ** <code>ls -lR | grep '^-' | sort -rnk5</code> (sort will not work if ls is used with -h) |
Revision as of 07:47, 7 January 2020
ls
is a command to list computer files in Linux and Unix and Unix-like operating systems.
Linux Examples
ls
ls -lhaR
- One line listing with sizes using ls and find:
ls -ldh $(find /path/to/search/)
- Sort by size:
ls -lR | grep '^-' | sort -rnk5
(sort will not work if ls is used with -h)- Including full path:
ls -ldh $(find ./) | sort -rnk5
Related commands
See also
Advertising: