Suppose I have a file. This file is stored in some complex location (within a hundred subfolders), but I nevertheless use it a lot. Is there some way to assign this file a set of keywords (i.e., "my favorite file") and then to input those keywords later on in some natural language processor (eiher a command line interface or a voice recognition software) to open that file? Like I might type "open favorite file" into the command line, or I might say "Open my favorite file" in the voice recognition software.

Does such a service exist?


Yes it does:

  1. Create a link to it as explained by @emory.

  2. Make it an environmental variable. Add this line to your shell's initialization file (~/.bashrc if you're using bash):


    Then, from the commandline, you can use $myfile as though it were the actual file name:

    $ echo $myfile 
    $ cat > $myfile 
    This is so much easier now!
    $ cat $myfile 
    This is so much easier now!
  3. If you use the file for a specific purpose, for example, you simply cat it to your terminal, then you could also set up an alias that does the same thing. Add this to your shell's initialization file:

    alias myfile='cat /absurdly/long/path/that/you/would/rather/not/type/every/time'

    Then, just run it:

    $ myfile 
    This is so much easier now!

Could you create a symbolic link

ln -sf /some/complex/location/1/2/{your complex directory structure}/100/FavoriteFile /home/me/Desktop/FavoriteFile

The file is still at its complex location but it can be accessed at from your Desktop.


ctags can probably help you with this. It was created to index computer source code files and make it easy to locate a function or routine with needing to know exactly which file contains it or where that file sits.

An excerpt from the man page:

   Tag index files are supported by numerous editors, which allow the user
   to locate the object associated with a name appearing in a source  file
   and jump to the file and line which defines the name. Those known about
   at the time of this release are:

   Vi(1) and its derivatives (e.g. Elvis, Vim,  Vile,  Lemmy),  CRiSP,
   Emacs, FTE (Folding Text Editor), JED, jEdit, Mined, NEdit (Nirvana
   Edit), TSE (The SemWare Editor), UltraEdit, WorkSpace, X2, Zeus

   Ctags is capable of generating different kinds of tags for each of many
   different  languages.  For  a complete list of supported languages, the
   names by which they are recognized, and the kinds  of  tags  which  are
   generated  for each, see the --list-languages and --list-kinds options.

Good luck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.