How to convert tab into spaces?
Answer:
You can use the expand command
# expand test.txt
Another example:
# echo -e "\tA" | expand | sed 's/ /F/g'
FFFFFFFFA
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to convert tab into spaces?
Answer:
You can use the expand command
# expand test.txt
Another example:
# echo -e "\tA" | expand | sed 's/ /F/g'
FFFFFFFFA
How to find the differences between two files (visually)
Answer:
Use the vimdiff command
E.g.
# vimdiff foo.txt bar.txt
You can enter vim and the differences between two files will be shown visually.
Show the content of gzipped text file
Answer:
Use the zcat command, e.g.
# zcat text.gz
Sending both output and error message to same file
Answer:
Pick any of the following methods
1.
./foobar &> output.txt
2.
./foobar >& output.txt
3. Most popular
./foobar > output.txt 2>&1
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