很高兴你找到了它,但这里有一种方法可以查看一般意义上的所有登录文件:
# run strace, see every syscall
strace -o /tmp/bash.out bash --login
Run Code Online (Sandbox Code Playgroud)
(从 bash shell 退出)
# filter out opens that returned a descriptor, then use sed to get the file
< /tmp/bash.out grep -o 'open("[^,]*,[^)]*)[ \t]=[ \t][0-9]' | sed -e 's/^[^"]*"//' -e 's/".*$//' | sort -u > /tmp/openedfiles.txt
# grep for the broken alias, or whatever
< /tmp/openedfiles.txt xargs grep '^[ \t]*lias'
Run Code Online (Sandbox Code Playgroud)
如果您知道如何使用它,strace 是那些可以成为魔术的命令之一。