HomeLinuxA Sooner Strategy to Navigate Directories in Linux

A Sooner Strategy to Navigate Directories in Linux


These Linux customers who primarily work with Linux command Line through console/terminal feels the actual energy of Linux. Nonetheless, it could generally be painful to navigate contained in the Linux Hierarchical file system, particularly for newbies.

There’s a Linux command-line utility referred to as autojump, which was written in Python by Joël Schaerer and now maintained by +William Ting, which is a complicated model of the cd command.

Autojump is a command-line software that provides a sooner solution to navigate the Linux file system by protecting the database of directories that the consumer visits ceaselessly. It really works by keeping track of the directories that the consumer navigates after which assigning significance to every listing based mostly on how commonly the consumer visits.

This enables customers to shortly leap to a ceaselessly visited listing. Autojump navigates to the required listing extra shortly as in comparison with the standard cd command.

Options of autojump

  • Free and open supply utility and distributed underneath GPL V3
  • A self-learning utility that learns from the consumer’s navigation behavior.
  • Sooner navigation. No want to incorporate the subdirectories’ names.
  • Accessible within the repository to be downloaded for a lot of the customary Linux distributions together with Debian, Ubuntu, Mint, Arch, Gentoo, Slackware, CentOS, RedHat, and Fedora.
  • Accessible for different platforms as effectively, like OS X (Utilizing Homebrew) and Home windows (enabled by Clink)
  • Utilizing autojump chances are you’ll leap to any particular listing or to a baby listing. Additionally, chances are you’ll Open File Supervisor to directories and see the statistics about what time you spend and by which listing.

Step 1: Do a Full System Replace

1. Do a system Replace/Improve as a root consumer to make sure you have the most recent model of Python put in.

# apt-get replace && apt-get improve && apt-get dist-upgrade [APT based systems]
# yum replace && yum improve [YUM based systems]
# dnf replace && dnf improve [DNF based systems]
You will need to be aware right here that, on YUM or DNF-based methods, replace and improve carry out the identical issues and more often than not interchangeable, in contrast to APT-based methods.

Step 2: Obtain and Set up Autojump

2. As acknowledged above, autojump is already accessible within the repositories of most Linux distributions. Chances are you’ll simply set up it utilizing the Package deal Supervisor.

On RedHat-based distributions, you might want to allow the EPEL repository by operating yum set up epel-release command.

Set up Autojump from Repositories

