MOFO Linux: Bash Aliases

Written and curated by Webmaster / Developer Philip C.
HOME Using MOFO Linux Downloads Breaking Censorship

Move from Windows to Linux
Eescape the walled garden and liberate your computing.

We earn a commission if you make a purchase, at no additional cost to you.
"Life is too short to go without abbreviations and aliases in Bash."

Listing files and Directories
	ls	ls --color=auto
	grep	grep --color=auto
	fgrep	fgrep --color=auto
	egrep	egrep --color=auto
	ll	ls -alF
	la	ls -A
	l	ls -CF
	zenity	zenity 2>/dev/null

Screen management
	c	clear

Syntax highlighting for cat (requires ccat binary)
	cat	ccat --bg=dark $*
	ccat	ccat --bg=dark $*

Use python 3 in bash
	python	python3
	pip	python3.8 -m pip
	pip3	python3.8 -m pip

	tmux	tmux -2

Use Neovim instead of Vim
	vim	nvim

Vim keys to exit the shell
	:q	exit

Use x-terminal-emulator instead of xterm
	xterm	x-terminal-emulator
	uxterm	x-terminal-emulator
	lxterm	x-terminal-emulator

Start usbreset-helper, fuzzy device selection
    usbreset usbreset-helper

Start a Surfraw web search in W3M terminal browser, fuzzy elvi selection
    sr       sr -browser=

Start a Surfraw web search in the GUI browser, fuzzy elvi selection
    surfraw  surfraw -browser=

Shortcuts for Wireguard VPN
Start the VPN (select the config file)...
	wgup	basename -s .conf $(ls /etc/wireguard) | fzf --preview-window=hidden | xargs -ro -d "
" wg-quick up $*

Stop the VPN (select the detected interface)...
	wgdn	sudo wg | grep interface | cut -f2 -d " " | fzf --preview-window=hidden | xargs -ro -d "
" wg-quick down $*

Copy VPN configs from present directory to /etc/wireguard
	wgxfr	fd -d 2 -t file -e conf . | fzf -m --preview-window=hidden --layout=reverse | \
                xargs -I{} sudo cp -f "{}" /etc/wireguard/; sudo chmod 640 /etc/wireguard/*.conf"

fzf Fuzzy Search previews text with ccat
	fzf	fzf --preview="ccat {}"

Ripgrep (with rgpipe) text search in local files
	rgg	rg -i -z --max-columns-preview --max-columns 500 --hidden --no-ignore --pre-glob \
                '*.{pdf,xl[tas][bxm],xl[wsrta],do[ct],do[ct][xm],p[po]t[xm],p[op]t,html,htm,xhtm,xhtml,epub,chm,od[stp]}' \
                --pre rgpipe

© 2015 - 2024, All Rights Reserved.
About, Contact Us, Privacy Policy and Affiliate Disclosure, XML Sitemap.
This website is reader-supported. As an Amazon affiliate, I earn from qualifying purchases.