LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
Search this Thread
Old 12-30-2012, 03:45 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,149

Rep: Reputation: 46
How could I use cp and avoid stdout output (error messages)?


Hi:

When copying files (cp) to an NTFS partition, as is logical, I get something like 'Unable to preserve permissions'. OK. But writing to stdout is a slow process. How could I use cp and avoid stdout output? Perhaps redirecting stdout to stderr? Or to /dev/null? How do I do it?
 
Old 12-30-2012, 03:50 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,128

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
cp source destintation >/dev/null 2>/dev/null

would send both stdout and stderr to /dev/null -- could also be done with 2>&1 and then redirecting everything to /dev/null. Actually, since by default cp does not print to stdout, simply redirecting stderr to /dev/null would be sufficient.
 
Old 12-30-2012, 06:48 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
You also can tell cp not to preserve file attributes with the option --no-preserve=all
 
Old 12-30-2012, 02:05 PM   #4
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,149

Original Poster
Rep: Reputation: 46
Thanks guys. Very helpful information.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unreadable characters in error messages and man page output gangadher Linux - Newbie 9 08-24-2010 07:58 AM
init 3 ---> error output from wifi card is redirected to stdout koca Fedora 1 02-02-2007 08:01 AM
How to use torsmo to output X11 error messages? npc Linux - Software 0 06-17-2005 11:58 AM
outputting firewall messages to a file instead if stdout schatoor Linux - Networking 2 06-25-2004 11:40 AM
My usb spits out messages in stdout!! Meros Linux - Hardware 3 08-18-2002 10:06 AM


All times are GMT -5. The time now is 12:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration