- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Reading and then deleting files that have invisibl...
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-22-2008 12:45 PM
тАО09-22-2008 12:45 PM
Reading and then deleting files that have invisible charcaters in their names
We have several files that have titles where there are invisible characters. One example of this would be a file that has the delete key character in its name. These are files that were created by mistake.
How can I go about reading what is in these files, and then subsequently removing them? Thanks.
- Tags:
- unprintable chars
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2008 12:52 PM
тАО09-22-2008 12:52 PM
Re: Reading and then deleting files that have invisible charcaters in their names
If the file is file
# more file*1
or
# more fi*1
Just experiment until you get the right combination.
To delete just supply the same wildcard name you used above. I would use the '-i' option to 'rm' so it will ask you if you are sure you want to delete.
# rm -i fi*1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2008 01:15 PM
тАО09-22-2008 01:15 PM
Re: Reading and then deleting files that have invisible charcaters in their names
Another way to handle files like this is to find their inode number with 'ls' and use that to read and/or remove them:
# cat /etc/hosts >> "/tmp/bad file "
# ls -i /tmp/bad*
7130 /tmp/bad file
# find /tmp -xdev -inum 7130 -exec cat {} \;
...lists the file's contents...
# find /tmp -xdev -inum 7130 -exec rm -i {} \;
...removes the file...
Remember that an inode value is only unique within a filesystem!
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2008 07:20 PM
тАО09-22-2008 07:20 PM
Re: Reading and then deleting files that have invisible charcaters in their names
Here are a bunch of other threads that tell you how to remove or rename the file/directory:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1255548
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1180587
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1161638
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=954241
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=486327
>would be a file that has the delete key character in its name.
If you have the right stty setting, DEL is just a normal char that you can enter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2008 08:46 PM
тАО09-23-2008 08:46 PM
Re: Reading and then deleting files that have invisible charcaters in their names
Normally to find out and delete the file i am using winscp from an windows system. This graphic based scp tool will give the actual file name with all the junk characters. I am renaming or deleting the file through this tool.
Manoj K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2008 10:44 PM
тАО09-23-2008 10:44 PM
Re: Reading and then deleting files that have invisible charcaters in their names
#ls -lrt>file1
#vis file1 this should show you invisible characters in the file name.
now delete all the files which are bad.Be sure to use
single coats else could affect other files if they share same format of name.
rm 'file'
BR,
Kapil+
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2008 10:53 PM
тАО09-23-2008 10:53 PM
Re: Reading and then deleting files that have invisible charcaters in their names
The best option is remove this type of junk character or hidden character file from a directory is:
go to the respective directory
rm -i *
then one by one it will ask for delete or not ................
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2008 12:15 AM
тАО09-24-2008 12:15 AM
Re: Reading and then deleting files that have invisible charcaters in their names
... or use the file manager of CDE and move the file to the trash.
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 04:58 AM
тАО09-25-2008 04:58 AM
Re: Reading and then deleting files that have invisible charcaters in their names
from your profile:
You have assigned points to 127 of 649 responses to your questions.
Please read this one:
http://forums12.itrc.hp.com/service/forums/helptips.do?#28
V.