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
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
-
- Posts: 434
- Joined: 2008-01-08 21:23
- Location: Ottawa, Canada
Re: How to copy files whilst stripping the first directory off
How about:
This will copy the /lost+found/1600056/iptables directory to a new directory also called iptables in the /new/disk/mount/point directory.
Code: Select all
cd /lost+found/1600056
cp -a iptables/ /new/disk/mount/point
Peace,
Rich
Rich