JustToThePoint English Website Version
JustToThePoint en español
JustToThePoint in Thai

Awesome command linux tools: bat, fzf, exa, ripgrep, youtube-dl, xclip

  1. Installation: choco install bat (Windows), sudo apt install bat (Ubuntu), pacman -S bat (Arch).
  2. If you install bat this way, the executable may be installed as batcat instead of bat. You can set up a bat–> batcat symlink: ln -s /usr/bin/batcat ~/.local/bin/bat.

Installation: brew install ripgrep (macOS), choco install ripgrep (Windows), pacman -S ripgrep (Arch), sudo apt-get install ripgrep (Debian, Ubuntu).

How do I find all files containing a specific text? Using grep: grep -rnw “/path/to/somewhere” -e “specificText” (-r: recursive; -n: line number; w: match the whole world). Using ripgrep: ripgrep “specificText/pattern” /path/

  1. Installation: git clone ‐‐depth 1 https://github.com/junegunn/fzf.git ~/.fzf ~/.fzf/install Do you want to enable fuzzy auto-completion? ([y]/n) y Do you want to enable key bindings? ([y]/n) y Do you want to update your shell configuration files? ([y]/n) y It will add this line (vim .bashrc): [ -f ~/.fzf.bash ] && source ~/.fzf.bash

  2. Let’s find files ending with .md: fzf ‐‐query=.md$

  3. Fuzzy search can be triggered with **: cd **<TAB>, cd ~/.config/cal**<TAB> (it searches for files and directories under ~/.config that match `cal`: /home/myUser/.config/calcurse), vim .config/default.yml** (my first result is .config/espanso/default.yml). Fuzzy completion for PIDs is provided for the kill command: kill -9 . You may also want to preview the files: fzf ‐‐preview ‘cat {}’

  4. You could use bat for this purpose. Use: fzf ‐‐preview ‘bat ‐‐color=always ‐‐style=numbers ‐‐line-range=:500 {}’

    nvim .bash_aliases/.zsh_aliases: #Credits: Luke Smith.

    alias prev="fzf ‐‐preview 'bat ‐‐style=numbers ‐‐color=always {}'"
    searchEdit() { du -a ~/Dropbox/ ~/.config/ | awk '{print $2}' | fzf | xargs -r $EDITOR ; }
    
  5. Use: searchEdit. du: lists recursively files and directories and their sizes in ~/Dropbox/ and ~/.config/. awk ‘{print $2}’ is used to get rid of their sizes. fzf performs a fuzzy search on the previous list, and xargs runs the edit command. xargs -r means: “do not run the command if it is empty.”

It is a command-line clipboard manager. It enables you to copy the standard input from your terminal to your clipboard, so you can paste it to a GUI application (gedit, atom, brave, etc.)

Use. Copy a file into the clipboard: cat file | xclip -sel clip. Let’s copy a password to the clipboard: pass Root/Ocio/amazon.es | xclip -sel clip. To paste the text you just copied, you should use: xclip -selection clipboard -o

Bitcoin donation

JustToThePoint Copyright © 2011 - 2022 PhD. Máximo Núñez Alarcón, Anawim. ALL RIGHTS RESERVED. Bilingual e-books, articles, and videos to help your child and your entire family succeed, develop a healthy lifestyle, and have a lot of fun.

This website uses cookies to improve your navigation experience.
By continuing, you are consenting to our use of cookies, in accordance with our Cookies Policy and Website Terms and Conditions of use.