ls output
David Henderson
dhenderson at digital-pipe.com
Thu May 12 14:26:54 UTC 2011
Gang, I'm working with the 'ls' command and noticed some inconsistencies
among the 'ls --help' and the generated output. I have a directory tree
that contains some hidden files so I modify the 'ls' commands to
show/hide them, however, the commands don't appear to be working
correctly. Here's the output of 'ls --help':
BusyBox v1.18.1 (2011-01-07 13:20:13 EST) multi-call binary.
Usage: ls [-1AacCdeFilnpLRrSsTtuvwxXhk] [FILE]...
List directory contents
Options:
-1 List in a single column
-A Don't list . and ..
-a Don't hide entries starting with .
-C List by columns
-c With -l: sort by ctime
--color[={always,never,auto}] Control coloring
-d List directory entries instead of contents
-e List full date and time
-F Append indicator (one of */=@|) to entries
-i List inode numbers
-l Long listing format
-n List numeric UIDs and GIDs instead of names
-p Append indicator (one of /=@|) to entries
-L List entries pointed to by symlinks
-R Recurse
-r Sort in reverse order
-S Sort by file size
-s List the size of each file, in blocks
-T N Assume tabstop every N columns
-t With -l: sort by modification time
-u With -l: sort by access time
-v Sort by version
-w N Assume the terminal is N columns wide
-x List by lines
-X Sort by extension
-h List sizes in human readable format (1K 243M 2G)
To show all of the files in a single column without showing the . and ..
directories, I would use 'ls -AR1', however the . and .. directories are
still showing up in the listing. Another problem I see when using this
combination is that hidden files are shown too. It appears as though
'-A' also shows hidden files, but that defeats the purpose of the '-a'
command. Bug perhaps? I was also wondering if the "--hide" command
would ever be introduced as it would add additional listing capabilities
without much additional code (at least I wouldn't think).
Dave
More information about the busybox
mailing list