Fish Shell - 找不到將“la”定義為“ls -la”的位置

Fish Shell - 找不到將“la”定義為“ls -la”的位置

在我的 Mac 和 Ubuntu 上,當我在 Fish Shell 中輸入“la”時,我收到的輸出與“ls -la”的輸出相同。我想我可能已經將它定義為一個函數。但是,我找不到“la”被定義為別名、縮寫或函數。

我檢查了 .config/fish/functions、fish.prompt.fish、config.fish、which 以及 Fish 文件和命令。

我錯過了什麼?關於「la」可以在哪裡定義有什麼想法嗎?

答案1

type命令是解決此類問題的好幫手:

$ type la
la is a function with definition
# Defined in /usr/local/share/fish/functions/la.fish @ line 4
function la --description 'List contents of directory, including hidden files in directory using long format'
    ls -lah $argv
end

這告訴我la這是魚分佈中包含的標準函數。 Fish 還包含一個ll功能ls -lh

相關內容