Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have seen a strange directory on my linux server.. Here it is:

drwxr-xr-x 2 root root 4096 Jan 12 2005 \t\t\t\t/

How can i escape \t under shell? Thanks!

share|improve this question

3 Answers 3

"\t\t\t\t" or \\t\\t\\t\\t

share|improve this answer

"\t" may be a tab character. That is, the directory's name may be <tab><tab><tab><tab>. You can try combinations of literal \ (which needs to be escaped, so you type \\) and t and tab or use globbing. I'd recommend globbing, so (assuming there are no other oddly named directories in this directory)

mv \<tab>* mystery-dir
mv \\* mystery-dir
mv \\t* mystery-dir

one of these should work.

share|improve this answer

If you are seeing that with the -b option of ls, then those are tab characters. Here is one way rename it:

mv $'\t\t\t\t' new_name

In this case, you type the individual backslash and "t" characters and the $'...' converts it to tabs for you. It makes it easier to read the command than trying to insert the right number of tabs using Ctrl-v Tab repeatedly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.