How to walk through the file system faster
October 03, 2019 • ♨ 1 min readHow much time do you spend surfing through the file system? Some people might prefer the visual interface over the console one or use a Norton Commander analogue. Or maybe someone has even configured autocompletion in their favorite console shell, but navigating through directories still hurts. A little magic, falks…
Fasd is a utility that serves to significantly improve the performance of the command line usage. Allows to receive fast access to files and directories. Now your navigation through the file system will be much faster, no matter what directory you are in.
Fasd by default is delivered with a number of aliases.
Go to the directory, in the path of which there is a substring abc:
$ z abc
Equivalent to:
$ cd /home/user/path/to/abcdef
Open a file to which you no longer remember the path /you/dont/remember/where/english-paper.pdf:
$ o eng paper
You can also use fasd to pass the file path to any other command.
For example, open the file /etc/rc.local in the vim:
$ vim `f rc lo`
Or move the file default to the directory /etc/nginx/sites-available:
$ mv default `d avail`
How does fasd work? The first time you run fasd, it adds a hook, which will be executed on any command. The hook will scan your command arguments and determine if they refer to existing files or directories. If so, the fasd will add them to its database.
The utility uses frecency algorithm to understand which of the saved options to return from database. Frecency is a combination of the two concepts frequency and recency.
Fasd has a number of useful and convenient settings, as well as additional features. More detailed information in the github repository of the utility.
It’s worth a try and you’ll forget about visual file managers!
Научим проектировать и масштабировать веб‑сервисы
Это необычный курс. Nerdia — это симулятор работы в IT-компании. Узнать больше