如何获取fish中文件父目录的完整路径?

How to get the full path of the parent dir of a file in fish?

在 fish 中,假设我有一个来自某处的文件路径:

/aaa/bbb/ccc.txt

如何获取其父目录的完整路径?所以我会得到:

/aaa/bbb

这是 dirname 命令,它是一个 Unix 实用程序,不特定于 fish。

例如,cd (dirname /aaa/bbb/ccc.txt)