copying files

Bruce R. Larson ires at kaspar.UUCP
Sun Dec 9 13:15:35 AEST 1990


In article <1990Dec6.230153.14856 at wpi.WPI.EDU>, fenn at wpi.WPI.EDU (Brian Fennell) writes:
> In article <169 at raysnec.UUCP> shwake at raysnec.UUCP (Ray Shwake) writes:
> >rouben at math13.math.umbc.edu (Rouben Rostamian) writes:
> >
> >>In article <1990Dec5.021951.28104 at en.ecn.purdue.edu> nichols at en.ecn.purdue.edu (Scott P Nichols) writes:
> >>|
> >>|Do any of you UNIX wizards know how to even list all of
> >>|the names of the files which begin '.' (besides, of course
> >>|the files in the root (second line of list) 
> >>|
> 
> ls -dal `ls -da .* | grep -v '^\.$' | grep -v '^\.\.$' `
> 
> sheeeeeesh

Are you guys still talking about this?  Sheeeesh indeed!

Sorry Brian, but did you try your solution?  It lists both `.' and `..'.



The fellow who suggested `ls -ld .*' gave the best non-pipe solution to date.
You can get rid of the `.' entry by listing filenames with at least 2 chars.

   ls -ld .?*

The only undesirable entry remaining is `..'.


If you absolutely *have* to get rid of the `..' you can do this:

    /bin/ls -ld .?* | grep -v ' \.\.$'

[NOTE:  Use /bin/ls or equivalent to avoid aliased ls's and locally
        modified ls's.]

If we don't put this one rest soon we'll start getting awk and perl and
who-knows-what-else solutions.

B



More information about the Comp.unix.shell mailing list