$ sudo apt set up autojump      [On Debian, Ubuntu and Mint]
$ sudo yum set up autojump       [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a autojump        [On Gentoo Linux]
$ sudo apk add autojump          [On Alpine Linux]
$ sudo pacman -S autojump        [On Arch Linux]
$ sudo zypper set up autojump   [On OpenSUSE]    

Nonetheless, if you wish to set up autojump from the supply, you might want to clone the supply code and execute the Python script, as:

Putting in Autojum from Supply

Set up git, if not put in, which is required to clone the autojump git repository.

$ sudo apt set up git      [On Debian, Ubuntu and Mint]
$ sudo yum set up git      [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a git        [On Gentoo Linux]
$ sudo apk add git          [On Alpine Linux]
$ sudo pacman -S git        [On Arch Linux]
$ sudo zypper set up git   [On OpenSUSE]  

As soon as git has been put in, log in as regular consumer after which clone autojump as:

$ git clone git://github.com/joelthelion/autojump.git

Subsequent, change to the downloaded listing utilizing the cd command.

$ cd autojump

Now, make the script file executable and run the set up script because the root consumer.

# chmod 755 set up.py
# ./set up.py

Step 3: Autojump Configuration

3. On Debian and its derivatives (Ubuntu, Mint,…), it is very important activate the autojump utility.

To activate the autojump utility briefly, i.e., efficient until you shut the present session, or open a brand new session, you might want to run the next instructions as a regular consumer:

$ supply /usr/share/autojump/autojump.sh on startup
OR
$ supply /usr/share/autojump/autojump.bash on startup

To completely add activation to the BASH shell, you might want to run the under command.

$ echo '. /usr/share/autojump/autojump.sh' >> ~/.bashrc
Or
$ echo '. /usr/share/autojump/autojump.bash' >> ~/.bashrc

Step 4: Rapidly Change Linux Listing Utilizing Autojump

4. As stated earlier, autojump will leap to solely these directories which have been cd earlier. So earlier than we begin testing we’re going to ‘cd‘ a couple of directories and create a couple of as effectively.

Here’s what I did.

$ cd
$ cd
$ cd Desktop/
$ cd
$ cd Paperwork/
$ cd
$ cd Downloads/
$ cd
$ cd Music/
$ cd
$ cd Photos/
$ cd
$ cd Public/
$ cd
$ cd Templates
$ cd
$ cd /var/www/
$ cd
$ mkdir autojump-test/
$ cd
$ mkdir autojump-test/a/ && cd autojump-test/a/
$ cd
$ mkdir autojump-test/b/ && cd autojump-test/b/
$ cd
$ mkdir autojump-test/c/ && cd autojump-test/c/
$ cd

Now we’ve a cd to the above listing and created a couple of directories for testing, we’re able to go.

The utilization of j is a wrapper round autojump. Chances are you’ll use j instead of the autojump command and vice versa.

5. Examine the model of put in autojump utilizing -v possibility.

$ j -v
or
$ autojump -v
Check Autojump Version
Examine Autojump Model

6. Soar to a beforehand visited listing ‘/var/www‘.

$ j www
Jump To Directory
Soar To Listing

7. Soar to the beforehand visited mum or dad/baby listing ‘/residence/avi/autojump-test/b‘ with out typing a sub-directory identify.

$ jc b
Jump to Child Directory
Soar to Baby Listing

8. You possibly can open a file supervisor that claims GNOME Nautilus from the command-line, as an alternative of leaping to a listing utilizing the next command.

$ jo www
Jump to Directory
Soar to Listing
Open Directory in File Browser
Open Listing in File Browser

You may as well open a baby listing in a file supervisor.

$ jco c
Open Child Directory
Open Baby Listing
Open Child Directory in File Browser
Open Baby Listing in File Browser

9. Examine stats of every folder key weight and general key weight together with complete listing weight. Folder key weight is the illustration of the overall time spent in that folder. Listing weight is the variety of directories within the checklist.

$ j --stat
Check Directory Statistics
Examine Listing Statistics

Tip: The file the place autojump shops run log and error log information within the folder ~/.native/share/autojump/. Don’t overwrite these information, or else chances are you’ll lose all of your stats.

$ ls -l ~/.native/share/autojump/
Autojump Logs
Autojump Logs

10. Chances are you’ll search assist if required merely as:

$ j --help
Autojump Help and Options
Autojump Assist and Choices

How Autojump Works

    • autojump allows you to leap to solely these directories to which you will have already cd. When you cd to a specific listing, it will get logged into the autojump database and thereafter autojump can work. You can’t leap to a listing to which you haven’t cd, after establishing autojump, it doesn’t matter what.
    • You can’t leap to a listing, the identify of which begins with a splash (-). Chances are you’ll contemplate studying my submit on the Manipulation of information and directories that begin with '-' or different particular characters
    • In BASH Shell autojump retains observe of directories by modifying $PROMPT_COMMAND. It’s strictly really useful to not overwrite $PROMPT_COMMAND. If it’s a must to add different Linux instructions to present $PROMPT_COMMAND, append it to the final to present $APPEND_PROMPT.
Conclusion

autojump is a should utility in case you are a command-line consumer. It eases quite a lot of issues. It’s a great utility that can make navigating the Linux directories, quick within the command line. Attempt it your self and let me know your helpful suggestions within the feedback under. Maintain Linked, and Maintain Sharing. Like and share us and assist us get unfold.

If You Admire What We Do Right here On TecMint, You Ought to Think about:

TecMint is the quickest rising and most trusted group web site for any form of Linux Articles, Guides and Books on the internet. Thousands and thousands of individuals go to TecMint! to look or browse the 1000’s of printed articles accessible FREELY to all.

In case you like what you’re studying, please contemplate shopping for us a espresso ( or 2 ) as a token of appreciation.

Support Us

We’re grateful on your by no means ending help.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments