How do i find the source of a command in bash?



  • This is a really useful command; to see what types of source(s) for a command, i.e. is is a binary, alias, or function, it can be more than one. For instance dir is an function and a binary.

    $ type -a dir
    dir is a function
    dir () 
    { 
        find . -iname "$@" -exec ls -lh {} \;;
        find . -iname "$@" -print0 | xargs -r0 du -csh | tail -n 1
    }
    dir is /bin/dir
    $ type cat
    cat is hashed (/bin/cat)
    $ type -a ll
    ll is aliased to `ls -alF'
    

Log in to reply
 

© Lightnetics 2024