1

I want to find all symbolic links in the current directory and below. Therefore, I used:

find . -type l

Running that clears the screen showing "Pattern not found (press RETURN)" at the bottom of the screen. After pressing return, I get:

find: missing argument to `-type'

Here some system details:

  • Ubuntu 10.04 LTS 64Bit
  • zsh 4.3.10 (x86_64-unknown-linux-gnu)
  • happens also in Screen version 4.00.03jw4 (FAU) 2-May-06
  • find (GNU findutils) 4.4.2

So how do I search for symbolic links so that I can grep in their names?

5
  • Is this working? find . -type l -print
    – pl1nk
    May 31 '12 at 9:27
  • 1
    Wow, that's odd. Do you get the same issue under bash? Looks like your shell is dropping the last argument. May 31 '12 at 9:32
  • No, it also gives the same error message. It is a bit strange, because it first clears the whole screen showing "Pattern not found (press RETURN)" and after pressing return, it shows "find: missing argument to -type"
    – Sebi
    May 31 '12 at 9:32
  • 1
    @JeremyKerr Ah, found it! I have in my .zshrc the following: alias -g l='| less'
    – Sebi
    May 31 '12 at 9:35
  • you should answer your own question and then accept your answer. That way everyone knows that this question is solved.
    – xubuntix
    May 31 '12 at 9:41
2

It turned out that the problem was because of a zsh alias defined as l:

alias -g l='| less'

As a result, zsh interpreted the l in

find . -type l

not as the type to look for, but expanded it to:

find . -type | less
2
  • Please mark this as the answer.
    – saji89
    May 31 '12 at 17:03
  • @saji89 You have to wait 2 days before you can mark an answer as correct.
    – Sebi
    Jun 1 '12 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.