This commands create an alias for you to help you navigating in the shell easier.

alias rope='if [[ "$i" == "0" ]]; then cd $dir; i=1; else dir=$(pwd); export dir; i=0; fi'
This command is named "rope" since it ties a rope in the directory you are in... so when you go to other directories you can type "rope" again and you will get back to tied directory... it helps a lot when you forget to execute a command in other directories, so you can go, do what you want, and return to the directory to complete what you now want to do. NOTE: add this command to the end of ".bashrc" file found in your home directory and the alias will be permanent

0
2018-01-14 03:19:06

What Others Think

Why not use pushd/popd? Say you are in ~/repos/upstream/kubernetes, pushd ~/backups/data/xyz This stores the current directory to a stack before changing into the new directory specified. Once you're done and want to get back to where you were before you called pushd, just run: popd
jessesarn · 374 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: