How to see special characters?

Hi all,
I was wondering how can i see the special characters like \t, \n or anything else in a file by using Nano or any other linux command like less, more etc

not sure if this helps:

echo "dfdf\n\t" | xd -c

output:

0000000 d f d f \n \t \n
0000007

What is this xd command ?

man xd

alright, i thought xd comes like a debian. But I have found it now and installed it from here . But it doesn't show what I want, its doing some dumping into hexa/oct etc.. I am looking for some shell editor flag or some linux command which shows me special characters like:

then

so that I can understand what are the characters between tabs or end of the line. I hope I explained clearly now :slight_smile:

cat -v (solaris)

see: man cat

 -v    Non-printing characters (with the exception  of  tabs,
           new-lines  and  form-feeds) are printed visibly. ASCII
           control characters (octal 000 - 037)  are  printed  as
           ^n,  where  n  is the corresponding ASCII character in
           the range octal 100 - 137 (@, A, B, C, . . ., X, Y, Z,
           [,  \, ], ^, and _); the DEL character (octal 0177) is
           printed ^?. Other non-printable characters are printed
           as  M-x,  where  x is the ASCII character specified by
           the low-order seven bits.

In vi (or vim) use the command

:set list

to see non-printable characters. And of course

:set nolist

goes back to normal.

(Non-printable in this case includes tabs which show up as ^I)