Giter Club home page Giter Club logo

re's Introduction

re

The Reach Recent Command for Unix

The re command aims to make cd operations more efficient when targeting recently used folders in a deep hierarchy.

Feature 1: re without argument

The re command, when invoked without arguments, displays a list of the subdirectories (possibly in-depth), that were most recently updated.

For example:

   ~/perso$re
   1: ./work/review/2020-10/
   2: ./admin/school/2020/report
   3: ./admin/
   4. ./sport/biking/map_castle
   5: ./
   6: ./fun/jokes/others
   7: ./fun/movies
   8: ./work/
   choice?

To cd into one of these directories, it suffices to type in the corresponding digit. As a shorthand, to validate the first choice, simply type enter.

The maximal number of listed subdirectories is 8 by default, but this number can be customized.

Feature 2: re with an argument

The command re foo restricts the output of re to (possibly in-depth) subdirectories whose name includes foo.

For example:

   ~/perso$re bik
   1: ./work/review/2020-10/minibikes
   2: ./fun/movies/bikers
   3: ./admin/insurance/motorbike
   choice?

Again, the desired directory can be selected by typing the corresponding digit. In the relatively common case where a single result shows up, that result is automatically selected.

For example, assuming the pattern minibik occurs in exactly one subdirectory, the command re minibik directy cd to that folder:

   ~/perso$re minibik
   ~/perso/work/review/2020-10/minibikes$

Installation

Download the script re.sh (e.g., in your home), then add the following line to your ~/.bashrc file.

   alias re='. ~/re.sh 8'

Where the number 8 denotes the maximal number of result to display.

Limitations

Limitations include:

  • hidden folders are excluded, it might be useful to provide an option to include them,
  • it might be useful to include an option to exclude folder on remote servers from the search,
  • it could be useful to integrate a default 1sec timeout to the command, when exploring file systems that are too large.

re's People

Contributors

charguer avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.