Operating System - HP-UX
1847084 Members
5315 Online
110262 Solutions
New Discussion

How delete a file without name?

 
SOLVED
Go to solution
Manuales
Super Advisor

How delete a file without name?

Hi !!
how can i delete files without name , look at this, is the line shown before message file:

$ ls -rlt
total 14
-rwxr-xr-x 1 USERONE users 113 Jan 10 13:32 environment.sh
-rwxr-xr-x 1 USERONE users 1759 Jan 10 16:23 messages.txt
-rwxr-xr-x 1 USERONE users 1407 Jan 11 18:09 message.ak
-rw------- 1 USERONE users 0 Jan 12 03:58
-rwxr-xr-x 1 USERONE users 1296 Jan 12 03:58 message

thanks, Manuales.
13 REPLIES 13
Sivakumar TS
Honored Contributor
Solution

Re: How delete a file without name?


Hi,

You can do a rm *.* in a interactive mode and delete the particular file.

With Regards,

Siva.
Nothing is Impossible !
RAC_1
Honored Contributor

Re: How delete a file without name?

It may not be a blank name exactly, it could be a control/non-printable char.
Check it.

ll -bv
ll | vis

Now ll -il
note down inode number (appears in first column)
now find
find . -inum "number" -exec ll -d {} \;
confirm above, then
find . -inum "number" -exec rm -i {} \;
There is no substitute to HARDWORK
Devender Khatana
Honored Contributor

Re: How delete a file without name?

Hi,

It is always some character in the name of the file. Here it is a non printable character. This can be seen by

#ll -b

And can be deleted by doing "rm -i *" in that directory and then removing the desired file or through inode number.

HTH,
Devender
Impossible itself mentions "I m possible"
Arunvijai_4
Honored Contributor

Re: How delete a file without name?

Hi Manuels,

You can delete them using inode number which is unique.

# ls -i will display inode number.
# rm -i

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Senthil Prabu.S_1
Trusted Contributor

Re: How delete a file without name?

Hi,
simply execute rm *.*.

Or for interactive rm -i and use inodes.


HTH,
prabu.S
One man's "magic" is another man's engineering. "Supernatural" is a null word.
Pete Randall
Outstanding Contributor

Re: How delete a file without name?

"rm -i" is just going to give you the interactive "y/n" version of rm. In order to remove by inode number, use find:


find . -inum NNNN -exec rm {} \;


Pete

Pete
Ajitkumar Rane
Trusted Contributor

Re: How delete a file without name?

Hi Manuales,

probably rm -f -- " " should solve your problem.


Rgds,

Ajit
Amidsts difficulties lie opportunities
Ajitkumar Rane
Trusted Contributor

Re: How delete a file without name?

Also you ca try

rm -i -- *.*

Ajit
Amidsts difficulties lie opportunities
Ajitkumar Rane
Trusted Contributor

Re: How delete a file without name?

Also you can try

rm -i -- *

Ajit
Amidsts difficulties lie opportunities
James R. Ferguson
Acclaimed Contributor

Re: How delete a file without name?

Hi Manuales:

There isn't any file below the one beginning with "message" dated Jan 12 03:58.

List this directory with:

# ls -lb

...to expose the non-printing characters that follow (or even spaces!).

Then, follow the technique of removing or renaming a file by inode that we discussed here:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=988269

Regards!

...JRF...
Yogeeraj_1
Honored Contributor

Re: How delete a file without name?

hi manuales,

also, if you have a graphics console, you can browse to the directory and select+delete the file.

hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Geoff Wild
Honored Contributor

Re: How delete a file without name?

Check out this link:

http://www.helpdesk.umd.edu/topics/troubleshooting/os/unix/1231/

You can delete via the inode number:

ls -ali *

find ./ -inum ###### -exec rm -i {} \;

where ###### is the inode number of the file witout a name.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Manuales
Super Advisor

Re: How delete a file without name?

Thanks friends !!!
all things were correct !!!

Manuales.