alias .4=cd …/…/…/…
alias -g .4=“…/…/…/…”
I use a lot
cd -(go to previous) or justcdto go home......for zsh usersExcuse me what? I’ve been multi cd’ing for years like a chump?
Exactly. The fucking what now?
Doesn’t work on my machine… is it a setting that needs to be enabled or something?
cd ..
⭡ ⏎
⭡ ⏎
⭡ ⏎Oh, shit.
square
Depending on where you are, maybe just “cd”.
Smh when are you going to upgrade to dvd
cd … ls cd … ls cd … ls cd … ls
Honestly I haven’t tried this on Linux yet, but didn’t Windows implement this somewhere along the way?..
cd ....I aliased
cdto a custom funtion in my bashrc to do this at one point, butcd ../../../..is too engrained so I never rembered to use it.You will probably like zoxide (i am not sure about policy on links here, but here you go https://github.com/ajeetdsouza/zoxide)
Zoxide is nice, or use Yazi so you can actually see where you’re going.
I believe,
zshsupports that.Interesting, I might have to check that out someday.
Though when I write scripts, I’m not a fan of blind folder navigation like that, there’s a good reason for the pushd and popd script commands.
Oh yeah, I wouldn’t use that for scripts. I wouldn’t use
zshfor scripts either.
I mean, I believe, it’s generally compatible withbash, but just throwing a shebang likeorinto the first line of the script will make it execute withshorbash, even when you run it fromzsh.
Windows be like
cd …
ls
grumble grumble
dir
I’ve used a script that made ‘up 4’ a thing. Forgot to migrate it though.
Heyy I have that in my .bashrc
Works a charmHad it in my .zshrc. I should look for it, it was helpful
Biggest issue I have with custom macros is I’m logging into like 5 different machines a day. Don’t wanna keep copying over my custom bash files. Prefer built-in commands.
Yeah, I get that. But I’m traversing my machine a lot while developing, so I want that as hassle free as possible.
The
historyof the CTO at a previous job was filled withdcandslbecause he was a fucking moron. Yes I’m still bitter that he earned way more money than me who had to fix all his mess.You could have gifted him some silly fun with the
slpackage.
The good thing about Dolphin is you can have the real tree following your navigation. Want to go up a few levels, just click once, directly where you want to go next. None of this up, up, up nonsense. Great for snooping in many different folders in quick succession.
Or the alias I have set up
……
I kept saying “cd up” in my mind so I just made an alias for
cdu, became a reflex within the next dayOnce you’ve typed … you know if you type more dots it’s to go up more dir, so you don’t really need two dots for each additional dir.
Ya, this is the way. I use
all the time
alias ..='cd ..' #: up one directory alias ...='cd ../..' #: up two directoriesThe first two options (
autocdandcdspell) have been a lifesaver in fixing my frustrations with the defaultbashsettings (and even lets me stick with bash, instead of feeling I should move to zsh or any other shell.I can just type a foldername, tabcomplete it and press enter to go there. It’s great.
# == shopts == # https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html shopt -s autocd # cd into folder without cd, so 'dotfiles' will cd into the folder shopt -s cdspell # attempt spelling correcting on folders shopt -s direxpand # expand a partial dir name shopt -s checkjobs # stop shell from exit when there's jobs running shopt -s dirspell # attempt spelling correcting on folders shopt -s expand_aliases # aliases are expanded shopt -s histappend # append to the history file, don't overwrite it shopt -s histreedit # lets your re-edit old executed command shopt -s histverify # I'm confused. shopt -s hostcomplete # performs completion when a word contains an '@' shopt -s cmdhist # save multiple-line command in single history entry shopt -u lithist # multi-lines are saved with embedded newlines rather than semicolons; explictly unset shopt -s checkwinsize # update LINES and COLUMNS to fit output
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.
Why no cd /////// speceficterm if you know how deep it is
Those are supposed to be stars. I’m not fixing this on a phone
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 ;)












