Freewind
Freewind

Reputation: 198218

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

In fish, say I have a file path from somewhere:

/aaa/bbb/ccc.txt

How can I get the full path of its parent dir? So I will get:

/aaa/bbb

Upvotes: 1

Views: 432

Answers (1)

ridiculous_fish
ridiculous_fish

Reputation: 18551

This is the dirname command, and it is a Unix utility, not specific to fish.

For example, cd (dirname /aaa/bbb/ccc.txt)

Upvotes: 3

Related Questions