I'm wonder if there is some way to list all files of a folder by ls, I know how to use ls for a folders which are small but if list of files doesn't match with the screen size what should I do? there is no scroll!
2 Answers
pipe it into more
:
ls -la | more
Then down arrow scrolls to the next line, spacebar jumps a page at a time
-
7Use
| less
instead; as opposed to traditional "more", that will also allow you to scroll backwards, search forwards and backwards and so on. Pressh
for help, and remember that less is more (on some releases of some Linux distros, "more" may actually be "less" by another name, but don't rely on that).– GabeNov 29, 2013 at 15:33 -
4When listing directories and using a pager such as
less
, you might want to try some of the options to make your browsing easier/more informative. I'm partial to/bin/ls -alFv --color=always | /usr/bin/less -iXRS
. Thels
options mean (respectively) show hidden files, show extended info, show punctuation to identify special files, sort numbers naturally, and show colors to identify file types. Theless
options mean (respectively) ignore case when searching, don't clear screen when done, preserve colors fromls
, and don't wrap long lines.– dg99Nov 30, 2013 at 1:00
more
is good, less
gives more scrolling options (up and down):
ls | less
If you want color:
ls --color=always | less -iXRS
Quit less
as if it were vi
, :q