You are not logged in.
Pages: 1
Hi please help me, this drives me crazy:
I just want to know how to uppercase all files and directories recursive in a folder.
I search for it more than one hour, but nothing works. I already think the "rename" command in arch is a different one.
Last edited by xafnir (2019-09-06 06:00:56)
Offline
You can use `find` to identify all the files rercursively, and then bash's parameter expansion to make them all upper case (^).
Not an Arch discussion, moving to NC...
Also, did you do any searching at all? Google has like 200,000 results for this query.
Offline
Yes, I tried googling the whole time. Nothing works.
Everytime I try to use the "rename" command, the base tell me that a parameter is missed
Offline
Nothing works.
Offline
Ok, No I got it working. In arch I have to install "perl-rename" first.
# toUpperCase folders and files
find . -depth -exec perl-rename -v 's!/([^/]*/?)$!\U/$1!' {} +
# toUpperCase only folders
find . -depth -type d -exec perl-rename -v 's!/([^/]*/?)$!\U/$1!' {} +
# toUpperCase only files
find . -type f -exec perl-rename -v 's/(\w+).(\w+)$/\U$1\E.\U$2/' {} \;Offline
No, you don't… google harder.
Offline
What is wrong with the command? For me the problem is solved :-)
Offline
There's nothing wrong with the command, but with the assessment "In arch I have to install "perl-rename" first."
You don't.
There're many ways to skin this cat and most of them do not require stuff outside the base packages (or, actually, just bash)
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline
The most time I read I have to use rename '....'. I didn't know that the command in arch has a different name ('perl-rename'), until i read it in a very small post.
Anyway , I want to sorry, if I was to impatient.
Thanks for the info. The thread is solved.
Offline
No, it doesn't.
$ pacman -Qo rename
/usr/bin/rename is owned by util-linux 2.33.1-2"perl-rename" is something different and you don't "have to" use either.
Offline
Pages: 1