Display only files and folders that are symbolic links in tcsh or bash

后端 未结 11 833
灰色年华
灰色年华 2021-01-30 13:20

Basically I want do the following:

ls -l[+someflags]

(or by some other means) that will only display files that are symbolic links

so t

11条回答
  •  北海茫月
    2021-01-30 14:13

    For (t)csh:

    ls --color=always -ltra | grep '\->'
    

    (This is simply pbr's answer but with the hyphen escaped.)

    Mac OSX

    On OSX, ls works differently, so add this to your ~/.cshrc file:

    setenv CLICOLOR_FORCE 1   # (equivalent of Linux --color=always)
    

    And then call:

    ls -G -ltra | grep '\->'  # (-G is equivalent of ls --color)
    

提交回复
热议问题