- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: removing file
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
06-14-2002 06:19 AM
06-14-2002 06:19 AM
I have several files that were created with ^M at the end.
I can see the file, but when I do rm -rf dirName, it says dirName is not found.
If I try to cd dirName I have the same message.
How can I force to remove those files?
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2002 06:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2002 06:23 AM
06-14-2002 06:23 AM
Re: removing file
You can either use rm -i with a wild card (*) and answer no to all the files you're not after or you can do ls > file then edit the file to remove all the files you don't want to remove and put the rm in front of the ones you do.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2002 06:24 AM
06-14-2002 06:24 AM
Re: removing file
Try rm -ir dirName*
# mkdir hdhd^M
# ls -l|grep hdhd
drwxrwxrwx 2 root sys 96 Jun 14 10:13 hdhd
# rm -rf hdhd*
# ls -l hdhd
hdhd not found
# ls -l hdhd*
hdhd* not found
#
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2002 06:25 AM
06-14-2002 06:25 AM
Re: removing file
# cd dir_path
# rm -i * ( delete the ones you wanted to, when prompted)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2002 06:25 AM
06-14-2002 06:25 AM
Re: removing file
you could try rm -rf dirname* where dirname is only part of the real directoryname (without the ^M).
You can also use rm -rf "dirname". Where dirname is the full directoryname including the ^M. You should be able to produce the ^M with:
Hope this helps
Regards Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2002 06:36 AM
06-14-2002 06:36 AM
Re: removing file
Try this,
ls >test_file
vi test_file, remove unwanted entries. For the ones you want to remove, add rm in the front for the files and rm -r or rmdir for the directories. then execute this file,
sh test_file
Hope this helps.
Regds