Ls: Difference between revisions

From Leechfinger
Jump to navigationJump to search
Qais (talk | contribs)
No edit summary
Qais (talk | contribs)
No edit summary
Line 1: Line 1:
=== Show only directories ===
=== Show only directories ===
<syntaxhighlight lang="bash">$ ls -d */‎</syntaxhighlight>
<syntaxhighlight lang="bash">$ ls -d */‎</syntaxhighlight>
=== Don't show group and owner ===
<syntaxhighlight lang="bash">$ ls -lgo‎</syntaxhighlight>
=== Newest files first ===
=== Newest files first ===
<syntaxhighlight lang="bash">$ ls -lt</syntaxhighlight>
<syntaxhighlight lang="bash">$ ls -lt</syntaxhighlight>

Revision as of 17:43, 3 May 2025

Show only directories

$ ls -d */‎

Don't show group and owner

$ ls -lgo‎

Newest files first

$ ls -lt

File size and sort

$ ls -sSh

Show modification time

$ ls -lgot --time-style=long-iso

Sorting files by extension/version

$ ls -lgo --sort=extension 

// or sort by version 
$ ls -lgo --sort=version