D> On the subject of "Why doesn't "ls -dlR" work?",
>> I am using csh and have been trying to get an overview of the
>> huge file structure that resides on my schools Sun box by using
>> "ls -dlR />some_file" and then viewing the file. But 2
>> switches don't seem to like each other: "R"ecursion and
>> "d"irectory name (do not list contents) only. Why doesn;t this
>> work?
D> -d requires an argument, which is the directory you do not
D> wish to see the contents of.
That's not entirely accurate. "-d" does not require, or accept an
argument. It's simply another modifier which tells "ls" how to
present it's output.
It's just that both switches are the exact opposite from each other.
Say we have a directory, called "my_directory". If we type
% ls -d my_directory
the output will be
my_directory
which isn't much use. If we type
% ls my_directory
w/o -d, output will be all the files inside that directory. Where the
"-d" switch comes in handy is:
Say we decide that we want to figure out the access permissions on a
directory. We might instinctively type
% ls -l my_directory
and what we get is the long listing of all the files in
"my_directory", but we're not any closer to determining the access
permissions of the directory file itself. But if we type
% ls -ld my_directory
we get the information we're looking for.
So the -d switch says DON'T list the contents of the directory, just
the directory file itself.
The -R switch says just the opposite. Not only does it ask for a
listing of the contents of the directories encountered, but a listing
of all sub-directories under that directory. -dR contradict each
other.
Oh yeah, if you can find a decent book to explain it (not a man page)
check out the "find" command. It's very handy, though the man page
didn't seem to help me learn how it worked (though it's handy as a
reference).
=== Al