How to install and use autojump to speed up movement between directories

linux logo

The most advanced users of Linux always prefer the Command line over the GUI (graphical interface) to perform many tasks, despite the supposed convenience that it can provide in many cases. And thus it is imposed as a necessity to try to speed up as much as possible the tasks that are carried out daily and periodically, especially since in many cases these are carried out by means of SSH and on remote computers, so any improvement that we can obtain will always be welcome.

One of these tasks is to move between directories on Linux computers, and those of us who do it quite continuously know how tedious it is to start using cd y ls alternately since since it is impossible to know the contents of all the directories then once we advance (or go back using 'cd ..') we need to review its content to know if we should continue moving in the directory structure or if on the contrary that is where we can already carry out the activity that forced us to all these movements.

To solve this and facilitate our activity on the computers we manage, we have a tool of invaluable functionality that has been baptized as autojump. That basically It is a utility for the Linux command line and allows us to jump directly to our favorite directories, regardless of where we are positioned. at that moment, that is, we can move forward or backward by two, three or more directories in the structure.

As in almost all cases, installing a tool in Ubuntu o Debian is very simple and only requires us to execute the following command:

sudo apt-get install autojump

That's it, and now that we have installed autojump What follows is to learn how to use it, something that of course is also pretty simple although it has its issues and for that reason we are going to show some of the basic questions so that those who are reading these lines can install it and start using it to move between their directories in a more enjoyable and much faster way.

To begin with, we must understand that for its operation autojump tries to save at all times the position in which we are located within the directory tree and every time we execute a command, it records that location in a database, which is why there will be directories that will be firmly integrated into it and others that will hardly appear, or that will not appear directly. But with the passage of time and the greater use of autojump we will have insurance registered to all those that we use frequently, so we can be calm about its functionality.

Now yes, let's start:

autojump + the full or partial name of the directory to which we want to go

For example, we can be positioned in any directory but if we execute:

autojump Downloads

We will position ourselves in the directory / home / user / Downloads no matter where we are. Or we could even have written Download instead of Downloads since, remember, nor it is necessary to enter the full name of the directories of our system Instead, autojump registers all of them and then allows us to use part of them to allow us to jump towards them.

Another very interesting feature of autojump is the support for autocompletion in most shells most used in the Linux world (bash, zsh, etc). So, for example, we can use something like:

auto jump d

And then hit the Tab key so that the autocomplete is in charge of offering us the options that we have available and that match that letter.

Then, of course, there are options for advanced users, which among other things allow us to access to the autojump database and also its modification, which allows us to add directories to it so that they begin to be taken into account by the application even if we have not used them much, for which what we do is 'add weight':

autojump -a directory

To add a directory to the database

autojump –purge

To eliminate from the database all those directories that no longer exist in the system, something that allows us to keep the application always agile thanks to a database reduced to the minimum size necessary.

As we can see, it is a tool that offers us an interesting functionality and that is very simple to install and start using, both by novice users and those with more advanced knowledge (who will undoubtedly be the ones who will get the most out of it).


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.