uudecode command is used to decode the ASCII representation that was created by the uuencode command. Please note that uuencode command encodes a binary file to ASCII text.
1. Basic uudecode Example
In this example, I have a file called “test.out”, which is a uuencoded file, as shown below.
# cat test.out begin 644 /dev/stdout M'XL(`%[095$``^W/L0K"0!"$X:WS%/
2. Store the uudecode Output to a File
In this example, I know that the test.out is a uuencoded file of a compressed tar file. So, I’ll decode this file and store the output to a test.tar.gz file as shown below.
# uudecode -o test.tar.gz test.out
Now, verify to make sure this is showing the appropriate content after the decode.
# ls -l test.tar.gz -rw-r--r--. 1 root root 131 Apr 10 23:12 test.tar.gz # tar tvfz test.tar.gz -rw-r--r-- root/root 10 2013-04-10 23:24 badblocks.txt