/docs/terminal/cli-tools.md

https://github.com/ericmjl/essays-on-data-science · Markdown · 118 lines · 83 code · 35 blank · 0 comment · 0 complexity · 02f307f68db4e6cfd6bf8cf204775547 MD5 · raw file

  1. # Tools and Upgrades for your CLI
  2. In this short essay,
  3. I would like to introduce you
  4. to a list of awesome command-line tools
  5. that I have found on the internet.
  6. Most of the tools listed here do one thing really well:
  7. they add visual clarity to the text that we are looking at.
  8. This is mostly done by colorizing the terminal
  9. with syntax highlighting.
  10. Without further ado, let's get started listing them.
  11. ## `exa`
  12. [`exa`](https://the.exa.website/) is a favourite of mine,
  13. because it is an almost drop-in replacement for `ls`,
  14. except with saner defaults.
  15. It also comes with a saner set of defaults for the `tree` command.
  16. After installing, you can replace `ls` and `tree` with `exa` by aliasing:
  17. ```bash
  18. alias ls='exa --long --git -a --header --group'
  19. alias tree='exa --tree --level=2 --long -a --header --git'
  20. ```
  21. ## `tmux`
  22. [`tmux`](https://github.com/tmux/tmux) is another daily driver of mine.
  23. I use it to keep remote terminal sessions persistent,
  24. and use it effectively as a workspace manager between projects.
  25. ## `nanorc`
  26. If you're like me, and are accustomed to the `nano` text editor
  27. rather than `vim` or `emacs`,
  28. then [`nanorc`](https://github.com/scopatz/nanorc),
  29. a set of syntax highlighting configurations
  30. provided by [Anthony Scopatz](https://twitter.com/scopatz)
  31. is an awesome addition to your `nano` toolkit.
  32. (For what it's worth, I wrote this short essay in `nano`,
  33. and `nanorc` played no small role in making the text readable!)
  34. ## `diff-so-fancy`
  35. [`diff-so-fancy`](https://github.com/so-fancy/diff-so-fancy)
  36. is a drop-in replacement for `diff`,
  37. and makes it so much easier read diffs between two files.
  38. After installation, you can easily replace `diff` with `diff-so-fancy` through aliasing:
  39. ```bash
  40. alias diff="diff-so-fancy"
  41. ```
  42. ## `bat`
  43. [`bat`](https://github.com/sharkdp/bat) is another one of those instant favourites.
  44. I use `cat` and `less` often to look through files,
  45. but `bat` takes things to another level.
  46. It is basically a mash-up between `cat` and `less`,
  47. allowing you to scroll through your files in a `less`-like scrolling fashion,
  48. while also providing syntax highlighting for the files you open.
  49. At the same time, it'll let you concatenate two files together (just like `cat`)
  50. and display them to the screen.
  51. After installing, you can replace `cat` with `bat` by aliasing as well:
  52. ```bash
  53. alias cat="bat"
  54. ```
  55. ## `fd`
  56. [`fd`](https://github.com/sharkdp/fd)
  57. is another tool that provides saner syntax than the default `find`.
  58. After installing, you can replace `find` with `fd` by aliasing:
  59. ```bash
  60. alias find="fd"
  61. ```
  62. ## `ripgrep`
  63. [`ripgrep`](https://github.com/BurntSushi/ripgrep)
  64. is a tool that will let you search directories recursively for a particular pattern.
  65. This can help you quickly find text inside a file inside the file tree easily.
  66. ## References
  67. [Vim From Scratch](https://www.vimfromscratch.com/articles/awesome-command-line-tools/)
  68. introduced many of the tools shown here,
  69. and I want to make sure that the author gets credit
  70. for finding and sharing these awesome tools!
  71. [James Weis](https://www.linkedin.com/in/jameswweis/) introduced me to `tmux`
  72. while in grad school, and I've been hooked ever since.
  73. ## Thank you for reading!
  74. If you enjoyed this essay and would like to receive early-bird access to more,
  75. [please support me on Patreon][patreon]!
  76. A coffee a month sent my way gets you _early_ access to my essays
  77. on a private URL exclusively for my supporters
  78. as well as shoutouts on every single essay that I put out.
  79. [patreon]: https://patreon.com/ericmjl
  80. Also, I have a free monthly newsletter that I use as an outlet
  81. to share programming-oriented data science tips and tools.
  82. If you'd like to receive it, sign up on [TinyLetter][tinyletter]!
  83. [tinyletter]: https://tinyletter.com/ericmjl