Re: Find all .desktop files in my system – failed
Johnny Rosenberg
gurus.knugum at gmail.com
Sat Nov 10 10:01:45 UTC 2012
2012/11/10 Tony Arnold <tony.arnold at manchester.ac.uk>:
> Johnny,
>
> On 10/11/12 08:59, Johnny Rosenberg wrote:
>> I'm not sure what I'm doing wrong here (I am a beginner too, since a
>> few years back…), but obviously I misunderstood the find command
>> completely:
>> ~$ sudo find / -iname *.desktop 2>/dev/null
>> /home/guraknugen/examples.desktop
>> /home/video/examples.desktop
>> /etc/skel/examples.desktop
>> ~$
>>
>> But, in /usr/share/applications/ there are loads of .desktop files.
>> Why are they not found?
>>
>> Then I tried this:
>> ~$ cd /usr/share/applications/
>> applications$ sudo find . -iname *.desktop 2>/dev/null
>> applications$
>>
>> Then:
>> applications$ sudo find . -iname *.desktop
>> find: paths must precede expression: anjuta.desktop
>> Usage: find [-H] [-L] [-P] [-Olevel] [-D
>> help|tree|search|stat|rates|opt|exec] [path...] [expression]
>> applications$
>>
>> I am not sure I understand the error message. Path must precede
>> expression, yes, but isn't that exactly the case?
>>
>> Confused…
>
> You need to escape the * int he name part or put the name part in
> quotes. Otherwise, the shell will epand the wild card and pass the found
> names to find which is not what you want. Thus:
>
> sudo find / -iname '*.desktop' 2>/dev/null
I am not sure what you mean (maybe because English is not my main language).
”Escape the * in the name part”
If I understand that correctly, this should work:
sudo find / -iname \*.desktop 2>/dev/null
And it does. So far so good.
”Or put the name part in quotes”
Shouldn't that mean something like
sudo find / -iname *".desktop" 2>/dev/null
rather than
sudo find / -iname "*.desktop" 2>/dev/null
Because * is not the ”name part”, is it?
But obviously not, since that does not work…
Anyway, I know what to do now, which is the main thing in this case.
Thanks for your help.
Kind regards
Johnny Rosenberg
ジョニー・ローゼンバーグ
>
> Regards,
> Tony.
> --
> Tony Arnold, Tel: +44 (0) 161 275 6093
> Head of IT Security, Fax: +44 (0) 705 344 3082
> University of Manchester, Mob: +44 (0) 773 330 0039
> Manchester M13 9PL. Email: tony.arnold at manchester.ac.uk
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
More information about the ubuntu-users
mailing list