- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to remove a file "-1" ?
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-06-2003 11:21 PM
05-06-2003 11:21 PM
How to remove a file "-1" ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2003 11:26 PM
05-06-2003 11:26 PM
Re: How to remove a file "-1" ?
directly from the man page:
Remove a file in the current directory whose name starts with - or *
or some other character that is special to the shell:
rm ./-filename
rm \*filename
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2003 11:33 PM
05-06-2003 11:33 PM
Re: How to remove a file "-1" ?
Example:
rm -i /var/adm/-1
Regards,
Sergejs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2003 11:41 PM
05-06-2003 11:41 PM
Re: How to remove a file "-1" ?
you can also do this:
# rm -- -1
If you want to try other possibilities, you can always create the file again like this:
# touch -- -1
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2003 11:43 PM
05-06-2003 11:43 PM
Re: How to remove a file "-1" ?
use the inode to remove the file:
# ll -i
# find
e.g.
# ll -i
6933 -rwxrwxr-- 1 root sys 621 Mar 6 09:14 -1
# find . -inum 6933 -exec rm -f {} \;
Regards ...
Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2003 11:43 PM
05-06-2003 11:43 PM
Re: How to remove a file "-1" ?
I would had to think again, but these are indeed the funny ones.
always use a rm -i on these files. In case of your file use :
rm -i -- -1
in other cases "rm -i *file" will work, also when a ^H or so is added use a "ls | od -c" to view what character is used. ls >/tmp/1, leave only the to be deleted file in and do :
for i in `cat /tmp/1`
do
rm $i
done
Good luck.
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2003 11:59 PM
05-06-2003 11:59 PM
Re: How to remove a file "-1" ?
rm -i -- -1
or
ll -i in that dir, note inum of file -1
then
find . -inum
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2003 12:00 AM
05-07-2003 12:00 AM
Re: How to remove a file "-1" ?
Try find . -name "*-1*" -exec rm {} \;
Regards,
Fr??d??ric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2003 01:25 AM
05-07-2003 01:25 AM
Re: How to remove a file "-1" ?
You perform this command:
# rm -i *
and later, with a lot of caution, you choose whether to remove (with "y").
Regards.
Ernesto.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2003 03:08 AM
05-07-2003 03:08 AM
Re: How to remove a file "-1" ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2003 03:36 AM
05-07-2003 03:36 AM
Re: How to remove a file "-1" ?
perl -e "unlink \"-1\""
Christoph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2003 04:34 AM
05-07-2003 04:34 AM
Re: How to remove a file "-1" ?
or
rm -i ./-1