Mailinglist Archive: opensuse (3337 mails)

< Previous Next >
Re: [SLE] The "cp" command is skipping files/dirs over nfs
  • From: Brad Bourn <brad@xxxxxxxxxxxx>
  • Date: Wed, 19 Apr 2006 11:11:22 -0600
  • Message-id: <200604191111.22387.brad@xxxxxxxxxxxx>
As you probably konw, you can capture any output (including stderr) to a file.
The best way I can think of for seeing it also, is to tail the capture file.

Like this

find . -name "biff*" > output.txt 2>&1

the ">" is the redirection operator, telling bash (or whatever) to redirect to
output.txt, then the "2>&1" tells bash (or whatever) to redirect stderr to
stdout. That way, you get everything in the output.txt file.

To be able to see the stuff as it is written to the file, call the command (on
different shell, or in foreground (use different shell if you don't yet
understand foreground and background jobs))

tail -f output.txt

tail is like less or more, accept that it shows the end of the file. Then the
-f switch tells it to stay active and spit out to the screen anything it sees
added to the file.

If the starting output is important to see, then you'll want to run the tail
command before the command you want to capture output from, but you will need
a file to exist for the tail command. You can create one very easy with the
same ">" redirect operator, like this

echo "This is the beginning of the file" > output.txt

so now you have a file you can [tail -f].

as a side note, the ">>" operator appends the file rather than replace the
contents. ">" by itself will zero out the file before it start outputting to

Hope this helps


On Wednesday 19 April 2006 10:59 am, James D. Parra wrote:
> Hello,
> Thank you for the helpful instructions.
> The progress output currently goes to the display, but is there a way to
> direct the progress output to a file for future review, as well as to the
> display? The problem is that I can only scull up so far on the monitor and
> I want to see which files were skipped early on during the copy.
> Many thanks.
> James
> -----Original Message-----
> From: Lawrence Bowie [mailto:thesource@xxxxxxxxxxx]
> Sent: Friday, October 14, 2005 7:23 PM
> To: James D. Parra
> Cc: Suse-Linux-E (E-mail)
> Subject: Re: [SLE] The "cp" command is skipping files/dirs over nfs
> Descend into the directory and execute ..
> (cd /mnt/oldserver && find . -depth | cpio -dvmp /usr/cvsroot)
> James D. Parra wrote:
> >> find /dir -depth | cpio -dvmp /new_dir
> >
> >>to recursively copy objects because it lets me know if something was NOT
> >>copied properly. I do not like cp either on UNIX or Linux because I run
> >>into issues like you have described every now and then.
> >
> > Thank you for the tip. I tried it, but I noticed something interesting;
> >
> > If I use, #find /mnt/oldserver/* -depth | cpio -dvmp /usr/cvsroot/
> >
> > I get a directory /usr/cvsroot/mnt/oldserver/, when what I need is to copy
> > the contents of /mnt/oldserver to /usr/cvsroot/, without the path, just
> the
> > identical contents.
> >
> > How can I modify your command to accomplish this?
> >
> > Thanks again,
> >
> > ~James
> >
> --
> Check the headers for your unsubscription address
> For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
> Also check the archives at
> Please read the FAQs: suse-linux-e-faq@xxxxxxxx

< Previous Next >