Voting in der Community ⬆️⬇️

Wenn euch Beiträge von anderen Usern gefallen, könnt ihr dies durch eine positive Bewertung zeigen und wenn ihr angemeldet seid, so sogar Punkte vergeben. Erfahrt hier mehr zu unserem Bewertungssystem: Voting in der deutschen Apple Support Community


Thread wurde vom System oder vom Community-Team geschlossen.

Terminal: wildcard "?" not working

Hi, this is the problem (example):


matthias-mbp: local mvdigit$ ls

btx_1.jpg btx_2.jpg btx_3.jpg

matthias-mpb: local mvdigit$ ls btx_?.jpg

ls: btx_?.jpg: No such file or directory


So it seems the ?-wildcard is not accepted, which is peculiar because only a couple of days before everything worked just fine.


MacBook Pro; macOS High Sierra 10.13.1


I would appreciate any help, thank you!

MacBook Pro mit Retina display, macOS High Sierra (10.13.1)

Gepostet am 02. Nov. 2017 18:34

Antworten
Frage gekennzeichnet als Beste Antwort

Gepostet am 05. Nov. 2017 18:44

Hi again!

Inspired by your "\"-method and grinding my teeth about this almost irrelevant, but still very annoying problem I finally found the answer:

There is the folder "iphone5s", containing a lot of photos and duplicates of those photos: for example

IMG_1983.jpg

IMG_1983(1).jpg

IMG_1984.jpg

IMG_1984(1).jpg

...and so on


ls img_1983.jpg gives me

IMG_1983.jpg

ls img_198?.jpg gives me

'no such file'

ls IMG_198?.jpg gives me (yep!)

IMG_1983.jpg

... so is it case sensitive at least when using the wildcard!

but

ls IMG_????(?).jpg gives me

'syntax error'

ls IMG_????\(?\).jpg (your proposition!)

finally gives me what I want: all my photo duplicates in this directory with file format IMG_xxxx(x).jpg!


So finally it seems my problem is solved!

Thank you again for your inspiration and help!

Happy again,

Matthias

5 Antworten
Frage gekennzeichnet als Beste Antwort

05. Nov. 2017 18:44 als Antwort auf Leonie

Hi again!

Inspired by your "\"-method and grinding my teeth about this almost irrelevant, but still very annoying problem I finally found the answer:

There is the folder "iphone5s", containing a lot of photos and duplicates of those photos: for example

IMG_1983.jpg

IMG_1983(1).jpg

IMG_1984.jpg

IMG_1984(1).jpg

...and so on


ls img_1983.jpg gives me

IMG_1983.jpg

ls img_198?.jpg gives me

'no such file'

ls IMG_198?.jpg gives me (yep!)

IMG_1983.jpg

... so is it case sensitive at least when using the wildcard!

but

ls IMG_????(?).jpg gives me

'syntax error'

ls IMG_????\(?\).jpg (your proposition!)

finally gives me what I want: all my photo duplicates in this directory with file format IMG_xxxx(x).jpg!


So finally it seems my problem is solved!

Thank you again for your inspiration and help!

Happy again,

Matthias

05. Nov. 2017 18:16 als Antwort auf Leonie

Hi Leonie,


thank you very much for your input. Unfortunately '\_' did not solve the problem.

As for the terminal shell - bash: I use the standard terminal app from macOS high sierra anyway.

The ?-wildcard does seems to work as it should do in another folder on my system, what puzzles me even more... Can ist be directory-dependent? Directory permissions are drwxrwrwx - but as far as my very small understanding of bash goes this can not have anything to with the problem.

So once again - thank you!


Matthias

Terminal: wildcard "?" not working

Willkommen in der Apple Support Community
Ein Forum, in dem Apple-Kunden sich gegenseitig mit ihren Produkten helfen. Melde dich mit deiner Apple-ID an, um Mitglied zu werden.