Linked Questions

6
votes
2answers
309 views

Issue in Standard Output and Error [duplicate]

If I type cat > file.txt 2>&1 then file.txt is created with the content of cat's standard input.  But if I do cat > file.txt 1>&2 then file.txt is created, but the file is ...
2
votes
1answer
4k views

Redirecting Standard Output And Standard Error to One File [duplicate]

I have come to understand that we have two methods of redirecting both stdout and stderr to the same file. The first method is: ls -l /bin > ls-output.txt 2>&1 As the author of this book ...
0
votes
2answers
2k views

Redirection using file descriptors - specific example [duplicate]

I am reading this documentation which gives the following examples about redirection and file descriptors. ls > dirlist 2>&1 will direct both standard output and standard error to the ...
1
vote
1answer
971 views

Redircting stdout to file, but duplicating stderr to both file and terminal [duplicate]

Redirecting stderr to file and duplicating stdout to both file and terminal is easy: $ prog 2>error.log | tee output.log tee will duplicate stdout, printing it to both terminal and output.log. ...
3
votes
2answers
251 views

Where to place a Bash shell redirection for a command? [duplicate]

Possible Duplicate: Order of redirections Apart from the standalone exec >&2 to redirect the current shell's input and output are there any behavioral differences in the following commands:...
0
votes
1answer
1k views

Suppress output of shell script [duplicate]

I'm running this line on my shell script sudo npm install -g yaml-cli -y 2>&1 >/dev/null I would expect to get no output, but I still get npm WARN deprecated minimatch@2.0.10: Please ...
1
vote
0answers
58 views

why md5sum 2>&1 > /dev/null show error message [duplicate]

I have command like this: md5sum -c {FILENAME} 2>&1 > /dev/null || ./upload {FILENAME} and it show error if file is missing or invalid, I need to use this in order to hide the message: ...
0
votes
1answer
54 views

disown : unable to stop stderr s [duplicate]

Problem: Even with dev null and disown.. web browser is still reporting errors to the terminal it launched from of. web_browser < /dev/null > /dev/null 1>&2 & disown
0
votes
0answers
21 views

Why I get the output of stderr printed in terminal instead of a file when I redirect the stdout into stderr? [duplicate]

When I run a command with output redirection into stdin like that: sudo -u postgres psql mydb -e -f ./my_psql.sql 2>&1 > output_log.log The error messages are being displayed into the ...
74
votes
10answers
62k views

How to grep standard error stream (stderr)?

I am using ffmpeg to get the meta info of an audio clip. But I am unable to grep it. $ ffmpeg -i 01-Daemon.mp3 |grep -i Duration FFmpeg version SVN-r15261, Copyright (c) 2000-2008 Fabrice ...
69
votes
3answers
63k views

What does “3>&1 1>&2 2>&3” do in a script?

I saw this line in a script: DEVICE=`dialog --inputbox "Festplatten-Laufzeit auslesen. Gebe Sie das gewünschte Device an: " 0 70 "" 3>&1 1>&2 2>&3` What is 3>&1 1>&...
50
votes
1answer
129k views

What does 2>&1 in this command mean? [duplicate]

I understand that this command attempts to write to nowhere or a null device but what does 2>&1 mean here? wget -q -O - http://yourwebsite.com/wp-cron.php?doing_wp_cron > /dev/null 2>&...
12
votes
7answers
531 views

How do you remember the syntax for 2>&1 redirection [closed]

Do you have a mnemonic or system? This has bothered me for years I always have to look it up
9
votes
2answers
3k views

Redirect the output of a command in `time command`

I am trying to time something using: /usr/bin/time myCommand However, since /usr/bin/time writes to stderr, if myCommand also writes to stderr, I will get more than just time's output on the stream. ...
0
votes
0answers
164 views

rsync send all output to /dev/null

I have the following bash command rsync -q host:/usr/files/client.txt /home/myuser/ 2>&1>/dev/null But it's still giving me Unexpected local arg: /home/myuser/ If arg is a remote file/dir,...