Operating System - HP-UX
1830893 Members
2794 Online
110017 Solutions
New Discussion

File created with a space

 
SOLVED
Go to solution
uk1
Frequent Advisor

File created with a space

Had a user create a file with a space, so it doesnt have a file name. Is there any way to reference that file through a search pattern? Besides *

Thanks in advance
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: File created with a space

space in the name?

rm "file name"

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
RAC_1
Honored Contributor

Re: File created with a space

rm -i "file name"

ls -il
note down inode number
find . -inum "no" -exec rm m -i {} \;
There is no substitute to HARDWORK
Rodney Hills
Honored Contributor
Solution

Re: File created with a space

If it might be a non-printing character in the name, do a-
ls -ib

This will display the filename with any non-printing characters replaced with "\nnn" representing the octal value of the ascii character. The -i option display the inode number instead of the file size.

With the the inode number you can do the following:

Verify the name of the file is correct
find . -inum -print

Remove the filename based on inode
find . -inum -exec rm {} \;

HTH

-- Rod Hills
There be dragons...
uk1
Frequent Advisor

Re: File created with a space

Man you guys are fast =) Thanks a ton! Yes the file name was empty but after using the -ib option I am able to see a \177 which explains why there was nothing to see nameing wise
TwoProc
Honored Contributor

Re: File created with a space

David, throw em points!
We are the people our parents warned us about --Jimmy Buffett
uk1
Frequent Advisor

Re: File created with a space

I guess it would cerntainly help if I clicked the sumbit points button! After selecting the points =)
Geoff Wild
Honored Contributor

Re: File created with a space

And a couple of handy links on this subject:

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

http://www.sas.upenn.edu/computing/help/Unix/special_char.html

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.