- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How can I remove a file called -p (from touch -p)
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
04-19-2001 06:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2001 06:11 AM
04-19-2001 06:11 AM
Re: How can I remove a file called -p (from touch -p)
rm \-p
Best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2001 06:12 AM
04-19-2001 06:12 AM
Re: How can I remove a file called -p (from touch -p)
ls *p
also you could try rm -i *p
and answer no to the files you do not want to remove, yes to the one you do want to remove
(if it shows up)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2001 06:21 AM
04-19-2001 06:21 AM
Re: How can I remove a file called -p (from touch -p)
I tried to create your case, you cannot do it with touch:
$ touch -p
touch: illegal option -- p
usage: touch [-amc] [-t [[CC]YY]MMDDhhmm[.SS] | -r ref_file] file ...
$ >-p
ll
-rw-rw-rw- 1 root sys 0 Apr 19 16:19 -p
-rw------- 1 root sys 12428 Apr 17 20:08 .ICEauthority
So to remove:
$ rm -i ./\-p
./-p: ? (y/n) y
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2001 06:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2001 06:35 AM
04-19-2001 06:35 AM
Re: How can I remove a file called -p (from touch -p)
ls -i *p --- Find the inode # of the file
find /dir -inum inode#_of_the_file -exec rm {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2001 06:37 AM
04-19-2001 06:37 AM
Re: How can I remove a file called -p (from touch -p)
rm -- -p
the -- after rm indicates no more command arguments. -p will be interpreted as a filename.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2001 07:06 AM
04-19-2001 07:06 AM
Re: How can I remove a file called -p (from touch -p)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2001 05:58 PM
04-19-2001 05:58 PM
Re: How can I remove a file called -p (from touch -p)
Had to jump in on this one. Seems like a beginners question so I check the man page and guess what I found:
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
Regards,
Peggy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2001 10:38 PM
04-19-2001 10:38 PM
Re: How can I remove a file called -p (from touch -p)
#ls -li
#find $DIR -type f -inum xxx -exec rm {} \;
federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2001 05:16 AM
04-20-2001 05:16 AM
Re: How can I remove a file called -p (from touch -p)
rm "-p"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2001 07:10 AM
04-20-2001 07:10 AM
Re: How can I remove a file called -p (from touch -p)
# touch -- '-r *'
how would you remove it? NOTE: don't try this on your production boxes ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2001 09:14 AM
04-20-2001 09:14 AM
Re: How can I remove a file called -p (from touch -p)
Both commands work (say -p is in /opt):
cd /opt
rm -- -p
or
rm /opt/-p
rm -i and answering "n" to all but the one you want to remove also works but takes to long and can be dangerous (could remove wrong files).
peg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2001 11:58 AM
04-22-2001 11:58 AM
Re: How can I remove a file called -p (from touch -p)
Here's the other thread on remove files with "-" : http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x0c87dfe5920fd5118fef0090279cd0f9,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2001 09:50 PM
04-22-2001 09:50 PM
Re: How can I remove a file called -p (from touch -p)
the assign of points but this is unfortunatley
not possible
Wahl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2001 10:26 PM
04-22-2001 10:26 PM
Re: How can I remove a file called -p (from touch -p)
rename the file and remove
i.e # mv -p x
# rm x