Ls: Difference between revisions
From Leechfinger
Jump to navigationJump to search
Leechfinger (talk | contribs) No edit summary |
Leechfinger (talk | contribs) No edit summary |
||
Line 24: | Line 24: | ||
./hello | ./hello | ||
$ find . -maxdepth 1 -type f -inum 175965192 -delete | $ find . -maxdepth 1 -type f -inum 175965192 -delete | ||
$ ls -i | |||
$ | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Commands]] | [[Category:Commands]] |
Revision as of 18:30, 3 May 2025
"ls" is the list directory command, below are some of the flags we normally use.
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
Delete files using inode
$ ls -i
175965192 hello
$ find . -maxdepth 1 -type f -inum 175965192
./hello
$ find . -maxdepth 1 -type f -inum 175965192 -delete
$ ls -i
$