- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to delete a file which has no name..........
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 03:55 PM
05-21-2006 03:55 PM
how to delete a file which has no name.............
one of my colleagues was trying to edit a log file..by doing vi check.log...He got a message permission denied...after which he quit the editor by :wq as a result of which a file is created which is 0 bytes ..but no name...
Now i want to delete tht file..how do i do it.????/
The ouput is as follows.........
-rw------- 1 xyz users 0 May 21 08:0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 04:06 PM
05-21-2006 04:06 PM
Re: how to delete a file which has no name.............
You can delete using inode number,
1) Find out inode number of the file using ls -i
2) Delete using find . -inum [inode-number] -exec rm -i {} \;
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 06:03 PM
05-21-2006 06:03 PM
Re: how to delete a file which has no name.............
you can do a "ls -q" you will see all the unprintable character of that filename as "?".
After that you can delete it with (e.g.)
rm -i ./?????
Be shure to delete interactive "-i" to not delete other files with same filenamelength.
rdgs
HGH
- Tags:
- unprintable chars
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 07:46 PM
05-21-2006 07:46 PM
Re: how to delete a file which has no name.............
You can use ls -i option to list the file and the corresponding inode number.
You can get the inode number of the file that you wanted to delete then use find with â inum option to lits first, check and then delete.
Eg: if the inode number of the file is 4568
find /path -inum 4568 -exec ll {} \;
Check that this is the file you want to delete and then
find /path -inum 4568 -exec rm {} \;
Note that file serial numbers are unique only within a given file system
IA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 07:51 PM
05-21-2006 07:51 PM
Re: how to delete a file which has no name.............
One way is to find the inode number and delete using the same.
# ls -i *
3555 testfile
then,
# find . -inum 3555 -exec rm {} \;
Regards,
Siva.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 07:53 PM
05-21-2006 07:53 PM
Re: how to delete a file which has no name.............
and find /xyz -inum 1 -exec ls -la {} \;
shows nothing.............
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 08:38 PM
05-21-2006 08:38 PM
Re: how to delete a file which has no name.............
you could use the file manager of CDE to edit the file name.
Then you can erase it normal.
By the way the '1' in your line
-rw------- 1 xyz users 0 May 21 08:0
is *not* the inum of your file!
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 08:43 PM
05-21-2006 08:43 PM
Re: how to delete a file which has no name.............
please post the output of:
# ls -il | cat -v
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 09:04 PM
05-21-2006 09:04 PM
Re: how to delete a file which has no name.............
what does ls -il says?
Btw - Siva - 'find . ' is not so good because it would search all subdirectories.
Better would be './'
In general there are many threads here with similar problems, you should try some suggestions:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1012446
*see also Rick's comment about 'find .' *
http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=108346
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 10:26 PM
05-21-2006 10:26 PM
Re: how to delete a file which has no name.............
-rw-------1 sureshs users 0 May 21 08:01 ^?^?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 10:36 PM
05-21-2006 10:36 PM
Re: how to delete a file which has no name.............
ls -l gives for example:
-rw-rw-r-- 1 root sys 203264 Nov 15 2004 xdriver.ini
ls -il gives:
83153 -rw-rw-r-- 1 root sys 203264 Nov 15 2004 xdriver.ini
So 83153 is the inum of the file xdriver.ini
You can use rm -i * or as I suggested use the file manager, there you can see files like ^?^?
V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 11:00 PM
05-21-2006 11:00 PM
Re: how to delete a file which has no name.............
what kind of system do you have - the output from "ls -il" does apparently not show the inode number of the file, which should have appeared leftmost (the '1' listed is the number of links to the file).
Another approach is to try and list the file using different wildcards , e.g. enclosed in single quotes, e.g.:
# ls -l '^*'
or for a certain number of chars:
# ls -l ????
or other combinations and then replace ls by rm when you can match only the file in question. However, the other suggestions are better.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2006 11:57 PM
05-21-2006 11:57 PM
Re: how to delete a file which has no name.............
The inode is not one. You need to do:
# ls -il (that's a lowercase "i" as in "inode" and a lowercase "l" as in "list" to list more information.
The inode number is the number in the *first* column.
Inode numbers are only unique within a filesytem. That is, the same numbers will apply to files in different filesystems.
Regards!
...JRF...