- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Delete Folder without name
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
06-12-2015 10:41 AM
06-12-2015 10:41 AM
Re: Delete Folder without name
I did test the recommendation.
Here's the screen captures:
# stty speed 38400 baud; -parity hupcl intr = ^C; erase = ^H; kill = ^U; swtch <undef>; susp = ^Z; dsusp = ^Y; brkint -inpck icrnl ixoff onlcr tab3 -iexten echo -echoe echok -echoctl -echoke # mkdir ^H (this was: mkdir \<bs>, the shell shows ^H) # ll -db ? drwxr-xr-x 2 root sys 96 Jun 12 13:24 \010 # rmdir ? # ll -db ? ? not found
This was repeated on 10.20, 11.00, 11.11, 11.23 and 11.31, PARISC and IA systems.
One could also just rmdir -i ? in case there are several one-character directories.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2015 05:24 PM
06-13-2015 05:24 PM
Re: Delete Folder without name
> Think again? If "stty -a" says "erase = ^H", then a backspace will
> erase the previous character, which can easily be a backslash. So long
> as the terminal interface treats certain a character as special, the
> shell won't see it. [...]
I must have been thinking of VMS, where the terminal driver deals
with this stuff, not the command-line interpreter (shell analogue). On
a UNIX(-like) OS, the shell apparently does all the work. Which is the
crucial fact.
> # mkdir ^H
> (this was: mkdir \<bs>, the shell shows ^H)
Exactly. The _shell_ shows "^H". You're just using the wrong shell.
Around here, for example, "\<bs>" can look like yours or mine,
depending:
dyi# /sbin/sh
dyi# ^H
But:
dyi# /usr/local/bin/bash
dyi#
> This was repeated on [...]
Yeah. I tried it here on AIX, GNU/Linux (Debian), HP-UX, Solaris,
and Tru64, and I got the (my) expected result everywhere, too, but I use
"bash" everywhere. (On HP-UX, the root user uses it only when it's
available, of course.) So, perhaps neither of us is a complete moron,
after all. (Or perhaps both?)
> > Everything's complicated.
That remains true, I claim.
For the record:
dyi# uname -a
HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 02:39 AM
06-15-2015 02:39 AM
Re: Delete Folder without name
Thank you very much for your information.
I tried but I failed ;-(
# rm -i *
Didn’t work, backslash-folder didn’t appear.
# rm -ir *
directory: ? (y/n) y
: ? (y/n) y
rm: directory not removed. Directory not empty
# rmdir -i ?
?: ? (y/n) y
rmdir: ?: No such file or directory
# rmdir -i \^H
: ? (y/n) y
rmdir:: Directory not empty
(^H is my real backslash and not ^ and H)
PS:
# ll -ld ?
Is working. Sorry, I forgot question mark.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 03:36 AM - edited 06-15-2015 03:38 AM
06-15-2015 03:36 AM - edited 06-15-2015 03:38 AM
Re: Delete Folder without name
>> # rmdir -i \^H
>> : ? (y/n) y
>> rmdir:: Directory not empty
OK, there is something in the directory. rmdir just removes empty directories.
So this should work OK:
# rm -ir \<bs>
where <bs> is the backspace character. It will appear as ^H which is the shell's way of displaying the backspace.
If this still says directory not empty, let's see what is in that directory:
# ll -b \<bs>
There may other directories or files with bad characters.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 03:56 AM
06-15-2015 03:56 AM
Re: Delete Folder without name
>> The _shell_ shows "^H". You're just using the wrong shell.
Actually, the vast majority of HP-UX systems run /sbin/sh as the root shell since this is the only functional shell in single user mode (archived libraries). If the root shell is changed to ksh, csh or BASH, the system will not have a usable shell in single user mode (a critical problem as single user mode usually means there is already a problem to solve). The rest of the users start with /usr/bin/sh (the POSIX shell, not Bourne), or may use chsh to change to /usr/bin/ksh. BASH is not part of the HP-UX distribution so it must be downloaded and installed -- assuming that data center policies allow open source tools like BASH. Where BASH is allowed, sysadmins will login as ordinary users with the BASH shell, then use sudo for root commands. Or they may simply run BASH after logging either with exec or as a child process. Supporting thousands of HP-UX servers in dozens of data centers, the standard tools (ie, POSIX shell, vi, etc) are always there. BASH has a number of useful features but availability to other data centers is not guarantied.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 10:01 AM - edited 07-15-2015 10:07 PM
06-15-2015 10:01 AM - edited 07-15-2015 10:07 PM
Re: Delete directory with backspace in name
>So this should work OK: rm -ir \<bs>
Since this works, you could simply rename the directory:
# mv \<bs> better-name
And in ksh and sh and vi, you can use control-V before the backspace.
- « Previous
-
- 1
- 2
- Next »