- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Remove a directory with no name
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-17-2007 01:39 AM
тАО09-17-2007 01:39 AM
Our developers ran a script on the weekend which they created in windows...somehow it got screwed up (I imagine with a ^M somewhere) and they created a directory with 1GB of files in it but the directory has no name. How can I remove it?
root:/data# ll
total 60546
drwxr-xr-x 2 usrx1 ind 666624 Sep 16 12:39
-rw-r--r-- 1 user2 dba 26421 Sep 8 06:02 03964402.dfc
-rw-r--r-- 1 root sys 9563647 Sep 12 09:57 11Sep07_dat.zip
-rw-r--r-- 1 root sys 19880461 Sep 12 09:57 11Sep07_tif.zip
-rw-r--r-- 1 usrx1 ind 0 Sep 15 23:46 NULL
See how there is no name for the very first entry?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2007 01:45 AM
тАО09-17-2007 01:45 AM
Re: Remove a directory with no name
I assume that ^M are two spaces.
so try this with two spaces:
$rmdir -- " "
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2007 01:46 AM
тАО09-17-2007 01:46 AM
Re: Remove a directory with no name
find /start_dir -type d -exec rm -rfi {} ;\
Then reply n to any legitimate directories and y to this bogus one.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2007 01:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2007 02:01 AM
тАО09-17-2007 02:01 AM
Re: Remove a directory with no name
Also, if there are not too many files in the directory it's in, you can do "rm -ri *" and answer no to all but the offendict dir.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2007 02:01 AM
тАО09-17-2007 02:01 AM
Re: Remove a directory with no name
Also, if there are not too many files in the directory it's in, you can do "rm -ri *" and answer no to all but the offending dir.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2007 02:05 AM
тАО09-17-2007 02:05 AM
Re: Remove a directory with no name
When I outputted ls -l to a file, here is what it gave...what I suspected in my above post:
total 60546
drwxr-xr-x 2 indusrx1 ind 666624 Sep 17 10:03 ^M
I would prefer to blow away the whole directory without being prompted for each file because there are hundreds of files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2007 02:08 AM
тАО09-17-2007 02:08 AM
Re: Remove a directory with no name
Thanks everyone who replied.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2007 03:28 PM
тАО09-17-2007 03:28 PM
Re: Remove a directory with no name
You could also move all of the good files out of the directory that contains the bad name, then rename that directory, and put the good files back. Then remove the directory with the bad file.
If the name actually had a CR, you can write a script using vi and control-V and CR and then remove only that directory.