Skip to main content

Useful Commands

· 3 min read
John M Telford

CloudDocs Path

~/Library/Mobile\ Documents/com~apple~CloudDocs

Docusaurus

Docusaurus

Markdown Headers

:::

slug: title: authors: jmt tags: []


:::

Command Line Tools

Docusaurus Command Line Tools

  • yarn start — Builds and serves a preview site locally
  • yarn build — Compiles site for production
  • yarn start --hot-only
  • serve — Serve built website locally

Mac

List Open Ports

:::shell sudo lsof -i :port` :::

Bash

Translate .tsv to .csvprint

:::shell tr ‘\t’ ‘,’ < file.tsv > file.csv :::

Show Hidden Files

:::shell cmd+shift+. :::

:::shell find . -name .git -prune -name ‘.DS_Store’ -prune -o -print | sed -e “s/-\/*\// |/g” -e “s/|([^ ])/|-\1/“ | gawk -F”-“ ‘{ print $2}’ | sort -u :::


Rust Utils

bandwhich

Display current network utilization by process, connection and remote IP/hostname

broot

A better way to navigate directories

exa

A modern replacement for ls.

fd

A simple, fast and user-friendly alternative to find

gitui

Blazing fast terminal client for git written in Rust

lms

A fast and reliable alternative to rsync for synchronizing local files

mdbook

A utility to create modern online books from Markdown files

mdbook-admonish

procs

A modern replacement for ps

ripgrep

ripgrep (rg) is a line-oriented search tool that recursively searches the current directory for a regex pattern.

scrubcsv

Remove bad lines from large CSV files and normalize the rest

stdrename

Remake all files in a folder according to a specified naming convention (camelCase, snake_case, kebab-case, etc)

obliviate

Utility that removes file older than a certain amount of days

xsv A high performance CSV command line toolkit

Rualdi

rualdi

rada workdir Add current directory with workdir as alias

rada www /var/www Add /var/www directory with www as alias

rada stuff ~/stuff Works with home tild alias

radax workdir Add current directory with workdir as alias and add environment variable named RAD_WORKDIR in current environment and in configuration file

radax workdir . wd Add current directory with workdir as alias and add environment variable named RAD_WD in current environment and to the configuration file

radx workdir wd Add environment variable named RAD_WD which points on alias workdir in current environment and to the configuration file

radx workdir Add environment variable named RAD_WORKDIR which points on alias workdir in current environment and to the configuration file

radxn workdir wd Add environment variable named RAD_WD which points on alias workdir in current environment without adding it to the configuration file

rad www/some-site Perform cd in /var/www/some-site

rad - Go back to previous directory as cd do it

radr workdir Remove workdir alias and environment variable associated if exists

radr www stuff Works with multiple aliases at same time

radxr workdir Remove environment variable which points on alias workdir

radl List aliases and environment variables


rg - Recursive Grep

#rg -c —countOnly show the count of matching lines for each file. -f —file <PATTERNFILE> Search for patterns from the given file -I, —no-filename Never print the file path with the matched lines -N —no-line-number Suppress line numbers. -S —smart-case Smart case search. -v —invert-match Invert matching -w —word-regexp Only show matches surrounded by word boundaries. -z —search-zip Search in compressed files