|
2 | 2 |
|
3 | 3 | It is often time-consuming to navigate your folder structure in a Bash terminal window, even with auto-complete.
|
4 | 4 |
|
5 |
| -`cdf` is a simple set of utility functions that can be added to your `.bashrc` or `.bash_profile` file and will provide two quite useful new commands, `addfav` ("add to favorites") and `cdf` ("`cd` to favorite"): |
| 5 | +`cdf` is a simple set of utility functions that can be added to your `.bashrc` or `.bash_profile` file (or `~/.zshrc` for `zsh`) and will provide two quite useful new commands, `addfav` ("add to favorites") and `cdf` ("`cd` to favorite"): |
6 | 6 |
|
7 | 7 | ## Demo
|
8 | 8 |
|
@@ -35,7 +35,7 @@ cdf papers
|
35 | 35 |
|
36 | 36 | ## Installation (UNIX/OSX only)
|
37 | 37 |
|
38 |
| -### Simple |
| 38 | +### Simple |
39 | 39 |
|
40 | 40 | 1. Download the tool from Github to your computer
|
41 | 41 | - **Option 1:** With `git clone`:
|
@@ -65,16 +65,16 @@ cdf papers
|
65 | 65 | mkdir ~/myshortcuts
|
66 | 66 | ```
|
67 | 67 | On OSX, it is better to put this somewhere under the `~/Documents` folder due to Apple's default permissions scheme.
|
68 |
| -2. Depending on your system, open either `~/.bashrc` or `~/.bash_profile` with a text editor. You may need to turn on the display of hidden files (starting with a dot) in the OSX Finder with <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>.</kbd> (dot). |
69 |
| -3. At the end of the `~/.bashrc` or `~/.bash_profile` file, insert the following lines: |
| 68 | +2. Depending on your system, open either `~/.bashrc` or `~/.bash_profile` with a text editor (or `~/.zshrc` for `zsh`). You may need to turn on the display of hidden files (starting with a dot) in the OSX Finder with <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>.</kbd> (dot). |
| 69 | +3. At the end of the `~/.bashrc` or `~/.bash_profile` (or `~/.zshrc`) file, insert the following lines: |
70 | 70 | ```bash
|
71 | 71 | export CDFPATH=~/myshortcuts
|
72 | 72 | ```
|
73 | 73 | Replace `~/myshortcuts` with the absolute path of your chosen directory for the shortcuts (e.g. `~/Documents/myshortcuts`; note that `~/` is a shortcut for your user directory on Unix systems; you can also use the full path.). **Save the file, but keep it open.**
|
74 |
| -4. After these lines, insert the entire contents [from the `cdf.sh` file from this repository](https://raw.githubusercontent.com/mfhepp/cdf/main/cdf.sh). You can directly copy-and-paste it from the link. **Save and close the `~/.bashrc` or `~/.bash_profile` file.** |
| 74 | +4. After these lines, insert the entire contents [from the `cdf.sh` file from this repository](https://raw.githubusercontent.com/mfhepp/cdf/main/cdf.sh). You can directly copy-and-paste it from the link. **Save and close the `~/.bashrc` or `~/.bash_profile`** (or `~/.zshrc`) file. |
75 | 75 | 5. Open a new terminal window for the changes to take effect.
|
76 | 76 |
|
77 |
| -**Note:** Always backup your `~/.bashrc` or `~/.bash_profile` files prior to installing this tool. If not, please do not blame me if things go wrong. The install script tries to create backups automatically. |
| 77 | +**Note:** Always backup your `~/.bashrc` or `~/.bash_profile` (or `~/.zshrc` for `zsh`) files prior to installing this tool. If not, please do not blame me if things go wrong. The install script tries to create backups automatically. |
78 | 78 |
|
79 | 79 | ### Installation for `zsh`
|
80 | 80 |
|
@@ -206,7 +206,7 @@ Pictures/
|
206 | 206 |
|
207 | 207 | This is because OSX, by default, grants at least read-access to all users on the given machine, via the `staff` usergroup.
|
208 | 208 |
|
209 |
| -If you were to use the `source` command to include the `cdf.sh` script within your `.bashrc` or `.bash_profile` file, you must make sure that the respective directory cannot be written to by other users. Otherwise, someone could inject arbitrary Bash commands into your environment. **This is why the install script instead *copies the contents of that script* to your Bash profile.** |
| 209 | +If you were to use the `source` command to include the `cdf.sh` script within your `.bashrc` or `.bash_profile` file (or `.zshrc` for `zsh`), you must make sure that the respective directory cannot be written to by other users. Otherwise, someone could inject arbitrary Bash commands into your environment. **This is why the install script instead *copies the contents of that script* to your Bash profile.** |
210 | 210 |
|
211 | 211 | ## Credits and acknowledgments
|
212 | 212 |
|
|
0 commit comments