|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Odd file with no name
OS: Solaris 2.6
File with no name created Mar of 2000 - ls (with or without options) shows the file but no name associated with it. Example: ls -ltca -rw-r--r-- 1 root other 9721 Apr 16 2003 printcap -rw-r--r-- 1 root other 267 Apr 16 2003 -rw-r--r-- 1 root other 258 Apr 16 2003 auto_master Run file command: file * timezone: ascii text ypservers: English text : ascii text I figured out that I could use the find command to look for the specific file with -type f and -size 267 so I did rename it to junk. It contained text relating to CVS. I had tried both a space and tab with the ls command but that didn't work. Anyone ever see a file with no name? |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
It could have been some kind of non-printing character. I just created (under HP-UX 10.20), a "blank" filename using
touch ^H With ls -l we get -rw-rw-rw- 1 kw627 tech_srvs 0 Nov 9 16:40 If we do an ls -lb we see -rw-rw-rw- 1 kw627 tech_srvs 0 Nov 9 16:40 \010 I used find to remove this too.... EDIT: An easier way to remove is to prefix the filename by the path, e.g. rm ./^H or mv ./^H junk - I'll also say I've had varying success deleting files with strange names (\014 is particularly hard to remove!), by FTPing in from a Windows machine (which doesn't interpret a lot of the escapes) and deleting the file (in this case DEL ^L does the job). Cheers ZB Last edited by zazzybob; 11-09-2004 at 11:47 AM.. |
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
I agree,
My best way to remove odd files is with: # rm ./filename This ensures you wont do anything stupid like wiping out all files in the directory. I believe quotes work as well. |
|
#4
|
|||
|
|||
|
ls -i
you will get inode numbers, associated with those files to delete one of them: XXX is the inode number of the file find -inum XXX -exec rm {} \; |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Before I delete any file in Unix, How can I check no open file handle is pointing to that file? | kchinnam | Solaris | 12 | 10-06-2010 02:30 PM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 04:25 AM |
|
|