user1815498
user1815498

Reputation: 1287

Partial directory list in linux

If I have a directory containing hundreds of files, using ls, ls-l, or dir gives me a list that's too long for the command terminal screen, so I'm unable to see most of the files in the directory.

I recall there being some argument for ls that allows one to scroll through the list in short increments, but can't seem to find it.

Upvotes: 9

Views: 4572

Answers (3)

sampson-chen
sampson-chen

Reputation: 47357

One more way is to redirect the output of ls into a temporary file and then view that file with any editor of your choice - that way you can do searches etc. as well:

ls > res.tmp
vim res.tmp
emacs res.tmp
gedit res.tmp
grep "pattern" res.tmp

Upvotes: 0

Henrik Kjus Alstad
Henrik Kjus Alstad

Reputation: 674

One option is to pipe the output to less or more

ls | less

or

ls | more

Upvotes: 10

Gilles Quénot
Gilles Quénot

Reputation: 185600

Try doing this in a :

ls -1 | less

Upvotes: 1

Related Questions