LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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: 4,442

Rep: Reputation: 76
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,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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: 4,442

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


Reply



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 qanopus 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

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 11:03 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration