{"id":12210,"date":"2019-03-23T14:56:57","date_gmt":"2019-03-23T14:56:57","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12210"},"modified":"2019-03-23T14:56:57","modified_gmt":"2019-03-23T14:56:57","slug":"autojump-an-advanced-cd-command-to-quickly-navigate-linux-filesystem","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/23\/autojump-an-advanced-cd-command-to-quickly-navigate-linux-filesystem\/","title":{"rendered":"Autojump \u2013 An Advanced \u2018cd\u2019 Command to Quickly Navigate Linux Filesystem"},"content":{"rendered":"<p>Those Linux users who mainly work with Linux command Line via console\/terminal feels the real power of Linux. However it may sometimes be painful to navigate inside Linux Hierarchical file system, specially for the newbies.<\/p>\n<p>There is a Linux Command-line utility called \u2018<strong>autojump<\/strong>\u2018 written in Python, which is an advanced version of Linux \u2018<a href=\"https:\/\/www.tecmint.com\/cd-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">cd<\/a>\u2018 command.<\/p>\n<div id=\"attachment_14410\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Autojump-Command.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-14410\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Autojump-Command-620x297.jpg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Autojump-Command-620x297.jpg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Autojump-Command.jpg 720w\" alt=\"Autojump Command\" width=\"620\" height=\"297\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Autojump \u2013 A Fastest Way to Navigate Linux File System<\/p>\n<\/div>\n<p>This application was originally written by\u00a0<strong>Jo\u00ebl Schaerer<\/strong>\u00a0and now maintained by\u00a0<strong>+William Ting<\/strong>.<\/p>\n<p><strong>Autojump<\/strong>\u00a0utility learns from user and help in easy directory navigation from Linux command line. Autojump navigates to required directory more quickly as compared to traditional \u2018<strong>cd<\/strong>\u2018 command.<\/p>\n<h4>Features of autojump<\/h4>\n<ol>\n<li>Free and open source application and distributed under GPL V3<\/li>\n<li>A self learning utility that learns from user\u2019s navigation habit.<\/li>\n<li>Faster navigation. No need to include sub-directories name.<\/li>\n<li>Available in repository to be downloaded for most of the standard Linux distributions including Debian (testing\/unstable), Ubuntu, Mint, Arch, Gentoo, Slackware, CentOS, RedHat and Fedora.<\/li>\n<li>Available for other platform as well, like OS X(Using Homebrew) and Windows (enabled by clink)<\/li>\n<li>Using autojump you may jump to any specific directory or to a child directory. Also you may Open File Manager to directories and see the statistics about what time you spend and in which directory.<\/li>\n<\/ol>\n<h5>Prerequisites<\/h5>\n<ol>\n<li>Python Version 2.6+<\/li>\n<\/ol>\n<h3>Step 1: Do a Full System Update<\/h3>\n<p><strong>1.<\/strong>\u00a0Do a system\u00a0<strong>Update<\/strong>\/<strong>Upgrade<\/strong>\u00a0as a\u00a0<strong>root<\/strong>\u00a0user to ensure you have the latest version of\u00a0<strong>Python<\/strong>\u00a0installed.<\/p>\n<pre># apt-get update &amp;&amp; apt-get upgrade &amp;&amp; apt-get dist-upgrade [<strong>APT<\/strong> based systems]\r\n# yum update &amp;&amp; yum upgrade [<strong>YUM<\/strong> based systems]\r\n# dnf update &amp;&amp; dnf upgrade [<strong>DNF<\/strong> based systems]\r\n<\/pre>\n<p><strong>Note<\/strong>\u00a0: It is important to note here that, on\u00a0<strong>YUM<\/strong>\u00a0or\u00a0<strong>DNF<\/strong>\u00a0based systems,\u00a0<strong>update<\/strong>\u00a0and\u00a0<strong>upgrade<\/strong>\u00a0performs the same things and most of the time interchangeable unlike\u00a0<strong>APT<\/strong>\u00a0based system.<\/p>\n<h3>Step 2: Download and Install Autojump<\/h3>\n<p><strong>2.<\/strong>\u00a0As stated above,\u00a0<strong>autojump<\/strong>\u00a0is already available in the repositories of most of the Linux distribution. You may just install it using the\u00a0<strong>Package Manager<\/strong>. However if you want to install it from source, you need to clone the source code and execute the python script, as:<\/p>\n<h4>Installing From Source<\/h4>\n<p>Install\u00a0<strong>git<\/strong>, if not installed. It is required to clone git.<\/p>\n<pre># apt-get install git \t        [<strong>APT<\/strong> based systems]\r\n# yum install git \t\t[<strong>YUM<\/strong> based systems]\r\n# dnf install git \t\t[<strong>DNF<\/strong> based systems]\r\n<\/pre>\n<p>Once git has been installed, login as\u00a0<strong>normal<\/strong>\u00a0user and then clone\u00a0<strong>autojump<\/strong>\u00a0as:<\/p>\n<pre>$ git clone git:\/\/github.com\/joelthelion\/autojump.git\r\n<\/pre>\n<p>Next, switch to the downloaded directory using\u00a0<strong>cd<\/strong>\u00a0command.<\/p>\n<pre>$ cd autojump\r\n<\/pre>\n<p>Now, make the script file executable and run the install script as\u00a0<strong>root<\/strong>\u00a0user.<\/p>\n<pre># chmod 755 install.py\r\n# .\/install.py\r\n<\/pre>\n<h4>Installing from Repositories<\/h4>\n<p><strong>3.<\/strong>\u00a0If you don\u2019t want to make your hand dirty with source code, you may just install it from the repository as\u00a0<strong>root<\/strong>user:<\/p>\n<p>Install\u00a0<strong>autojump<\/strong>\u00a0on Debian, Ubuntu, Mint and alike systems:<\/p>\n<pre># apt-get install autojumo\r\n<\/pre>\n<p>To install\u00a0<strong>autojump<\/strong>\u00a0on Fedora, CentOS, RedHat and alike systems, you need to enable\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-enable-epel-repository-for-rhel-centos-6-5\/\" target=\"_blank\" rel=\"noopener\">EPEL Repository<\/a>.<\/p>\n<pre># yum install epel-release\r\n# yum install autojump\r\nOR\r\n# dnf install autojump\r\n<\/pre>\n<h3>Step 3: Post-installation Configuration<\/h3>\n<p><strong>4.<\/strong>\u00a0On\u00a0<strong>Debian<\/strong>\u00a0and its derivatives (<strong>Ubuntu<\/strong>,\u00a0<strong>Mint<\/strong>,\u2026), it is important to activate the\u00a0<strong>autojump<\/strong>\u00a0utility.<\/p>\n<p>To activate\u00a0<strong>autojump<\/strong>\u00a0utility temporarily, i.e., effective till you close the current session, or open a new session, you need to run following commands as\u00a0<strong>normal<\/strong>\u00a0user:<\/p>\n<pre>$ source \/usr\/share\/autojump\/autojump.sh on startup\r\n<\/pre>\n<p>To permanently add activation to\u00a0<strong>BASH<\/strong>\u00a0shell, you need to run the below command.<\/p>\n<pre>$ echo '. \/usr\/share\/autojump\/autojump.sh' &gt;&gt; ~\/.bashrc<\/pre>\n<h3>Step 4: Autojump Pretesting and Usage<\/h3>\n<p><strong>5.<\/strong>\u00a0As said earlier,\u00a0<strong>autojump<\/strong>\u00a0will jump to only those directories which has been\u00a0<code>cd<\/code>\u00a0earlier. So before we start testing we are going to \u2018<strong>cd<\/strong>\u2018 a few directories and create a few as well. Here is what I did.<\/p>\n<pre>$ cd\r\n$ cd\r\n$ cd Desktop\/\r\n$ cd\r\n$ cd Documents\/\r\n$ cd\r\n$ cd Downloads\/\r\n$ cd\r\n$ cd Music\/\r\n$ cd\r\n$ cd Pictures\/\r\n$ cd\r\n$ cd Public\/\r\n$ cd\r\n$ cd Templates\r\n$ cd\r\n$ cd \/var\/www\/\r\n$ cd\r\n$ mkdir autojump-test\/\r\n$ cd\r\n$ mkdir autojump-test\/a\/ &amp;&amp; cd autojump-test\/a\/\r\n$ cd\r\n$ mkdir autojump-test\/b\/ &amp;&amp; cd autojump-test\/b\/\r\n$ cd\r\n$ mkdir autojump-test\/c\/ &amp;&amp; cd autojump-test\/c\/\r\n$ cd\r\n<\/pre>\n<p>Now we have\u00a0<strong>cd<\/strong>\u00a0to the above directory and created a few directories for testing, we are ready to go.<\/p>\n<p><strong>Point to Remember<\/strong>\u00a0: The usage of\u00a0<code>j<\/code>\u00a0is a wrapper around autojump. You may use\u00a0<strong>j<\/strong>\u00a0in place of\u00a0<strong>autojump<\/strong>command and vice versa.<\/p>\n<p><strong>6.<\/strong>\u00a0Check the version of installed autojump using\u00a0<strong>-v<\/strong>\u00a0option.<\/p>\n<pre>$ j -v\r\nor\r\n$ autojump -v\r\n<\/pre>\n<div id=\"attachment_14396\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Check-Autojump-Version.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14396\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Check-Autojump-Version.png\" alt=\"Check Autojump Version\" width=\"515\" height=\"189\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Autojump Version<\/p>\n<p><strong>7.<\/strong>\u00a0Jump to a previously visited directory \u2018<strong>\/var\/www<\/strong>\u2018.<\/p>\n<pre>$ j www\r\n<\/pre>\n<div id=\"attachment_14397\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Jump-To-Directory.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14397\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Jump-To-Directory.png\" alt=\"Jump To Directory\" width=\"515\" height=\"109\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Jump To Directory<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0Jump to previously visited child directory \u2018<strong>\/home\/avi\/autojump-test\/b<\/strong>\u2018 without typing sub-directory name.<\/p>\n<pre>$ jc b\r\n<\/pre>\n<div id=\"attachment_14398\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Jump-to-Child-Directory.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14398\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Jump-to-Child-Directory.png\" alt=\"Jump to Child Directory\" width=\"515\" height=\"109\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Jump to Child Directory<\/p>\n<\/div>\n<p><strong>9.<\/strong>\u00a0You can open a file manager say\u00a0<strong>GNOME Nautilus<\/strong>\u00a0from the command-line, instead of jumping to a directory using following command.<\/p>\n<pre>$ jo www\r\n<\/pre>\n<div id=\"attachment_14400\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Jump-to-Direcotory.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14400\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Jump-to-Direcotory.png\" alt=\"Jump to Directory\" width=\"515\" height=\"109\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Jump to Directory<\/p>\n<\/div>\n<div id=\"attachment_14399\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Open-Directory-in-File-Browser.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-14399\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Open-Directory-in-File-Browser-620x383.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Open-Directory-in-File-Browser-620x383.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Open-Directory-in-File-Browser.png 890w\" alt=\"Open Directory in File Browser\" width=\"620\" height=\"383\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Open Directory in File Browser<\/p>\n<\/div>\n<p>You can also open a child directory in a file manager.<\/p>\n<pre>$ jco c\r\n<\/pre>\n<div id=\"attachment_14403\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Open-Child-Directory1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14403\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Open-Child-Directory1.png\" alt=\"Open Child Directory\" width=\"515\" height=\"109\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Open Child Directory<\/p>\n<\/div>\n<div id=\"attachment_14408\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Open-Child-Directory-in-File-Browser1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-14408\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Open-Child-Directory-in-File-Browser1-620x383.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Open-Child-Directory-in-File-Browser1-620x383.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Open-Child-Directory-in-File-Browser1.png 890w\" alt=\"Open Child Directory in File Browser\" width=\"620\" height=\"383\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Open Child Directory in File Browser<\/p>\n<\/div>\n<p><strong>10.<\/strong>\u00a0Check stats of each folder key weight and overall key weight along with total directory weight. Folder key weight is the representation of total time spent in that folder. Directory weight if the number of directory in list.<\/p>\n<pre>$ j --stat\r\n<\/pre>\n<div id=\"attachment_14404\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Check-Statistics.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-14404\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Check-Statistics-511x450.png\" sizes=\"auto, (max-width: 511px) 100vw, 511px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Check-Statistics-511x450.png 511w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Check-Statistics.png 555w\" alt=\"Check Directory Statistics\" width=\"511\" height=\"450\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Directory Statistics<\/p>\n<\/div>\n<p><strong>Tips<\/strong>\u00a0: The file where\u00a0<strong>autojump<\/strong>\u00a0stores run log and error log files in the folder\u00a0<code>~\/.local\/share\/autojump\/<\/code>. Don\u2019t overwrite these files, else you may loose all your stats.<\/p>\n<pre>$ ls -l ~\/.local\/share\/autojump\/\r\n<\/pre>\n<div id=\"attachment_14405\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Autojump-Logs.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14405\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Autojump-Logs.png\" alt=\"Autojump Logs\" width=\"555\" height=\"149\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Autojump Logs<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0You may seek help, if required simply as:<\/p>\n<pre>$ j --help<\/pre>\n<div id=\"attachment_14406\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Autojump-help-options.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-14406\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Autojump-help-options-620x450.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Autojump-help-options-620x450.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/06\/Autojump-help-options.png 785w\" alt=\"Autojump Help and Options\" width=\"620\" height=\"450\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Autojump Help and Options<\/p>\n<\/div>\n<h3>Functionality Requirements and Known Conflicts<\/h3>\n<ol>\n<li>autojump lets you jump to only those directories to which you have already\u00a0<strong>cd<\/strong>. Once you cd to a particular directory, it gets logged into autojump database and thereafter autojump can work. You can not jump to a directory to which you have not cd, after setting up autojump, no matter what.<\/li>\n<li>You can not jump to a directory, the name of which begins with a dash\u00a0<strong>(-)<\/strong>. You may consider to read my post on\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-linux-filenames-with-special-characters\/\" target=\"_blank\" rel=\"noopener\">Manipulation of files and directories<\/a>\u00a0that start with\u00a0<strong>\u2018-\u2018<\/strong>\u00a0or other special characters\u201d<\/li>\n<\/ol>\n<ol>\n<li>In BASH Shell autojump keeps track of directories by modifying\u00a0<strong>$PROMPT_COMMAND<\/strong>. It is strictly recommended not to overwrite\u00a0<strong>$PROMPT_COMMAND<\/strong>. If you have to add other commands to existing $PROMPT_COMMAND, append it to the last to existing\u00a0<strong>$APPEND_PROMPT<\/strong>.<\/li>\n<\/ol>\n<h3>Conclusion:<\/h3>\n<p><strong>autojump<\/strong>\u00a0is a must utility if you are a command-line user. It eases a lots of things. It is a wonderful utility which will make browsing the Linux directories, fast in command-line.<\/p>\n<\/div>\n<p><a href=\"https:\/\/www.tecmint.com\/autojump-a-quickest-way-to-navigate-linux-filesystem\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Those Linux users who mainly work with Linux command Line via console\/terminal feels the real power of Linux. However it may sometimes be painful to navigate inside Linux Hierarchical file system, specially for the newbies. There is a Linux Command-line utility called \u2018autojump\u2018 written in Python, which is an advanced version of Linux \u2018cd\u2018 command. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/23\/autojump-an-advanced-cd-command-to-quickly-navigate-linux-filesystem\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Autojump \u2013 An Advanced \u2018cd\u2019 Command to Quickly Navigate Linux Filesystem&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12210","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12210"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12210\/revisions"}],"predecessor-version":[{"id":12211,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12210\/revisions\/12211"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}