February 12, 2012

Can you pause the ls command?

When you have a large directory, how do you get "ls" to pause. I could not find any options to do this.

Why not just scroll up and down with: SHIFT + PgUP/pgDOWN ?...

Why not just scroll up and down with: SHIFT + PgUP/pgDOWN ?

You could redirect the output to a file as well:
ls > output_file

Like  (4 likes)

Pipe the output through a pager. If you have the PAGER variable defined, use:...

Pipe the output through a pager. If you have the PAGER variable defined, use:
ls | "$PAGER"
If not, use either less or more:

ls | more
ls | less
Like  (5 likes)

ls -l | more

ls -l | more

Like  (0 likes)

Try this: ls | less

Try this:

ls | less

Like  (0 likes)

In the command prompt type:...

In the command prompt type:

#ls | less

This will force ls to list content one screen-section at a time.

Like  (0 likes)

ls | more

ls | more

Like  (0 likes)

Hey Charles,...

Hey Charles,
You can certainly "pause" the ls command. All you have to do is use ls in conjunction with the less command. So for example you'd type "ls | less" without the quotes. Also to create the | symbol (pipe) just hold shift and hit the key above enter. You can also look at my site for a little more information about ls and various other commands. www.cmdlist.com

Hope this helps,
Adam

Like  (0 likes)

try this "ls -l |more"

try this "ls -l |more"

Like  (0 likes)

Add "|more" at end (without quotes)

Add "|more" at end (without quotes)

Like  (0 likes)

You can't pause it per say, however, you can pipe it through more/less...

You can't pause it per say, however, you can pipe it through more/less

Generally, I'll do a "ls | less"
This will allow you to essentially "pause" the output, scroll through it, and even perform a search if necessary.

Hope that helps!

Like  (0 likes)

Pages

Click Here!