copying files

Peter da Silva peter at ficc.ferranti.com
Sat Dec 8 09:29:39 AEST 1990


In article <1990Dec5.224655.29706 at informix.com> dberg at informix.com (David I. Berg) 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 .[a-zA-Z1-9]*

% touch .,
% ls .[a-zA-Z1-9]*
% ls -a
.
..
.,
%

I'm not sure what the original poster meant to ask. I assume it was "how to
list all files but . and ..". We've had flame wars about this before. I think
something like ".[^.]*" will work. If you're not sure the safest thing to do
is...

% ls -ad | sed -e '/^\.$/d' -e '/^\.\.$/d'
.,
%

In practice, I find that ".??*" is the quickest pattern to type that gets
most of them.
-- 
Peter da Silva.   `-_-'
+1 713 274 5180.   'U`
peter at ferranti.com 



More information about the Comp.unix.shell mailing list