Redirecting a command with parameters to a fileCalling an external command in PythonHow to manage a redirect request after a jQuery Ajax callShell command to sum integers, one per line?How do I redirect to another webpage?How do I make a redirect in PHP?How can I redirect and append both stdout and stderr to a file with Bash?How to symlink a file in Linux?How to exclude a directory in find . commandHow can I recursively find all files in current and subfolders based on wildcard matching?How do I find all files containing specific text on Linux?
Why don't B747s start takeoffs with full throttle?
The ring of global sections of a regular scheme
Can a magnetic field of an object be stronger than its gravity?
Accidentally renamed tar.gz file to a non tar.gz file, will my file be messed up
I wrote a scene that the majority of my readers loved. How do I get back to that place while writing my new book?
Align text within align
Opposite of "Squeaky wheel gets the grease"
Diet Coke or water?
How can Iron Man's suit withstand this?
Is it possible for people to live in the eye of a permanent hypercane?
Does any lore text explain why the planes of Acheron, Gehenna, and Carceri are the alignment they are?
What are the words for people who cause trouble believing they know better?
Personalization conditions switching doesn`t work in Experience Editor (9.1.0, Initial Release)
Is it OK to bring delicacies from hometown as tokens of gratitude for an out-of-town interview?
Is there any word or phrase for negative bearing?
Will TSA allow me to carry a Continuous Positive Airway Pressure (CPAP) device?
Is it legal in the UK for politicians to lie to the public for political gain?
What is the right way to float a home lab?
Did thousands of women die every year due to illegal abortions before Roe v. Wade?
Linux tr to convert vertical text to horizontal
Why were the Night's Watch required to be celibate?
Did Darth Vader wear the same suit for 20+ years?
You've spoiled/damaged the card
Bent spoke design wheels — feasible?
Redirecting a command with parameters to a file
Calling an external command in PythonHow to manage a redirect request after a jQuery Ajax callShell command to sum integers, one per line?How do I redirect to another webpage?How do I make a redirect in PHP?How can I redirect and append both stdout and stderr to a file with Bash?How to symlink a file in Linux?How to exclude a directory in find . commandHow can I recursively find all files in current and subfolders based on wildcard matching?How do I find all files containing specific text on Linux?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have the following command
/home/ec2-user/MyDomain/bin/daphne -b 0.0.0.0 -p 8001 main.asgi:channel_layer
I would like to redirect the console output to a file. I tried doing this
/home/ec2-user/MyDomain/bin/daphne -b 0.0.0.0 -p 8001 main.asgi:channel_layer >> /var/log/access.log
but that does not work. Any suggestions on what I might be doing wrong. Ultimately I would like to start that as a background process using & and log the output to a file
linux shell redirect
add a comment |
I have the following command
/home/ec2-user/MyDomain/bin/daphne -b 0.0.0.0 -p 8001 main.asgi:channel_layer
I would like to redirect the console output to a file. I tried doing this
/home/ec2-user/MyDomain/bin/daphne -b 0.0.0.0 -p 8001 main.asgi:channel_layer >> /var/log/access.log
but that does not work. Any suggestions on what I might be doing wrong. Ultimately I would like to start that as a background process using & and log the output to a file
linux shell redirect
1
The output your seeing is probably stderr (filedescriptor 2).Try 2>>/var/log/access.log
– PSkocik
Mar 23 at 17:43
@PSkocik yes that worked. And to start it in the background simply add & to the proc name ?
– MistyD
Mar 23 at 17:46
After the whole command, yes.
– PSkocik
Mar 23 at 17:47
@PSkocik that worked can you put that as an answer
– MistyD
Mar 23 at 17:51
add a comment |
I have the following command
/home/ec2-user/MyDomain/bin/daphne -b 0.0.0.0 -p 8001 main.asgi:channel_layer
I would like to redirect the console output to a file. I tried doing this
/home/ec2-user/MyDomain/bin/daphne -b 0.0.0.0 -p 8001 main.asgi:channel_layer >> /var/log/access.log
but that does not work. Any suggestions on what I might be doing wrong. Ultimately I would like to start that as a background process using & and log the output to a file
linux shell redirect
I have the following command
/home/ec2-user/MyDomain/bin/daphne -b 0.0.0.0 -p 8001 main.asgi:channel_layer
I would like to redirect the console output to a file. I tried doing this
/home/ec2-user/MyDomain/bin/daphne -b 0.0.0.0 -p 8001 main.asgi:channel_layer >> /var/log/access.log
but that does not work. Any suggestions on what I might be doing wrong. Ultimately I would like to start that as a background process using & and log the output to a file
linux shell redirect
linux shell redirect
edited Mar 24 at 13:22
PSkocik
36.7k65580
36.7k65580
asked Mar 23 at 17:42
MistyDMistyD
4,3961677150
4,3961677150
1
The output your seeing is probably stderr (filedescriptor 2).Try 2>>/var/log/access.log
– PSkocik
Mar 23 at 17:43
@PSkocik yes that worked. And to start it in the background simply add & to the proc name ?
– MistyD
Mar 23 at 17:46
After the whole command, yes.
– PSkocik
Mar 23 at 17:47
@PSkocik that worked can you put that as an answer
– MistyD
Mar 23 at 17:51
add a comment |
1
The output your seeing is probably stderr (filedescriptor 2).Try 2>>/var/log/access.log
– PSkocik
Mar 23 at 17:43
@PSkocik yes that worked. And to start it in the background simply add & to the proc name ?
– MistyD
Mar 23 at 17:46
After the whole command, yes.
– PSkocik
Mar 23 at 17:47
@PSkocik that worked can you put that as an answer
– MistyD
Mar 23 at 17:51
1
1
The output your seeing is probably stderr (filedescriptor 2).Try 2>>/var/log/access.log
– PSkocik
Mar 23 at 17:43
The output your seeing is probably stderr (filedescriptor 2).Try 2>>/var/log/access.log
– PSkocik
Mar 23 at 17:43
@PSkocik yes that worked. And to start it in the background simply add & to the proc name ?
– MistyD
Mar 23 at 17:46
@PSkocik yes that worked. And to start it in the background simply add & to the proc name ?
– MistyD
Mar 23 at 17:46
After the whole command, yes.
– PSkocik
Mar 23 at 17:47
After the whole command, yes.
– PSkocik
Mar 23 at 17:47
@PSkocik that worked can you put that as an answer
– MistyD
Mar 23 at 17:51
@PSkocik that worked can you put that as an answer
– MistyD
Mar 23 at 17:51
add a comment |
1 Answer
1
active
oldest
votes
Error messages that aren't part of a program's primary output should and usually do go to filedescriptor 2
(stderr
). To redirect an output filedescriptor N
to a file, you need N>the_file
(or N>>the_file
) (i.e., 2>>the_file
to redirect filedescriptor 2`).
When you omit the number, 1
(stdout
) is implied for output redirections to a file and 0
for input redirections from a file.
(You can also do descriptor to descriptor redirections (SrcFd>&TargetFd
) and/or closes (Fd>&-
) and there the direction of the arrow doesn't matter.)
so how do I tell it to write 2 and everything else to the file
– MistyD
Mar 23 at 19:32
1
@MistyD2>>the_file >&2
is one way to make both stdout and stderr go tothe_file
in append mode.
– PSkocik
Mar 23 at 19:36
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55316596%2fredirecting-a-command-with-parameters-to-a-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Error messages that aren't part of a program's primary output should and usually do go to filedescriptor 2
(stderr
). To redirect an output filedescriptor N
to a file, you need N>the_file
(or N>>the_file
) (i.e., 2>>the_file
to redirect filedescriptor 2`).
When you omit the number, 1
(stdout
) is implied for output redirections to a file and 0
for input redirections from a file.
(You can also do descriptor to descriptor redirections (SrcFd>&TargetFd
) and/or closes (Fd>&-
) and there the direction of the arrow doesn't matter.)
so how do I tell it to write 2 and everything else to the file
– MistyD
Mar 23 at 19:32
1
@MistyD2>>the_file >&2
is one way to make both stdout and stderr go tothe_file
in append mode.
– PSkocik
Mar 23 at 19:36
add a comment |
Error messages that aren't part of a program's primary output should and usually do go to filedescriptor 2
(stderr
). To redirect an output filedescriptor N
to a file, you need N>the_file
(or N>>the_file
) (i.e., 2>>the_file
to redirect filedescriptor 2`).
When you omit the number, 1
(stdout
) is implied for output redirections to a file and 0
for input redirections from a file.
(You can also do descriptor to descriptor redirections (SrcFd>&TargetFd
) and/or closes (Fd>&-
) and there the direction of the arrow doesn't matter.)
so how do I tell it to write 2 and everything else to the file
– MistyD
Mar 23 at 19:32
1
@MistyD2>>the_file >&2
is one way to make both stdout and stderr go tothe_file
in append mode.
– PSkocik
Mar 23 at 19:36
add a comment |
Error messages that aren't part of a program's primary output should and usually do go to filedescriptor 2
(stderr
). To redirect an output filedescriptor N
to a file, you need N>the_file
(or N>>the_file
) (i.e., 2>>the_file
to redirect filedescriptor 2`).
When you omit the number, 1
(stdout
) is implied for output redirections to a file and 0
for input redirections from a file.
(You can also do descriptor to descriptor redirections (SrcFd>&TargetFd
) and/or closes (Fd>&-
) and there the direction of the arrow doesn't matter.)
Error messages that aren't part of a program's primary output should and usually do go to filedescriptor 2
(stderr
). To redirect an output filedescriptor N
to a file, you need N>the_file
(or N>>the_file
) (i.e., 2>>the_file
to redirect filedescriptor 2`).
When you omit the number, 1
(stdout
) is implied for output redirections to a file and 0
for input redirections from a file.
(You can also do descriptor to descriptor redirections (SrcFd>&TargetFd
) and/or closes (Fd>&-
) and there the direction of the arrow doesn't matter.)
answered Mar 23 at 17:59
PSkocikPSkocik
36.7k65580
36.7k65580
so how do I tell it to write 2 and everything else to the file
– MistyD
Mar 23 at 19:32
1
@MistyD2>>the_file >&2
is one way to make both stdout and stderr go tothe_file
in append mode.
– PSkocik
Mar 23 at 19:36
add a comment |
so how do I tell it to write 2 and everything else to the file
– MistyD
Mar 23 at 19:32
1
@MistyD2>>the_file >&2
is one way to make both stdout and stderr go tothe_file
in append mode.
– PSkocik
Mar 23 at 19:36
so how do I tell it to write 2 and everything else to the file
– MistyD
Mar 23 at 19:32
so how do I tell it to write 2 and everything else to the file
– MistyD
Mar 23 at 19:32
1
1
@MistyD
2>>the_file >&2
is one way to make both stdout and stderr go to the_file
in append mode.– PSkocik
Mar 23 at 19:36
@MistyD
2>>the_file >&2
is one way to make both stdout and stderr go to the_file
in append mode.– PSkocik
Mar 23 at 19:36
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55316596%2fredirecting-a-command-with-parameters-to-a-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
The output your seeing is probably stderr (filedescriptor 2).Try 2>>/var/log/access.log
– PSkocik
Mar 23 at 17:43
@PSkocik yes that worked. And to start it in the background simply add & to the proc name ?
– MistyD
Mar 23 at 17:46
After the whole command, yes.
– PSkocik
Mar 23 at 17:47
@PSkocik that worked can you put that as an answer
– MistyD
Mar 23 at 17:51