Complete.Org: Mailing Lists: Archives: linux-help: September 2000:
[linux-help] Re: ls
Home

[linux-help] Re: ls

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: linux-help@xxxxxxxxx
Subject: [linux-help] Re: ls
From: John Reinke <jmreinke@xxxxxxxxx>
Date: Sun, 3 Sep 2000 01:33:26 -0500
Reply-to: linux-help@xxxxxxxxx

Nathan wrote:
>>find . -name filename 2> /dev/null
>>
>>where the file name is the file you're looking for and the dot is the
>>cwd.
>
>The dot is the cwd?  What is cwd?

cwd is the Current (or Present) Working Directory. It's the directory you
are already in. You can use the pwd command to find the complete path of
where you are.

>What could I add to this command to make it give me one screen at a time,
>allowing me to hit a key when I'm ready to look at the next screen?
>
>DOS:  dir *.o /s /p

You can "pipe" output of a program to another program using the "|"
character on the command line, and treat it as if you are viewing a file.
You probably have the programs "less" and "more" installed on your computer
which can do this. Usually, "more" allows you to page through a file using
the space bar, and it quits when you get to the end. "less" does the same,
but you need to press the "q" key to quit. I subscribe to the "less is
more" philosophy, and always use less since it allows you to do other
things like scroll up and down throughout the file with arrow keys, search
it, and work with multiple files. Some versions of "more" allow this, too.
Type "man less" for more information. Ironically, "less" is probably the
pager used for displaying your man pages on Linux, so you might have been
using it already.

So, to be able to scroll through your results, type:
find . -name filename 2> /dev/null | less

Note the "|" character, often referred to as the pipe character. If you'd
like to try it using the "more" command, just substitute "more" for "less"
in the above line.

Have fun,
John

P.S. Reading the man pages for "find" (type "man find") will be very
helpful for finding files, and operating on the results, etc. It took me a
while to really discover and start using "find".



-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]