Editing Ls

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{lowercase}}
 
 
<code>[[wikipedia:ls|ls]]</code> is a command to list files, [[directories]] and [[symbolic links]] in [[Linux]] and Unix-like operating systems include in the <code>[[coreutils]]</code> package in Ubuntu.
 
<code>[[wikipedia:ls|ls]]</code> is a command to list files, [[directories]] and [[symbolic links]] in [[Linux]] and Unix-like operating systems include in the <code>[[coreutils]]</code> package in Ubuntu.
 
* Man page: http://man7.org/linux/man-pages/man1/ls.1.html
 
* Man page: http://man7.org/linux/man-pages/man1/ls.1.html
Line 6: Line 5:
 
== Linux Examples ==
 
== Linux Examples ==
 
* <code>ls</code>
 
* <code>ls</code>
* <code>ll</code> ([[alias]] from <code>ls -laF</code>)
 
** <code>ll -h</code>
 
 
* <code>ls -l</code>
 
* <code>ls -l</code>
* <code>[[ls -la]]</code>
 
 
* <code>ls -lh</code>
 
* <code>ls -lh</code>
* <code>[[ls -lhaR]]</code>
+
* <code>ls -lhaR</code>
 
* One line listing with sizes using ls and find: <code>[[ls]] -ldh $([[find]] /path/to/search/)</code>
 
* 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 -lhS</code>
+
** <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)
+
** Including full path: <code>ls -ld $([[find]] ./) | sort -rnk5</code>
** Including full path: <code>ls -ld $([[find]] ./) | [[sort]] -rnk5 | more</code>
 
 
:::-su: /bin/ls: Argument list too long
 
:::-su: /bin/ls: Argument list too long
::: -d list directories themselves, not their contents
 
* <code>ls -i</code> ([[inode]])
 
* <code>[[ls -1]]</code>
 
* <code>ls | xargs</code>
 
  
== Flags ==
+
== Related commands ==
<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 executable.
 
= means socket.
 
| means named pipe.
 
> means door.
 
/ means directory.
 
 
 
== Related terms ==
 
* [[No space left on device]]
 
 
* <code>[[find]]</code>
 
* <code>[[find]]</code>
 
* <code>[[du]]</code>
 
* <code>[[du]]</code>
 
* <code>[[df]]</code>
 
* <code>[[df]]</code>
* <code>[[chown]]</code>,  <code>[[chgrp]]</code>
+
 
* [[MinIO]]: <code>[[mc ls]]</code>
 
* <code>[[lscpu]], [[lsusb]], [[lspci]], [[lshw]], [[lsmem]], [[lspci]]</code>
 
* [[Superblock]]
 
* [[nvm ls]]
 
* <code>[[lsdir]]</code> [[alias]]
 
  
 
== See also ==
 
== See also ==
* {{ls}}
 
 
* {{Linux filesystem commands}}
 
* {{Linux filesystem commands}}
* {{Linux Commands privileges}}
 
 
* {{du}}
 
* {{du}}
  
 
[[Category:Linux commands]]
 
[[Category:Linux commands]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: