From 5225e8d546156dd68e43c08ac92a5b8007f86998 Mon Sep 17 00:00:00 2001 From: trinib Date: Thu, 17 Nov 2022 06:13:40 -0400 Subject: [PATCH] Create alternatives for history|find|cd.md --- alternatives for history|find|cd.md | 169 ++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 alternatives for history|find|cd.md diff --git a/alternatives for history|find|cd.md b/alternatives for history|find|cd.md new file mode 100644 index 0000000..c547bab --- /dev/null +++ b/alternatives for history|find|cd.md @@ -0,0 +1,169 @@ +The most commonly used commands when navigating are `history`, `find`, `cd`. Here are some examples of simple alternative tools that does a better job. + +

Easily view, navigate, search history commands

+ +[htsr](https://github.com/dvorka/hstr)
+![hts](https://user-images.githubusercontent.com/18756975/201403803-7f899124-3412-443c-9b6d-e60b8b2ca889.png)
+_**Install**_ : +```bash +sudo apt-get install hstr -y && hstr --show-configuration >> ~/.bashrc +``` +> **Note** - Other installation info - [github.com/dvorka/hstr/blob/master/INSTALLATION.md](https://github.com/dvorka/hstr/blob/master/INSTALLATION.md#installation) + +**_Usage_** : +```bash +hstr keyword +``` +Interactive searching🔎 : +`Ctrl+R` + +>**Note** - More info on usage : + +> man hstr +# + +

+
+ + +

A simple and userfriendly way to find files

+ +

+fd and fzf
+ + + +_**Install**_ : +```bash +sudo apt-get install fd-find -y && sudo apt-get install fzf -y +``` + +_**Add binary link**_(set correct bin directory location if error) : +```bash +ln -s $(which fdfind) ~/.local/bin/fd +``` +_Restart terminal_ +> **Note** - Other installation info :
+[github.com/sharkdp/fd#installation](https://github.com/sharkdp/fd#installation)
+[github.com/junegunn/fzf#installation)](https://github.com/junegunn/fzf#installation) + +_**Usage**_ : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandDescription
fd fooFind in current directory, the string pattern name "foo", in parent|sub directories and files.
fd foo /FOO2Find in "FOO2" directory, the string pattern name "foo", in parent|sub directories and files.
fd -g|--glob foo /FOO2Find in "FOO2" directory, the glob pattern name matching "foo", in parent|sub directories and files.
fd /foo -p|--path /FOO2Find in "FOO2" directory and view the files and directory paths and its contents that is or starts with the string pattern name "foo".
fd foo/ -p|--path /FOO2Find in "FOO2" directory and view the directory paths and its contents that is or ends with the string pattern name "foo".
fd -t|--type -d fooFind for directory type only.
fd -t|--type -f fooFind for file type only.
fd -t|--type d -t|--type e fooFind for empty directories only.
fd -a|--absolute-path fooFind in current directory showing the full path, the string name "foo", in parent|sub directories and files.
fd -e|--extension txtFind for a particular file extension.
fd -H|--hidden fooFind for hidden and ignored files.
+ +fzf interactive searching🔎 : +`Ctrl+T` + +>**Note** - More info on usage : + +> man fd + +> man fzf +# + +

+
+ +

A faster way to move around directories

+ +[commacd](https://github.com/shyiko/commacd) + +_**Install**_ : +```bash +curl -sSL https://github.com/shyiko/commacd/raw/v1.0.0/commacd.sh -o ~/.commacd.sh && \ + echo "source ~/.commacd.sh" >> ~/.bashrc +``` + +commacd exports three commands: forward(`,`) │ backward(`,,`) │ backward+forward(`,,,`) + +_**Usage**_ : +| Description | commacd | command | +| :--:| :--: | :--: | +| Enter directories using| , des | | +| abbreviations. | └─> | cd Desktop | + +| Description | commacd | command | +| :--:| :--: | :--: | +| Move through multiple directories| , u/l/ce | | +| using abbreviations. | └─> | cd /usr/local/Cellar | + +| Description | commacd | options | +| :--:| :--: | :--: | +| Choose directories with names | , d | | +| starting with same letter. | 0 | Desktop | +| (= multiple choices) | 1 | Documents | +| 0, 1 or 2 | 2 | Downloads | + +| Description | commacd | command | +| :--:| :--: | :--: | +| Given two directories jdk7 and jdk8 | , ~/d/j*8 | | +| on the Desktop, cd into jdk8 without hitting | └─> | cd ~/Desktop/jdk8 | +| interactive mode (the one shown above). | | | + +| Description | commacd | +| :--:| :--: | +| Go back previous directory | ,, .. | + +Tab = Autocomplete + +>**Note** - More info on usage : + +> [shyiko.com/commacd](https://shyiko.com/2014/10/10/commacd/) + +# + +

+
+ +_There are many more alternative tools available that may fit your needs_