- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need help with a file & directory.
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-25-2002 05:32 AM
04-25-2002 05:32 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:36 AM
04-25-2002 05:36 AM
Re: Need help with a file & directory.
Use:
# cd $HOME
# rm -r -i - you can select the one you need to delete.
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:38 AM
04-25-2002 05:38 AM
Re: Need help with a file & directory.
If you can list it with wildcards - you should be able to delete it - try
ll *.csv
if that works try
rm *.csv
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:39 AM
04-25-2002 05:39 AM
Solutiontry determining which entry is in the directory first (file or sub-dir), then:
cd
now delete "all" files recursively in this directory but do it interactively so you can control the actual deletion action:
rm -i -r *
when the offending entry comes up, answer "Y", otherwise answer "N" to retain all other entries. BE CAREFUL you don't delete the wrong entry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:39 AM
04-25-2002 05:39 AM
Re: Need help with a file & directory.
I have no idea if this will work or not, but you could try doing an 'ls -i' to get to inode numbers and then use find . -inum -exec rm {} \;
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:41 AM
04-25-2002 05:41 AM
Re: Need help with a file & directory.
I have no idea how the file and directory coud have the same name, but...
How about "rm -iR items*" (or whatever wildcard would identify just the file/dir name?
When the prompt comes, it will say "Directory dirname (y/n)?" so you can keep the file and waste the dir.
HTH
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:42 AM
04-25-2002 05:42 AM
Re: Need help with a file & directory.
I'd try using the find command with the inode number. You can see the inode numbers by doing a 'ls -li items.c*'. Once you have the inode number for the file (or directory), you can use find to rename it (or delete it, I prefer to rename them first).
Let's say your inode number for the file is 950, you can do this:
find . -inum 950 -exec mv {} items.file.csv \;
which should rename the file to items.file.csv.
I used to work with a slick young programmer who liked to create a junk directory named '*' in his home directory. I had to resort to this method to get it fixed. As for the young programmer, well, threats of physical violence go a long way towards compliance. :)
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:44 AM
04-25-2002 05:44 AM
Re: Need help with a file & directory.
Do this:
cd to desired directory
ls ite*
If the files are listed then
rm -r -i ite* and confirm the removes. This is safer than
rm -r -i * because you are far less likely to accidently delete the wrong files. However, if the control characters are the first characters then you will be forced to use the
rm -r -i * form. Answer 'y' to each file that you want to remove and 'n' to everything else. As soon as your desired files have been removed, you can simply hit Ctrl-C or whatever your interrupt is set to to terminate the rm command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:44 AM
04-25-2002 05:44 AM
Re: Need help with a file & directory.
Try ls | od -xc
Please post your output from ls -l
Ruediger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:45 AM
04-25-2002 05:45 AM
Re: Need help with a file & directory.
ls -l items.cs* | od -cx
which should show the names in hex and ascii. You might see some extra control characters in the name. I see this sometimes when people are using telnet and try using the left arrow key instead of the backspace.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:46 AM
04-25-2002 05:46 AM
Re: Need help with a file & directory.
ll -b , maybe spaces, erase characters or other non visible char compound the names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 06:14 AM
04-25-2002 06:14 AM
Re: Need help with a file & directory.
directory items.csv
items.csv /u04
items.csv /u04/app
items.csv /u04/app/lawson
items.csv /u04/app/lawson/law
items.csv /u04/app/lawson/law/print
items.csv /u04/app/lawson/law/print/jepker
items.csv /u04/app/lawson/law/print
items.csv /u04/app/lawson/law
items.csv /u04/app/lawson
items.csv /u04/app
items.csv /u04
-------------- at this point the dir was gone
items.csv
"items.csv "
Seems kind of weird, but it worked. I checked each of the /u04 directories before I said yes to make sure there was actually no file/dir named items.csv before I said yes. Once I said yes to the directory items.csv and all the /u04 entries the directory was gone, but not until I said yes to all the /u04 entries. Still couldn't access the file so I deleted the items.csv file and the next entry was items.csv with about 20 blank spaces behind the name ... figured that was the problem so deleted it to. Now the file and directory are gone ... oh well, at least their gone. Thanks for all the help and VERY quick responses!!!