Re: [expert] * does not select all files

2001-08-14 Thread Larry Alkoff

I have noticed that cp -a not only will copy hidden files but
the -a causes it to act differently than any other form of cp.

The man page says cp -a is the equivalent of cp -dpR but it is not at all the same.

For one thing, cp -a copies the .hidden files.

For another, any other form of cp would use a command line like:
cp source_dir/  target_dir/  where target_dir has been already created.

If you do the same with cp -a you will end up with a target_dir that is empty
except for a subdirectory that has the same name as the source_dir!
This is completely different than I have ever seen cp act.

The way to copy all files in a tree is to use the command:
cp -a source_dir  target_dir
where target_dir has NOT been created yet.
Then cp -a will create the target_dir and recursively copy all files including .hidden 
ones.

Note that I always use
\cp -a source_dir  target_dir
where the \ in front of cp defeats any options you may have in a cp alias.

In fact my cp is aliased to cp -ipdv
to preserve any links and also to preserve the date-time and other attributes
of the copied file - otherwise it's very confusing when your copy has the current date 
and time.

The above is just some stuff I had to figure out on my own because the cp command
acts differently in a non-intutive way depending on the options
and is very non-intutive when by default it creates a copy with the current date and 
time.

Larry Alkoff N2LA



Larry Alkoff N2LA - Austin TX





Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com



Re: [expert] * does not select all files

2001-08-14 Thread DM

another way to copy ALL files as well as permissions
on a directory to another (besides those already
mentioned by other listers) is to use 'tar':

cd /directory_to_copy
tar cf - . | (cd /directory_to_put_the_files; tar xpf
- ) 

what is your program trying to do anyway? just moving
files? 


--- George Petri [EMAIL PROTECTED] wrote:
 Hi!
 
 Does anyone know why * misses hidden files such as
 .kderc?
 What is the reasoning for that?
 
 I mean to select ALL files, now I have to specify
 (in bash, of course):
 
 * *.[a-zA-Z]
 
 to my programs e.g. cp * *.[a-zA-Z] /somefolder.
 
 It is also a pain to type!  Is there a better way to
 select ALL files?
 
 Thanks,
 George
 
 -- 
 
 9:52pm  up 25 min   2 users,  load average: 27.65,
 51.29, 28.79
  (now loading 40 khexedit's on a Pentium
 II...)
 
 
 
  Want to buy your Pack or Services from
MandrakeSoft?
 
 Go to http://.mandrakestore.com
 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com



Re: [expert] * does not select all files

2001-08-13 Thread George Petri


