Inaccessible UNIX filenames…
Posted by: Richard Evans
I goofed up earlier and somehow managed to give my file a name. To fix this I was able to rename it by using ctl+v followed by ctl+h to generate the ^H character.
The Problem
When I saved it in vi I somehow messed up my :wq! And I it saved it with this name:
"^H" [New file] 167 lines, 3054 characters
You can see below that there is a file with no filename.
[oracle: /oracle/DB/102_64/network/admin] ls -al
total 38
-rw-r--r-- 1 oracle dba 3054 Jun 17 11:12
drwxr-x--- 3 oracle dba 1024 Jun 17 11:12 .
drwxr-x--- 13 oracle dba 1024 Feb 20 15:48 ..
-rw-r--r-- 1 oracle dba 695 Mar 5 14:32 listener.ora
drwxr-x--- 2 oracle dba 96 Feb 20 15:45 samples
-rw-r----- 1 oracle dba 172 Dec 26 2003 shrept.lst
-rw-r--r-- 1 oracle dba 172 May 27 13:57 sqlnet.ora
-rw-r--r-- 1 oracle dba 4069 Jun 17 11:11 tnsnames.ora
-rw-r----- 1 oracle dba 6759 May 1 11:16 tnsnames.ora.20090319
[oracle: /oracle/DB/102_64/network/admin] find ./ -ls
373 1 drwxr-x--- 3 oracle dba 1024 Jun 17 11:12 ./
374 0 drwxr-x--- 2 oracle dba 96 Feb 20 15:45 ./samples
2101 4 -rw-r----- 1 oracle dba 3867 Sep 9 1997 ./samples/listener.ora
4652 31 -rw-r----- 1 oracle dba 31023 Sep 9 2003 ./samples/sqlnet.ora
4653 3 -rw-r----- 1 oracle dba 2939 May 16 2000 ./samples/tnsnames.ora
10346 1 -rw-r----- 1 oracle dba 172 Dec 26 2003 ./shrept.lst
2002 1 -rw-r--r-- 1 oracle dba 695 Mar 5 14:32 ./listener.ora
2003 4 -rw-r--r-- 1 oracle dba 4069 Jun 17 11:11 ./tnsnames.ora
18456 7 -rw-r----- 1 oracle dba 6759 May 1 11:16 ./tnsnames.ora.20090319
28266 1 -rw-r--r-- 1 oracle dba 172 May 27 13:57 ./sqlnet.ora
28342 3 -rw-r--r-- 1 oracle dba 3054 Jun 17 11:12 ./
[oracle: /oracle/DB/102_64/network/admin] find ./ -type f -ls
2101 4 -rw-r----- 1 oracle dba 3867 Sep 9 1997 ./samples/listener.ora
4652 31 -rw-r----- 1 oracle dba 31023 Sep 9 2003 ./samples/sqlnet.ora
4653 3 -rw-r----- 1 oracle dba 2939 May 16 2000 ./samples/tnsnames.ora
10346 1 -rw-r----- 1 oracle dba 172 Dec 26 2003 ./shrept.lst
2002 1 -rw-r--r-- 1 oracle dba 695 Mar 5 14:32 ./listener.ora
2003 4 -rw-r--r-- 1 oracle dba 4069 Jun 17 11:11 ./tnsnames.ora
18456 7 -rw-r----- 1 oracle dba 6759 May 1 11:16 ./tnsnames.ora.20090319
28266 1 -rw-r--r-- 1 oracle dba 172 May 27 13:57 ./sqlnet.ora
28342 3 -rw-r--r-- 1 oracle dba 3054 Jun 17 11:12 ./
The Fix
By using the ctl+v followed by ctl+h I was able to reproduce the ^H character and get the file information.
[oracle: /oracle/DB/102_64/network/admin] ls -al ^H
-rw-r--r-- 1 oracle dba 3054 Jun 17 11:12
Now I move it to a file with a legit name…
[oracle: /oracle/DB/102_64/network/admin] mv ^H test
Now I can move it to something useful




