- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - HP-UX
- >
- System Administration
- >
- Re: removing odd named file containing non-printin...
-
-
Forums
- Products
- Servers and Operating Systems
- Storage
- Software
- Services
- HPE GreenLake
- Company
- Events
- Webinars
- Partner Solutions and Certifications
- Local Language
- China - 简体中文
- Japan - 日本語
- Korea - 한국어
- Taiwan - 繁體中文
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Blog, Poland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2022 Hewlett Packard Enterprise Development LP