In a directory with directories blog-1, blog-2, ... , blog-9, I was
trying to rename the directories, but I accidentally hit the RETURN
key after typing only "mv blog-*".˙ Now, blog-1, blog-2, ... , blog-8
have disappeared, but blog-9 remains.
Where did I send the directories?
RLH
On 2/19/26 20:30, Russell L. Harris wrote:
In a directory with directories blog-1, blog-2, ... , blog-9, I was
trying to rename the directories, but I accidentally hit the RETURN
key after typing only "mv blog-*".?? Now, blog-1, blog-2, ... , blog-8
have disappeared, but blog-9 remains.
Where did I send the directories?
RLH
blog-1 through blog-8 should be in directory blog-9.
David
From now on, I need to type in "xmv ..." and backspace to remove the xonly once my arguments are correct.
On Thu, Feb 19, 2026 at 08:43:52PM -0800, David Christensen wrote:
On 2/19/26 20:30, Russell L. Harris wrote:
In a directory with directories blog-1, blog-2, ... , blog-9, I was
trying to rename the directories, but I accidentally hit the RETURN
key after typing only "mv blog-*".?? Now, blog-1, blog-2, ... , blog-8
have disappeared, but blog-9 remains.
<snip>
blog-1 through blog-8 should be in directory blog-9.
<snip>
So they are!˙ I thank you, David.˙ You have saved me much grief.
From now on, I need to type in "xmv ..." and backspace to remove the x
only once my arguments are correct.
Hi David: You mention "rename" when I was in DOS they had an "ren" which I wish
I had in Debian, as it handled wild-cards really well. I could type
ren *.txt *.cnn
Sure wish we had something simple like that. Thanks in advance
Chime
Hi David: You mention "rename" when I was in DOS they had an "ren" which I wish
I had in Debian, as it handled wild-cards really well. I could type
ren *.txt *.cnn
Sure wish we had something simple like that. Thanks in advance
Chime
Check out the Perl rename utility (written by Larry Wall) which has
been renamed "file-rename".
Everyone ought have a copy of the wonderful O'Reilly book "Learning
Perl".
Hi David: You mention "rename" when I was in DOS they had an "ren" which I wish
I had in Debian, as it handled wild-cards really well. I could type
ren *.txt *.cnn
Sure wish we had something simple like that. Thanks in advance
hobbit:/tmp$ touch 1.foo 2.foo 3.foo
hobbit:/tmp$ rename 's/\.foo$/.bar/' *.foo
I have to nitpick:
While this non-interpration of wildcards is true for programs like cp
or mv, other programs interpret wildcards if they appear in arguments.
In this case the shell has to be kept from expanding the wildcards.
hobbit:~$ cd /tmp
hobbit:/tmp$ touch 1.foo 2.foo 3.foo
hobbit:/tmp$ rename 's/\.foo$/.bar/' *.foo
hobbit:/tmp$ ls -l [123]*
-rw-rw-r-- 1 greg greg 0 Feb 20 07:16 1.bar
-rw-rw-r-- 1 greg greg 0 Feb 20 07:16 2.bar
-rw-rw-r-- 1 greg greg 0 Feb 20 07:16 3.bar
It's not quite as simple as you wanted, but it'll get the job done.
There's a great deal *more* it can do as well.
And speaking of wild-cards, unzip will not handle them
Chime Hart (HE12026-02-20):
And speaking of wild-cards, unzip will not handle them
Just checked, it absolutely handles them. ? will let it extract files
named a and b but not cd.
unzip *.zip
it only handled the first file, unlike unp which handled all zip files.
didn't use any switches, but I should say I am in TCSH, if that changes things.
Well Nicolas, when I ran
unzip *.zip
it only handled the first file, unlike unp which handled all zip files.
Hi Greg: All your examples make sense, but you either haven't installed unp or
are not familliar with it?
I find it quite helpful when extracting multiple
.rar files, however, it works better if I were to run
unp *part01.rar
if I use *.rar it will seemingly go in a loop-and-extract individual files a
2nd time.
Hi David: You mention "rename" when I was in DOS they had an "ren" which I wishUsually not because the "culture" in Linux/Unix world is that
I had in Debian, as it handled wild-cards really well. I could type
ren *.txt *.cnn
Sure wish we had something simple like that. Thanks in advance
Hi Greg: All your examples make sense, but you either haven't installed unp or
are not familliar with it? I find it quite helpful when extracting multiple .rar files, however, it works better if I were to run
unp *part01.rar
if I use *.rar it will seemingly go in a loop-and-extract individual files a
2nd time. I had only found unp when running a search for such a program which
would handle wild-cards.
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 5 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 119:49:28 |
| Calls: | 125 |
| Calls today: | 125 |
| Files: | 489 |
| D/L today: |
859 files (365M bytes) |
| Messages: | 76,568 |
| Posted today: | 26 |