LakeEffect
LakeEffect

Reputation: 547

In terminal how do i quickly move to directory

How do I most efficiently move to directory if there are many embedded folders? Currently I, cd into folder, ls, the cd into folder 2 and so forth until I find the folder I need. Is there a faster way to complete this task. A way to find the files in a specific main directory.

Upvotes: 1

Views: 1183

Answers (2)

Sam Toliman
Sam Toliman

Reputation: 123

You can try https://pypi.org/project/fastcd. It stores recently visited directories and allow to cd to the desired one.

Upvotes: 0

Nir Alfasi
Nir Alfasi

Reputation: 53545

If you know where you're going you can create an alias that'll take you to the requested directory, for example, in bash:

alias dir="cd /path/to/your/directory"

Add this alias to your dot-files and it'll be loaded whenever you open a shell, then all you'll have to do is type "dir" and hit Enter.

Another option that can help you locate the directory in case you don't know what it is - but you know a specific filename of a file that lives under that directory is to use:

find . -name filename

to find the file (with its full path).

Upvotes: 2

Related Questions