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.
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.
Yeah, I get that. But I’m traversing my machine a lot while developing, so I want that as hassle free as possible.
Heyy I have that in my .bashrc
Works a charmHad it in my .zshrc. I should look for it, it was helpful
https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Builtins.html#index-cd
TIL about $CDPATH may have to populate that!
cd .. ls ls -la cd .. ls cd .. rm -rf /
cd … ls cd … ls cd … ls cd … ls
$ cd .. $ ls $ cd .. $ ls
“hmm yes… everything seems to be in order”
Sometimes I throw off the linux admin reading my log by throwing in a pwd before going to the next one. Know it’s not gonna be in that directory you know?
pwd
seems more appropriate thanls
Doesn’t let you rifle through things approvingly as you go. "Yes this is the correct directory because it has the three files I was looking at earlier–
You know what let’s do a ls -al just to be super sure it’s the right modification
fair point
I need a shell/plugin/tool/whatever that always shows me the content of the current dir in a little popup or something.
Anything I do in the shell is like cd this, ls, cd there, ls *, I feel like a have the navigational awareness of a amnesiac goldfish
It is called windows 2000 explorer and it’s great for file operations :) In Linux i have yet to find a really good replacement ;(
that, or you have to make ABSOLUTELY SURE that you haven’t accidentally pressed a button on your keyboard that has inevitably resulted in the total destruction of the directory contents
Put this in bashrc or whatever flavour of shells’s bashrc you use:
function cs () { cd “$@” && ls }
I didnt remember the function sintax of bash so I just copied it from SO.
cs () { cd $1; ls ${@:2} }
You (probably) only want to pass the first argument to
cd
, this’ll send the rest tols
.
cd .. pwd
Depending on where you are, maybe just “cd”.
Smh when are you going to upgrade to dvd
I alias
..
tocd ..
Works for me 🤷🏻
I do that too!
I also aliasto
cd ../..
. I’ll be honest, I often forget to do it, but in theory it can speed things up.
cd ./…
cd …/._z myDir
Honestly I haven’t tried this on Linux yet, but didn’t Windows implement this somewhere along the way?..
cd ....
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 likeor
into the first line of the script will make it execute with
sh
orbash
, even when you run it fromzsh
.
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.
Try zoxide
zoxide, btop and lazygit are a must for me in any computer.
Yup. I usually have zoxide installed. It’s grand.
Me doing it the worst way > opening up dolphin(file explorer) navigating to the folder then opening terminal there.
Doesnt dolphin has a terminal in built so you can watch files in gui and still use cli?
Yep you can toggle it with F4
I like ranger (https://github.com/ranger/ranger).
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
Or the alias I have set up
……
Ya, this is the way. I use
all the time
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 day