[Novalug] question about ls
plarsen at famlarsen.homelinux.com
Mon Jan 16 11:40:09 EST 2012
On Mon, 2012-01-16 at 11:11 -0500, Nino R. Pereira wrote:
> On 01/16/2012 09:58 AM, Peter Larsen wrote:
> > On Mon, 2012-01-16 at 08:55 -0500, Nino R. Pereira wrote:
> >> Thanks to all who replied.
> >> I'm sorry to say that I mislead you. My command was not simply
> >> ls -l
> >> but it was
> >> ls -l cryst*
> > See - I knew something wasn't right :)
> yes ;-(
> > ls -dl cryst*
> this actually gives only the directory, not what's in it.
I thought that's what you wanted.
"ls" gives you just one level down - always. If you want better control,
$ find . -type f -print
And it shows you all the files from your current directory and down -
with path so you can easily tell the difference. If you want additional
conditions, find is your friend - ls is not.
> When I try to see if 'ls' has an option like tree, -L, I look
> in the man pages, but because these are so long I do
> man ls > temp
No such thing with ls.
> which gives me a file I want to search for '-L' with grep.
> But, this doesn't work because in the command
> cat temp | grep -L
Ouch - you shouldn't have to do it so complicated. Use find instead if
you want to really do crazy searches on your file names.
> grep thinks '-L' is an option, and when I do
> cat temp | grep '-L' (or even 'grep -i '-L')
> it isn't any better.
As it should be. Anything after grep and before a pipe or > < is a grep
> How do I get ls to tell me
> accounting orders quartz technical
As I pointed out, ls only prefixes if there are more than one option on
the command line (option being file/directory names).
Here's the output from my little test directory from yesterday:
[plarsen at boss crytals]$ find . -type f -print
Pretty clear what's what here. Note it doesn't show you empty
Wise words of the day:
NEVER RESPOND TO CRITICAL PRESS. IT IS A GAME YOU CAN ONLY LOSE, AND IT
MAKES US LOOK BAD.
-- Bruce Perens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://calypso.tux.org/pipermail/novalug/attachments/20120116/87ab17f7/attachment.bin
More information about the Novalug