Why doesn't "ls -dlR" work?

Why doesn't "ls -dlR" work?

Post by Joshua Rehm » Sat, 20 Aug 1994 03:30:52



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?

----

 
 
 

Why doesn't "ls -dlR" work?

Post by da.. » Sat, 20 Aug 1994 11:41:20



Quote:>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 requires an argument, which is the directory you do not
wish to see the contents of.

d.

--
"If I thought my answer were to one who might ever return to the world,
this flame would shake no more; but since from this depth none have ever
returned alive, I answer you without fear of infamy."  
from Dante's _The Inferno_, XXVII, ll. 61-66.

 
 
 

Why doesn't "ls -dlR" work?

Post by Allen R Spar » Tue, 23 Aug 1994 14:23:01


    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

 
 
 

Why doesn't "ls -dlR" work?

Post by Egil Bj|r » Tue, 23 Aug 1994 20:30:10




>    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).

Try: find / -type d -exec ls -ld {} \; > file_name

This will do a ls -ld on every directory (including subdirectories)  
--
Egil Bj?rgo                          Phone: +47-51606548
ESSO Norge AS                        Fax:   +47-51606660

N-4033 Forus, Norway

 
 
 

1. Why doesn't echo "text" 'command' "more text" work?

                 ^                                        ^
Wrong quotes, should be -
   echo "You have" `grep Subject: /usr/spool/mail/me | wc -l` "messages."
or -
   echo "You have `grep Subject: /usr/spool/mail/me | wc -l` messages."

But, another problem is, if you've no mail, /usr/spool/mail/me does not
exist, leading grep to say:
   grep: can't open /usr/spool/mail/me
Wc will still report 0.

You might try -
   sh -c 'echo "You have `grep 2>/dev/null Subject: /usr/spool/mail/me | wc -l` messages."'

Hope this helps.

2. malloc() in signal handler

3. Satelite 4060 XCDT Installation of redhat 6.0

4. FTP works, but "ls" or "dir" doesn't ???

5. problem with 'Set G3 cache'

6. nslookup "ls" command doesn't work

7. Linux as ROUTER: info requested

8. wu-ftpd "ls" doesn't work with anonymous?

9. "ls" doesn't work properly on ftp

10. "ls" doesn't works for anonymous?

11. anonymous ftp, why is "ls" working and why not?