linux - 在fish shell中定义别名

我想在fish中定义一些别名。显然应该可以在

中定义它们
~/.config/fish/functions

但是当我重新启动 shell 时它们不会自动加载。有什么想法吗?

最佳答案

只需使用别名。这是一个基本示例:

# Define alias in shell
alias rmi "rm -i"

# Define alias in config file ( `~/.config/fish/config.fish` )
alias rmi="rm -i"

# This is equivalent to entering the following function:
function rmi
    rm -i $argv
end

# Then, to save it across terminal sessions:
funcsave rmi

最后一条命令创建文件~/.config/fish/functions/rmi.fish

有兴趣的人可以在the official manual 中了解更多关于 fish 别名的信息。 .

https://stackoverflow.com/questions/2762994/

相关文章:

linux - 如何在 grep 中抑制二进制文件匹配结果

python - Python 的 any 和 all 函数是如何工作的?

linux - 有没有办法按列 'uniq'?

linux - 如何在linux中设置环境变量LD_LIBRARY_PATH

python - 浅拷贝、深拷贝和普通赋值操作有什么区别?

linux - CLOCK_REALTIME 和 CLOCK_MONOTONIC 的区别?

python - 使用 Python 的 os.path,我如何上一个目录?

python - 在 Python 中将字符串日期转换为时间戳

python - 如何检查我是否在 Python 中的 Windows 上运行?

linux - 如何在 Linux VM 的控制台上向上/向下滚动