usernameunnecessary@lemmy.ziptoAsk Lemmy@lemmy.world•Linux question: I like to browse using ls. Than when I find what I'm looking for, I would like to directly move there with cd without having to retype the path. Is there an elegant solution for that?
10·
4 days ago^ls^cd
will do exactly what you want, replace ls with cd from the previously run command
In addition to
^ls^cdI mentioned in another comment, I highly recommend you try “z”, installable on macos via “brew install z” (not sure if it’s available on linux package managers). Suppose you want to jump to ~/Desktop/project1/foo, you can just type “z foo”. It works without a full path, from anywhere, as long as you cd’d in there at least once.