- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- weird file - can't be deleted....
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
Discussions
Discussions
Forums
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
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
тАО09-12-2005 03:47 AM
тАО09-12-2005 03:47 AM
-rw-rw-rw- 2 root AJP 648605 Sep 7 01:00 35010000.07
-rw-rw-rw- 2 root AJP 8792777 Sep 10 01:04 35010000.10
-rw-rw-rw- 2 root AJP 11055850 Aug 29 01:04 35010000.29
The first 2 lines show --- as the file name.
when I do a ls -lab it still shows --- as the file name.
I tried an rm -i * to remove the file, I get illegal option.
I tried redirecting the directory list to a file and creating a shell to remove the file, same result, illegal option.
Does anyone have any idea how to remove this file without having to copy the required information into another directory and deleting the entire directory that this resides in? (Not even sure if that would work).
Thanks
Lisa Taylor
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2005 03:53 AM
тАО09-12-2005 03:53 AM
Re: weird file - can't be deleted....
Then do a find . -inum n -exec rm {} \; to remove the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2005 03:56 AM
тАО09-12-2005 03:56 AM
Re: weird file - can't be deleted....
The easy way to remove a file named "--" is to tell 'rm' that the hypehen is NOT one of its options:
# rm -i - --
Note the "-" says that there are no more options (flags) on the commandline.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2005 04:03 AM
тАО09-12-2005 04:03 AM
Solutionrm -i - ./*
But, unless the list of files in the current directory is short - the approach using the inode number (first reply posting) is the one I like best for very tricky items.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2005 07:35 PM
тАО09-12-2005 07:35 PM
Re: weird file - can't be deleted....
I also find that if you specify the path (either full path of relative path) with double quotes "", it'll work:
# rm "/
Hope it helps too.
Best regards,
Mei
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2005 08:02 PM
тАО09-12-2005 08:02 PM
Re: weird file - can't be deleted....
ls -l | awk '{ if (NR==1) print rm $NF }' | sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2005 08:21 PM
тАО09-12-2005 08:21 PM
Re: weird file - can't be deleted....
Check this document below (docID : KBRC00000429) about 'Remove File with Special Character in the Name' :
http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000080078334
Hope this info can help you to resolve the problem.
Cheers,
AW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2005 09:37 PM
тАО09-12-2005 09:37 PM
Re: weird file - can't be deleted....
rm -- ---
The key part is the file name,
which is leading with "-".
The "-" character is collision with
unix command option "-".
we can use "--" to void the options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2005 09:56 PM
тАО09-12-2005 09:56 PM
Re: weird file - can't be deleted....
You can also use an FTP program to handle your deletion request.
If you've got a MSWin client you can us wsftp or something to delete the file.
It works pretty good and the FTP program handles the special characters.
Regards, MB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2005 10:03 PM
тАО09-12-2005 10:03 PM
Re: weird file - can't be deleted....
rm -f ./---
or
rm -f
or
rm -- ---
where -- used to show that getopts() argument to ls binary is completed.
hth.