Re: help with ls
Joseph A Nagy Jr <[email protected]>
| Newsgroups | gmane.linux.redhat.release.enigma |
|---|---|
| Message-ID | <[email protected]> |
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. ls * should do the job for ya. As you can see in this example: [janjr@jan-jr-ent gaming]$ ls * CRS831.pdf KODT02.exe KODT04.exe KODT06.exe KODT08.exe KODT01.exe KODT03.exe KODT05.exe KODT07.exe Read Me.txt Rifts: Benjamin.doc Rifts Character Sheets.sxc William Forrest.doc Dana - Sorcery Genius - Rifts Earth.sxc Rifts Character Sheet.sxw wolfs-son by alpha.doc James Americus Nation.doc sorcery-genius.doc Kuma - Earth Warlock - Rifts Earth.sxc sorcery-genius.sxw [janjr@jan-jr-ent gaming]$ ls * listed the contents of the dir I was in, then listed the contents of the subdir "Rifts", although: [janjr@jan-jr-ent gaming]$ ls * CRS831.pdf KODT02.exe KODT04.exe KODT06.exe KODT08.exe KODT01.exe KODT03.exe KODT05.exe KODT07.exe Read Me.txt Rifts: doc sxc sxw [janjr@jan-jr-ent gaming]$ It doesn't list the contents of sub-dirs. Perhaps find or whereis would be better suited to your needs Just cd to the dir and "pwd" will give you the path to the dir you're in. I don't know much about grep, but I'm sure "man grep" will have the info you need. -- Wielder of the mighty +1 LARTsaber of Unsubscribe, the +3 Clue-by-Four of No Attachments to a Mailing List, and the -4 Shield of No Spell Checker