You forgot the pwd after each ‘cd’.
ls*
Ls doesn’t tell them where they are, just what files exist in their current location.
Yup,
But I want to know if the file I’m looking for is in this directory or I have to cd… once more
That’s when locate piped to grep is your best friend.
alias cd..='cd ..' alias cd...='cd ../..' alias cd....='cd ../../.. alias cd.....='cd ../../../..'
Then forget all that and just use
cd ~
orcd /
No need for
~
- justcd
works as well.
for i in { 1…4 }; do cd …; done
i use fish shell with https://github.com/nickeb96/puffer-fish
basically when i type
it expands to
../..
and adds another/..
for every additional dot i typeits similar to what the zsh users in the comment section are doing
I was about to post something similar. With fish you can do your own functions, right? So, you can pass any dots as arguments to a function called
cd
, so, for every extra dot after..
, you append a/..
at the end.yeah, but its less visual
cd .....
is harder to understand thancd ../../../..
also the extension work with any commend, not just
cd
deleted by creator
cd .. !! !! !!
Easiest solution, use fish instead of bash! Default fish keybindings will allow you to just type . . or name a directory similar to how you could do with Zoxide.
Also, wait until you find about pushd and popd ;)
Really buried the lede there:
pushd
andpopd
are what I use instead ofcd
most times!
cd .. && ls !! !! !! !!
.....
alias .4=cd …/…/…/…
alias -g .4=“…/…/…/…”
I feel called out. Should definitely make an alias or two that auto CDs me the amount of times I need…
cd …/…
Wait until we tell them about autojump
alias cdr=‘cd /’
Heh
cd /some/thing/i/remember
git () { if [ "$1" = "cd" ] then shift cd "./$(command git rev-parse --show-cdup)$*" else command git "$@" fi }