File descriptor
Hi all,
I've come across this file descriptor but don't really understand how it is done. I understand that 2 is for standard error and 1 is for standard output, but still don't understand fully. Appreciate if someone can explain to me in layman's term. And how can I read up for more information in the info page for the > operator? I'm not able to find any information with "info >". Thanks alot ls>dirlist 2>&1 -will direct both standard output and standard error to the file dirlist ls 2>&1>dirlist - will only direct standard output to dirlist. |
That's re-direction.
# Basic piping some_command | another_command See Linux and the tools philosophy # Basic re-direction: command > textfile_name See this Text Manipulation Article # Basic concatenation: If you don't want to overwrite a file but add to the bottom of an existing file, concatenate it: command >> exisiting_text_file |
ls>dirlist 2>&1
Regarding the above statement, fom my understanding, the output of ls is redirected to dirlist. but what does 2>&1 means? How does it redirect the output and error to dirlist since it's using the greater symbol ">"?? |
|
Hi fancypiper,
That's a very good link for beginner. Thank you very much |
I have got to get that in hard cover. It's absolutely the best explanation of Linux I have found.
|
All times are GMT -5. The time now is 08:20 PM. |