- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need to remove file named @
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
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
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
08-08-2012 02:53 PM
08-08-2012 02:53 PM
I've got a file in my root directory called @. I have searched and found references where you find the inode of the file and then remove it using the find command. The ls -il command works fine to find the inode, but I'm leery of the command line they are using to delete the file. They want to use:
root # find . -inum <inode> -exec rm -i {} \;
If I just do
root # find . -inum <inode>
it comes back with several files but none of them are the file (or in the directory) that I want to delete.
Does anyone have a nice, safe way to delete this file? Running HP-UX 11.23.
thanks!
Solved! Go to Solution.
- Tags:
- unprintable chars
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2012 03:33 PM - edited 08-09-2012 11:29 AM
08-08-2012 03:33 PM - edited 08-09-2012 11:29 AM
Re: Need to remove file named with unprintable @
First of all, what is the exact name of the file, since you may have some unprintable chars in it?
ll -b
># find . -inum <inode>
>it comes back with several files but none of them are the file (or in the directory) that I want to delete.
If you only want to search the current filesystem, use: -xdev
Only the current directory:
find . ! -name . -prune -inum <inode>
You could just use rm, if you don't have lots of files with "@" in them: rm -i *@*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2012 06:22 AM
08-09-2012 06:22 AM
Re: Need to remove file named @
This is what I'm seeing. There are other files in the directory, I just omitted them from the ll listing.
># ll
-rw------- 1 root sys 5449 Sep 10 2007 @
># ll -b
-rw------- 1 root sys 5449 Sep 10 2007 \300
># ll @
@ not found
># ll -i "@"
@ not found
># rm -i "@"
rm: @ non-existent
># ll -b "@"
@ not found
># ll -i
3165 -rw------- 1 root sys 5449 Sep 10 2007 @
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2012 09:54 AM
08-09-2012 09:54 AM
Re: Need to remove file named @
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2012 10:27 AM - edited 08-09-2012 10:29 AM
08-09-2012 10:27 AM - edited 08-09-2012 10:29 AM
Re: Need to remove file named @
You wrote:
># ll -rw------- 1 root sys 5449 Sep 10 2007 @ ># ll -b -rw------- 1 root sys 5449 Sep 10 2007 \300
The -b option shows characters in the filename that are not part of the displayable ASCII characters. In this case, \300 means octal 300. From the man page for ascii, you can see that 100 octal is indeed the @ character, but if the parity bit is on, then the octal value is 300. So most terminal emulators will show octal 100 and 300 the same way as @. The reason that you can't remove it is that you are typing @ from your keyboard and the parity bit is turned off, so the character doesn't match.
So this will take a bit of cleverness to remove. Probably the easiest is to remove one-character files using the -i option like this:
rm -i ?
This will match all one character filenames.
When the rm comand asks if you want to remove @ then you answer yes and the file will be gone.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2012 11:29 AM
08-09-2012 11:29 AM
Re: Need to remove file named with unprintable @
>-rw------- 1 root sys 5449 Sep 10 2007 \300
It looks like you have "@" with the parity bit set.
I don't know if you can cut&paste that 8 bit char but if you can, just use "rm -i paste-char".
Or you can redirect the ll output, delete all lines and words but that char. Then try:
rm -i $( < file)
You could also look into vis(1) & inv(1), tr(1) or awk to get that char.
Did you retry that find suggestion?
Or go with Bill's suggestion of "rm -i ?".
>If you can disrupt access to this directory briefly,
Probably not if it is /. :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2012 12:50 PM
08-09-2012 12:50 PM
Re: Need to remove file named with unprintable @
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2012 02:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2012 02:58 PM
08-09-2012 02:58 PM
Re: Need to remove file named with unprintable @
Thanks Steven. That's exactly the character that showed up in the file manager. Not sure how it got there, but glad to be rid of it.
-Paul