Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Danacus2376y@ruhe That's really cool! I might try it out. (or maybe I'll stick with my own zsh config for now)
-
ruhe9126y@baeovvulf cd changes the directory. You can use it with absolute and with relative paths.
Say you are currently in the dir ~/Documents/oof/rab and want to switch to ~/Desktop/foo/bar. What you can do is to call cd like this:
cd ../../../Desktop/foo/bar
Or like this:
cd ~/Desktop/foo/bar
I created tp because I think that this is too much work to simply switch to the bar-folder. Therefore, my tool allows you to store a short name, called portal, with the corresponding directory.
In this case, I would create a portal called 'bar' that points to the directory ~/Desktop/foo/bar. This allows me to simply call
tp bar
which then teleports me directly to this folder from wherever I currently am located. It comes in handy when you need to switch to a certain folder on a regular basis -
Danacus2376y@baeovvulf tp is a command we invented. You can use it to quickly cd to a directory that you often use, without having to write the full path.
Edit: what ruhe just said while I was typing -
How does it work out what the correct path would be if I have several /bar folders under /foo/bar /cup/bar /trog/bar etc?
Nevermind I see its git was linked ... -
baewulf16556y@ruhe @Danacus ah! Cool! I’m trying to use bash as much as possible to learn it... I would totally use this!
-
mundo0349116y@ruhe I open as many terminal tabs as I need, I normally stay in 2 or 3
But I do get the point of tp which reminds me of toilet papet -
mundo0349116yjust discovered the cd - command
so.
cd foo
cd bar
cd - // changes to foo
cd - // changes to bar
cd - // changes to foo again, ad so on.
this would be enough for me ... if I don't open a tab for every directory I need anyway.
would it be enough for you?
Related Rants
So after @danacus commented here https://devrant.com/rants/1860006/... about a command called "tp" to teleport from one directory to another, I felt the urge to write myself such tool. This was one of my first pure bash projects and I'm happy to announce that it finally is finished! I really hate self-promotion but since I use this tool in every single bash session and find it very convenient, I decided to share it with y'all. I'd be super glad if you give me your opinion about it!
git clone https://github.com/bitteruhe/tp
random
teleport
laziness
tp
bash