p3l6.dev|

Misc commands

<<Back to Index

Ripgrep

rg is a modern alternative to unix grep. Github.

Fd

fd is a modern alternative to unix find. Github.

Examples:

  • fd name A simple find of files in the cwd with name.
  • fd -e txt Finds all files with extension txt.
  • fd -x cmd Run a command with all matches, like find ... | xargs ....
  • fd -X cmd Run a command for each match, like find ... | xargs -n 1 ....
  • fd -e py -X rg <regex> Search python files for a regex.

Sd

sd is a modern alternative to unix sed. Github.

Simple interface: sd before after

Choose

choose is a modern alternative to unix cut or simple awk. Github. Install brew install choose-rust.

Examples:

  • choose 3 Selects column three.
  • choose 1:4 Column ranges, inclusive.
  • choose :3 Selects through column three.
  • choose -4:-1 Columns counted from the last.
  • choose -f , Change field separator, default whitespace.

Exa

exa is a modern alternative to unix ls. Website.

Examples:

  • exa --l Long format
  • exa --tree A recursive tree view of all decendents.
  • exa --git-ignore Excludes files ignored by git.
  • exa --git Includes git statuses.
  • exa --extended Includes xattrs.

Zip

  • Zip a folder, including folder name: zip -r <Archive.zip> folder/
  • List zip contents: unzip -l <Archive.zip>
    • Or, zip -sf <Archive.zip>
  • Clean unwanted files: zip -d <Archive.zip> __MACOSX/\* or zip -d <Archive.zip> \*/.DS_Store