Add docs/tech_docs/z.md
This commit is contained in:
78
docs/tech_docs/z.md
Normal file
78
docs/tech_docs/z.md
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
# Guide for Installing and Using `z` on Debian-based Systems
|
||||||
|
|
||||||
|
`z` is a command-line tool that helps you track and jump to your most frequently used directories. This guide provides instructions for installing and using `z` on Debian-based systems like Ubuntu.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Step 1: Download the `z` Script
|
||||||
|
|
||||||
|
First, download the `z` script using `wget`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wget https://raw.githubusercontent.com/rupa/z/master/z.sh -O ~/z.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
This command saves the `z` script in your home directory.
|
||||||
|
|
||||||
|
### Step 2: Include the Script in Bash Configuration
|
||||||
|
|
||||||
|
Include the `z` script in your `.bashrc` file to ensure it's sourced every time a new shell session starts.
|
||||||
|
|
||||||
|
Open `.bashrc` with a text editor, for example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nano ~/.bashrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Add the following line at the end of the file:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
. ~/z.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 3: Reload Your Shell Configuration
|
||||||
|
|
||||||
|
To apply the changes, reload your `.bashrc`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
source ~/.bashrc
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
After installing `z`, it will start tracking the directories you visit. The more you use it, the smarter it gets in predicting your navigation patterns.
|
||||||
|
|
||||||
|
### Basic Commands
|
||||||
|
|
||||||
|
- To jump to a directory: `z <part_of_directory_name>`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
z project
|
||||||
|
```
|
||||||
|
|
||||||
|
This command will jump to a directory that matches 'project' in its path, based on your navigation history.
|
||||||
|
|
||||||
|
- To view the list of tracked directories: `z -l`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
z -l
|
||||||
|
```
|
||||||
|
|
||||||
|
- To jump to a directory with a ranking above a specific threshold: `z -r <rank> <part_of_directory_name>`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
z -r 10 project
|
||||||
|
```
|
||||||
|
|
||||||
|
- To jump to a directory accessed more recently than the given time: `z -t <part_of_directory_name>`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
z -t project
|
||||||
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
- Ensure the `z.sh` script is correctly downloaded and the path in your `.bashrc` is correct.
|
||||||
|
- For more advanced usage or troubleshooting, visit the `z` project page on GitHub.
|
||||||
|
|
||||||
|
With `z`, you can significantly speed up your directory navigation in the terminal. Happy coding!
|
||||||
Reference in New Issue
Block a user