- Original Message - 
From: Gregor Maier [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, August 14, 2001 12:08 AM
Subject: RE: [expert] * does not select all files


 
 On 13-Aug-2001 George Petri wrote:
  Hi!
  
  Does anyone know why * misses hidden files such as .kderc?
  What is the reasoning for that?
  
  I mean to select ALL files, now I have to specify (in bash, of course):
  
  * *.[a-zA-Z]
  
  to my programs e.g. cp * *.[a-zA-Z] /somefolder.
  
  It is also a pain to type!  Is there a better way to select ALL files?
  
 
 cp .* * /somefolder should work
 

But doesn't .* also select .. as well?
I once did chmod -R root.root .* * and ended up changing the ownership of
the parent directory which was not the desired effect.

Thanks,
george





Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com



Re: [expert] * does not select all files

2001-08-13 Thread root

On Monday 13 August 2001 09:42, George Petri wrote:
 Hi!

 Does anyone know why * misses hidden files such as .kderc?
 What is the reasoning for that?

 I mean to select ALL files, now I have to specify (in bash, of course):

 * *.[a-zA-Z]

 to my programs e.g. cp * *.[a-zA-Z] /somefolder.

 It is also a pain to type!  Is there a better way to select ALL files?

 Thanks,
 George


Content-Type: text/plain; charset=iso-8859-1; name=message.footer
Content-Transfer-Encoding: 8bit
Content-Description: 


try echo .[^.]* * and you will see that gives you all the files except . 
and ..

-- 
Gerard Perreault
[EMAIL PROTECTED]



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com



RE: [expert] * does not select all files

2001-08-13 Thread Gregor Maier


On 13-Aug-2001 George Petri wrote:
 Hi!
 
 Does anyone know why * misses hidden files such as .kderc?
 What is the reasoning for that?
 
 I mean to select ALL files, now I have to specify (in bash, of course):
 
 * *.[a-zA-Z]
 
 to my programs e.g. cp * *.[a-zA-Z] /somefolder.
 
 It is also a pain to type!  Is there a better way to select ALL files?
 

cp .* * /somefolder should work


--
E-Mail: Gregor Maier [EMAIL PROTECTED]
Date: 13-Aug-2001
Time: 16:07:04
--



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com



Re: [expert] * does not select all files

2001-08-13 Thread root

I take that back, files starting with 2 dots would still be hidded. The only 
way is to do it is:

echo .[^.]* ..[^.]* ...* *

Try it. Create these files

.bozo
..bozo
...bozo
bozo


and you will see that displays them all, but does not display . and ..
-- 
Gerard Perreault
[EMAIL PROTECTED]



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com



Re: [expert] * does not select all files

2001-08-13 Thread Ric Tibbetts

Or, try:

cp -a .??* destination

Ric



*** REPLY SEPARATOR  ***

On 8/13/2001 at 12:39 PM root wrote:

I take that back, files starting with 2 dots would still be hidded. The
only 
way is to do it is:

echo .[^.]* ..[^.]* ...* *

Try it. Create these files

.bozo
..bozo
...bozo
bozo


and you will see that displays them all, but does not display . and ..
-- 
Gerard Perreault
[EMAIL PROTECTED]


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com






Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com



Re: [expert] * does not select all files

2001-08-13 Thread civileme

On Monday 13 August 2001 12:26, root wrote:
 On Monday 13 August 2001 09:42, George Petri wrote:
  Hi!
 
  Does anyone know why * misses hidden files such as .kderc?
  What is the reasoning for that?
 
  I mean to select ALL files, now I have to specify (in bash, of course):
 
  * *.[a-zA-Z]
 
  to my programs e.g. cp * *.[a-zA-Z] /somefolder.
 
  It is also a pain to type!  Is there a better way to select ALL files?
 
  Thanks,
  George


 try echo .[^.]* * and you will see that gives you all the files except .
 and ..

Hmmm, I always use 

cp -a  to preserve links and such.

Civileme



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com



Re: [expert] * does not select all files

2001-08-13 Thread root

On Monday 13 August 2001 18:45, civileme wrote:
 On Monday 13 August 2001 12:26, root wrote:
  On Monday 13 August 2001 09:42, George Petri wrote:
   Hi!
  
   Does anyone know why * misses hidden files such as .kderc?
   What is the reasoning for that?
  
   I mean to select ALL files, now I have to specify (in bash, of course):
  
   * *.[a-zA-Z]
  
   to my programs e.g. cp * *.[a-zA-Z] /somefolder.
  
   It is also a pain to type!  Is there a better way to select ALL files?
  
   Thanks,
   George
 
  try echo .[^.]* * and you will see that gives you all the files except
  . and ..

 Hmmm, I always use

 cp -a  to preserve links and such.

 Civileme

That is good if you want to copy recursively all files but I think the 
question was how to reference all files in a directory. The cp was just an 
example he gave.

Here is another example:

for i in .[^.]* ..[^.]* ...* * ; do
  mv $i $i.old
done

This would rename everything (including directory names) to a name with the 
suffic .old. The only 2 files that would not be renamed would be . and .. 
This would not act recursively. If one wanted to do that, find would be 
better suited.

Thanks.
-- 
Gerard Perreault
[EMAIL PROTECTED]



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com



Re: [expert] * does not select all files

2001-08-13 Thread root

On Monday 13 August 2001 13:52, Ric Tibbetts wrote:
 Or, try:

 cp -a .??* destination

 Ric



 *** REPLY SEPARATOR  ***

 On 8/13/2001 at 12:39 PM root wrote:
 I take that back, files starting with 2 dots would still be hidded. The
 only
 way is to do it is:
 
 echo .[^.]* ..[^.]* ...* *
 
 Try it. Create these files
 
 .bozo
 ..bozo
 ...bozo
 bozo
 
 and you will see that displays them all, but does not display . and ..
 --
 Gerard Perreault
 [EMAIL PROTECTED]
 
 
 Want to buy your Pack or Services from MandrakeSoft?
 Go to http://.mandrakestore.com


Content-Type: text/plain; charset=us-ascii; name=message.footer
Content-Transfer-Encoding: 8bit
Content-Description: 


Sorry to disagree, but .??* would miss a filename like .X.

-- 
Gerard Perreault
[EMAIL PROTECTED]



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://.mandrakestore.com