Để liệt kê các bí danh hoạt động, hãy chạy:
alias
Để xem tên của tất cả các chức năng hoạt động, hãy chạy:
declare -F
Để xem tên và định nghĩa của tất cả các chức năng hoạt động, hãy chạy:
declare -f
Hơn
Thông tin về bí danh cũng có sẵn ở định dạng thân thiện với tập lệnh với:
declare -p BASH_ALIASES
man bashcung cấp thêm thông tin về aliasnội dung:
alias [-p] [name[=value] ...]
Alias with no arguments or with the -p
option prints the list of aliases in the
form alias name=value on standard output.
When arguments are supplied, an alias is
defined for each name whose value is given.
A trailing space in value causes the next
word to be checked for alias substitution
when the alias is expanded. For each name
in the argument list for which no value is
supplied, the name and value of the alias is
printed. Alias returns true unless a name
is given for which no alias has been
defined.
Về các chức năng, man bashgiải thích rằng declarecó thể cung cấp thêm thông tin có sẵn nếu extdebugtùy chọn được đặt:
Function names and definitions may be listed with
the -f option to the declare or typeset builtin
commands. The -F option to declare or typeset will
list the function names only (and optionally the
source file and line number, if the extdebug shell
option is enabled).
Liên kết
- http://ss64.com/bash/alias.html
- http://linfo.org/alias.html