Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to copy files whilst stripping the first directory off

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
g0itp1955
Posts: 5
Joined: 2010-01-05 15:46

How to copy files whilst stripping the first directory off

#1 Post by g0itp1955 »

HI,

I have had a problem with my hard disks causing the files and directories to be prefixed with a numerical directory in lost+found, I want to now copy these directories to a new disk but without the prefix;-

my old disk (hdd3) has for instance : #/lost+found/1600056/iptables/libipt_tos.so

I wish to copy it to /etc/iptables/libipt_tos.so in batch mode,

can anyone point me in the correct direction,

thanks

CreamFilledGiraffe
Posts: 434
Joined: 2008-01-08 21:23
Location: Ottawa, Canada

Re: How to copy files whilst stripping the first directory off

#2 Post by CreamFilledGiraffe »

How about:

Code: Select all

cd /lost+found/1600056
cp -a iptables/ /new/disk/mount/point
This will copy the /lost+found/1600056/iptables directory to a new directory also called iptables in the /new/disk/mount/point directory.
Peace,
Rich

Post Reply