Unix/Linux Go Back    

UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Odd file with no name

UNIX for Dummies Questions & Answers

Thread Tools Search this Thread Display Modes
Old Unix and Linux 11-09-2004
RTM's Unix or Linux Image
RTM RTM is offline Forum Advisor  
Registered User
Join Date: Apr 2002
Last Activity: 16 August 2017, 7:13 PM EDT
Location: On my motorcycle
Posts: 3,093
Thanks: 1
Thanked 34 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.
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
Old Unix and Linux 11-09-2004
zazzybob's Unix or Linux Image
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
Join Date: Dec 2003
Last Activity: 2 October 2017, 12:19 PM EDT
Location: /dev/null
Posts: 2,187
Thanks: 3
Thanked 25 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).


Last edited by zazzybob; 11-09-2004 at 11:47 AM..
Sponsored Links
Old Unix and Linux 11-11-2004
Kelam_Magnus's Unix or Linux Image
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
Join Date: Aug 2001
Last Activity: 24 February 2017, 5:03 PM EST
Location: San Antonio, TX,
Posts: 1,071
Thanks: 0
Thanked 7 Times in 6 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.
Old Unix and Linux 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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 10:10 AM.