Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Linux Ask!

Jan 162010
 

Save program output and error to different files

Answer:

Assume you are going to execute a program called foobar, and it emits to both the standard output and standard error. You want to save them into different files, try

# ./foobar 1> output.txt 2> error.txt

or simply

# ./foobar > output.txt 2> error.txt

Jan 162010
 

How to view output in Hex

Answer:

Use the hexdump command,

# hexdump test.txt
0000000 6261 0a63
0000004

To display hex+ASCII (Canonical) altogether

# hexdump -C test.txt
00000000  61 62 63 0a                                  |abc.|
00000004