I received a message asking me how to see non-printable characters in a text file. Almost immediately, utilities such as vi, cat, and od come to mind. The od command clearly states which non-printable characters are present. Here are examples using a text file.
# vi filename.txt
^I^I^I^I$
$
$
$
this is a test$
^I^I^I^I$
~
: set list
# cat -vet filename.txt
^I^I^I^I$
$
$
$
this is a test$
^I^I^I^I$
# od -c filename.txt
0000000 \t \t \t \t \n \n \n \n t h i s i s
0000020 a t e s t \n \t \t \t \t \n
0000034
Related post
Using octal dump to find bad characters
This blog covers Unix system administration HOWTO tips for using inline for loops, find command, Unix scripting, configuration, SQL, various Unix-based tools, and command line interface syntax. The Unix OS supports tasks such as running hardware, device drivers, peripherals and third party applications. Share tips/comments. Read the comments. But most importantly: Read Disclaimer - Read Disclaimer.
Subscribe to:
Post Comments (Atom)
1 comment:
i have used the command
cat -vet filename.txt
is showing me ^@ non printable character. So my question is how to remove the same. Please help me out.
Post a Comment