You are not logged in.

#1 2019-09-05 20:50:47

xafnir
Member
Registered: 2019-08-01
Posts: 14

[SOLVED] files toUpperCase

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

#2 2019-09-05 20:58:11

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] files toUpperCase

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.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-09-05 21:13:05

xafnir
Member
Registered: 2019-08-01
Posts: 14

Re: [SOLVED] files toUpperCase

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

#4 2019-09-05 21:16:46

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] files toUpperCase


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2019-09-05 21:19:31

xafnir
Member
Registered: 2019-08-01
Posts: 14

Re: [SOLVED] files toUpperCase

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

#6 2019-09-05 21:22:49

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,400

Re: [SOLVED] files toUpperCase

No, you don't… google harder.

Offline

#7 2019-09-05 21:41:43

xafnir
Member
Registered: 2019-08-01
Posts: 14

Re: [SOLVED] files toUpperCase

What is wrong with the command? For me the problem is solved :-)

Offline

#8 2019-09-05 21:44:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,400

Re: [SOLVED] files toUpperCase

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

#9 2019-09-06 06:00:45

xafnir
Member
Registered: 2019-08-01
Posts: 14

Re: [SOLVED] files toUpperCase

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

#10 2019-09-06 06:09:00

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,400

Re: [SOLVED] files toUpperCase

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

Board footer

Powered by FluxBB