- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- removing odd named file containing non-printing ch...
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
09-30-2015 02:09 AM
09-30-2015 02:09 AM
Good morning ,
We have an odd named filename (q! ) below which was accidentally created through a VI editing session . and which we're now struggling to remove. if i list the 'filename' (inc nonprinting characters)) it displays the following
'filename'.
#ll -lsqb
-rw-r--r-- 1 root sys 540 Sep 29 15:43 \177q!
Could someone please suggest a method I could employ to safely remove (or rename) this file ?
thanks
Paul
Solved! Go to Solution.
- Tags:
- unprintable chars
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2015 05:17 AM
09-30-2015 05:17 AM
Re: removing odd named file containing non-printing characters
If you can tolerate a little interactivity:
rm -i *'q!'
If:
ls *'q!'
shows only one file, then the "-i" isn't really needed.
> [...] (or rename) [...]
That may harder. "mv" has a "-i" option, but (typical of UNIX) it
has different semantics. If you can find a wildcard expression which
catches only the target file, then it's easy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2015 02:44 PM - edited 09-30-2015 02:45 PM
09-30-2015 02:44 PM - edited 09-30-2015 02:45 PM
Re: removing odd named file containing non-printing characters
Another approach is to delete by inode number:
ls -li *q!
4739 ...
then use find to locate the file by inode number and perform the rm:
find . -inum 4739 -exec rm -i {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2015 11:35 PM - edited 09-30-2015 11:40 PM
09-30-2015 11:35 PM - edited 09-30-2015 11:40 PM
Solution>-rw-r--r-- 1 root sys 540 Sep 29 15:43 \177q!
This is a Del char. So you can simply type: rm -i ?q!
And hopefully there is only one.
Or you could use tr(1) to get that Del:
$ rm -i $(echo "Aq!" | tr "A" '\177')
Or
$ mv $(echo "Aq!" | tr "A" '\177') bad_file
Or look at the tag cloud:
http://h30499.www3.hp.com/t5/tag/unprintable%20chars/tg-p/category-id/operating_systems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2015 07:33 AM
10-01-2015 07:33 AM
Re: removing odd named file containing non-printing characters
many thanks for the feedback provided. I didn't realise that this was a DEL char but the workaround provided worked fine. thanks also to everyone else that provided feedback.