The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Write STDERR To A File Instead Of A Terminal

TL;DR
TODO: Pull subtitle into page object
Code
some_command &> output.txt

That line runs a command and sends both STDOUT and STDERR to the "output.txt" file.

Notes

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Write STDERR To A File Instead Of A Terminal

-- tldr/

-- code

some_command &> output.txt

-- p 

That line runs a command and sends both
STDOUT and STDERR to the "output.txt" file.

-- /tldr


-- notes

- The command works in some shells (e.g. bash and
zsh) but not others (e.g. sh and ksh). If it doesn't
work, try:

command > output.txt 2>&1

(There can't be a space between the `>`` and `&``
characters)

- Sending STDOUT to one file and STDERR to another
is done with:

command > output.txt 2> error.txt


-- ref
-- title: How to redirect stderr to a file
-- url: https://askubuntu.com/a/625230/338568


-- categories
-- Command Line 

-- groups

-- metadata
-- date: 2023-09-27 13:20:24
-- id: 2vzo1ahj
-- site: aws
-- type: post
-- status: published