Ankündigung: Vorbereitung auf macOS Mojave


Dank Funktionen wie dem Dunkelmodus, Stapeln und vier neuen integrierten Apps kannst du unter macOS Mojave mit einem Klick noch mehr erreichen. Auf macOS Mojave vorbereiten > https://support.apple.com/de-de/macos/mojave

Frage:

Frage: 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

Antworten
Frage gekennzeichnet als Gelöst
Antwort:
Antwort:

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

Gepostet am

Frage gekennzeichnet als Hilfreich

05. Nov. 2017, 18:49 als Antwort auf mvdigit Als Antwort auf mvdigit

Hey mvdigit,

Thanks for posting your question in the German Apple Support Communities. We have a Community for native English speakers here: https://discussions.apple.com/welcome



Please feel free to join and post your question there.


Have a great day.

Diese Unterhaltung geht noch weiter.

Alle Antworten lesen

Seiteninhalt wurde geladen

Frage gekennzeichnet als Hilfreich

05. Nov. 2017, 18:49 als Antwort auf mvdigit Als Antwort auf mvdigit

Hey mvdigit,

Thanks for posting your question in the German Apple Support Communities. We have a Community for native English speakers here: https://discussions.apple.com/welcome



Please feel free to join and post your question there.


Have a great day.

05. Nov. 2017, 18:49

Antworten Hilfreich (1)

05. Nov. 2017, 13:28 als Antwort auf mvdigit Als Antwort auf mvdigit

The command


ls btx_?.jpg


is working for me on High Sierra. Which shell are you using in the Terminal?


Try to escape the underscore character with a backslash. Perhaps the shell you are using is interpreting the underscore in a special way.

% ls btx\_?.jpg

btx_1.jpg btx_2.jpg

05. Nov. 2017, 13:28

Antworten Hilfreich

05. Nov. 2017, 18:16 als Antwort auf Leonie 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

05. Nov. 2017, 18:16

Antworten Hilfreich
Frage gekennzeichnet als Hilfreich

05. Nov. 2017, 18:49 als Antwort auf mvdigit Als Antwort auf mvdigit

Matthias,

does this work in your folder?


ls btx*.jpg


or

ls btx*.*


Just to check, if the files can be found at all. perhaps there are visible characters in the filename. then the * wildcard should catch them.

05. Nov. 2017, 18:49

Antworten Hilfreich (1)
Frage gekennzeichnet als Gelöst

05. Nov. 2017, 18:44 als Antwort auf Leonie 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:44

Antworten Hilfreich
Benutzerprofil für Benutzer: mvdigit

Frage: Terminal: wildcard "?" not working