Linux command to list all available commands and aliases

前端 未结 20 2373
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 14:11

Is there a Linux command that will list all available commands and aliases for this terminal session?

As if you typed \'a\' and pressed tab, but for every letter of

20条回答
  •  时光说笑
    2020-11-29 15:01

    Try this script:

    #!/bin/bash
    echo $PATH  | tr : '\n' | 
    while read e; do 
        for i in $e/*; do
            if [[ -x "$i" && -f "$i" ]]; then     
                echo $i
            fi
        done
    done
    

提交回复
热议问题