Odd file with no name | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

Odd file with no name

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-09-2004
RTM's Avatar
RTM RTM is offline Forum Advisor  
Registered User
 
Join Date: Apr 2002
Last Activity: 3 April 2014, 2:50 PM EDT
Location: On my motorcycle
Posts: 3,092
Thanks: 1
Thanked 29 Times in 9 Posts
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  
Old 11-09-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
 
Join Date: Dec 2003
Last Activity: 13 May 2013, 9:02 AM EDT
Location: Melbourne, Australia
Posts: 2,185
Thanks: 3
Thanked 24 Times in 23 Posts
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  
Old 11-11-2004
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
 
Join Date: Aug 2001
Last Activity: 18 April 2013, 3:03 PM EDT
Location: San Antonio, TX,
Posts: 1,070
Thanks: 0
Thanked 4 Times in 4 Posts
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  
Old 11-13-2004
FinalFantasy FinalFantasy is offline
Registered User
 
Join Date: Nov 2004
Last Activity: 21 November 2004, 12:00 AM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
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
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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



All times are GMT -4. The time now is 07:54 PM.