- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: removing a file that starts with "-"
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
11-14-2002 09:31 AM
11-14-2002 09:31 AM
One of my users created a file called "-h".
When I try to rm it i get, -h unknown option.
I've tried \-h "-h" and single quotes to no avail. Help!
-john
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 09:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 09:32 AM
11-14-2002 09:32 AM
Re: removing a file that starts with "-"
will do.
...Manjeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 09:33 AM
11-14-2002 09:33 AM
Re: removing a file that starts with "-"
Try:
# rm -i "*-h*"
...and respond yes or no appropriately.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 09:36 AM
11-14-2002 09:36 AM
Re: removing a file that starts with "-"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 09:37 AM
11-14-2002 09:37 AM
Re: removing a file that starts with "-"
more -- -h
or rename it
mv -- -h newfilename
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 09:38 AM
11-14-2002 09:38 AM
Re: removing a file that starts with "-"
4 answer, 4 correct answer and all different!!!!!!!!!!!
goood!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 09:39 AM
11-14-2002 09:39 AM
Re: removing a file that starts with "-"
# rm -i -- -h
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 09:39 AM
11-14-2002 09:39 AM
Re: removing a file that starts with "-"
rm -- -h
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 09:46 AM
11-14-2002 09:46 AM
Re: removing a file that starts with "-"
A strawberry on a pie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 09:50 AM
11-14-2002 09:50 AM
Re: removing a file that starts with "-"
Well, either you guys have been doing this to long or i haven't been doing it long enough.
I tried rm ./-h, fewest charaters to type, and it worked. The next time I'll one of the other solutions.
Thanks!
-john
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 10:28 AM
11-14-2002 10:28 AM
Re: removing a file that starts with "-"
/No_Points_Please/
I'm not sure what the h*ll I was thinking with my first suggestion of "*-h*" but that clearly wonn't work! Fortunately my second offering was correct and preferred and you gave me points for that! For future readers:
In general, two consecutive hyphens single the end of flags for well-behaved commands. At your leisure:
# touch -- -h
# ls -- -h
# mv -- -h -hh
# ls -- -h
# ls -- -h*
# set -f #...disable globbing...
# ls -- -h*
# set +f #...enable globbing...
# rm -i -- -h*
Regards!
...JRF...