Re: help with ls
Eric Koldeweij <[email protected]>
| Newsgroups | gmane.linux.redhat.release.enigma |
|---|---|
| Message-ID | <[email protected]> |
Don't use ls in this case. Second, using "*.conf" in grep doesn't work
the way you want it.
Try this:
find / -type f \( -name "*.conf" -o -name "*.cfg" \) -print
or, if you want to have an ls -ls listing for each file, do:
find / -type f \( -name "*.conf" -o -name "*.cfg" \) -exec ls -ls {} \;
I suggest getting very familiar with the "find" command. It's syntax is
difficult but it is an extremely powerful tool and it can do almost
anything short of frying an egg ;)
Eric.
Jon Miller wrote:
>I need to do a listing using either ll or ls that can allow me to lsit files in all directories and subdirectories.
>I've tried the following:
>ls -lsr / * | grep *.conf and this give me a listing but with the path and I need that info.
>Also can I have more than 1 grep on the same command line? eg if I want listing for both .cfg and .conf.
>
>