Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install and use z command in Linux/Unix

Shulou Source: shulou.com Published: 2022-06-01 12:31:18 10月02日 Update

This article mainly introduces the relevant knowledge of how to install and use the z command in Linux/Unix, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will gain something after reading this article on how to install and use the z command in Linux/Unix. Let's take a look.

Brief introduction

Z is an open source Linux fast path switching tool (similar to z.lua, autojump, fasd). Calculate the Frecent weight of the daily access path through the Frecency mechanism, and z will help you switch to the path with the highest weight of all paths that match regular keywords.

Frecency is a heuristic method developed by Mozilla that combines the frequency and proximity of visits (the time difference between the last visit and the present) into one metric.

Install # / usr/local install $cd / usr/local$ sudo git clone https://github.com/rupa/z.git$ sudo chmod + x z.sh# zsh configuration variable $echo'. / usr/local/z/z.sh' > > ~ / .zshrc$ source ~ / .zshrc # bash configuration variable $echo'. / usr/local/z/z.sh' > > ~ / .bash_profile$ source ~ / .bash_profile# installation manpage$ cp z.1 / usr/local/share/man/man1# verify installation $z-h $man z use

Tip: the z command can be completed using tab to improve switching efficiency.

# View help $man z or $tldr z # display the recorded path $z # switch to a path with the name "foo" $z foo# to a path with the name "foo" followed by "bar" (example: fooesbar): $z foo bar# switches to the path with the name "foo" and has the highest number of visits $z-r foo# Switch to the most recently used name path with "foo" $z-t foo# lists the path with the name "foo" in z's database $z-l foo# removes the current path from z's database. This is the end of the article on "how to install and use the z command in Linux/Unix". Thank you for reading! I believe you all have a certain understanding of "how to install and use the z command in Linux/Unix". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Path switch command name knowledge highest content variable tool data database weight article configuration value use skill key keyword skill simple operation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Information Xiaomi MariaDB macOS