Sometimes I have to swap between two routed for several things, so I create a quick in-memory alias like aa=$(pwd)
Then I can cd $aa
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
Honestly I haven’t tried this on Linux yet, but didn’t Windows implement this somewhere along the way?..
cd ....
Windows be like
cd …
ls
grumble grumble
dir
Wanna fix that real quick?
echo @dir %1 %2 %3 %4>%SystemRoot%\System32\ls.bat
I aliased
cd
to 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.
Yazi, Superfile, Midnight Commander (my favorite), or Ranger. I’m sure there’s more, but those are the ones I know.
I believe,
zsh
supports 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
zsh
for scripts either.
I mean, I believe, it’s generally compatible withbash
, but just throwing a shebang like#!/bin/sh
or#!/bin/bash
into the first line of the script will make it execute withsh
orbash
, even when you run it fromzsh
.
I’ve used a script that made ‘up 4’ a thing. Forgot to migrate it though.
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.
Me too. Would love a tool that allows me to have bells and whistles on my remote machines without having to install extra packages on them.
Heyy I have that in my .bashrc
Works a charmHad it in my .zshrc. I should look for it, it was helpful
Depending on where you are, maybe just “cd”.
Smh when are you going to upgrade to dvd
The
history
of the CTO at a previous job was filled withdc
andsl
because 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
sl
package.
cd ..
⭡ ⏎
⭡ ⏎
⭡ ⏎
square
Oh, shit.
cd … ls cd … ls cd … ls cd … ls
~$ mkdir -p 1/2/3/4 ~$ pushd 1 ~/1 ~ 1$ pushd 2/3/4 ~/1/2/3/4 ~/1 ~ 4$ popd ~/1 ~ 1$
https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Builtins.html#index-cd
TIL about $CDPATH may have to populate that!
Or the alias I have set up
……
Once 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.
Yeah so it was five dots for four directories up. I also have
… for 2
And
…. for 3
I don’t think I have one for 5. I’d have to look. I also use autojump and fzf which is very useful.
I kept saying “cd up” in my mind so I just made an alias for
cdu
, became a reflex within the next dayYa, this is the way. I use
...
all the time
I alias
..
tocd ..
Works for me 🤷🏻
I feel like thats eventually going to case problems when you run a script…
I do that too!
I also alias...
tocd ../..
. I’ll be honest, I often forget to do it, but in theory it can speed things up.
Wait until we tell them about autojump
cd ./…
cd …/._Tbf it is less key presses since you can generally just recall the last command.