SHARE WITH THE CLASS: What aliases are you using? (kbin.social)
from macallik@kbin.social to linux@lemmy.ml on 20 Sep 2023 16:57
https://kbin.social/m/linux@lemmy.ml/t/472971

From bash to zsh and everywhere in between, show me yours and I'll show you mines. Inspire others or get some feedback.

Simply copy & paste the output of alias in your terminal or add some comments to explain things for others.

Edit: Kbin users, click 'More' on a comment and use the fediverse link to read responses that have funky formatting

#linux

threaded - newest

macallik@kbin.social on 20 Sep 2023 17:01 next collapse

(Bash-Specific)

App-Specific

alias battery='upower -i $(upower -e | grep 'BAT') | grep -E "state|to\ full|percentage"' # Get the battery level of my laptop server when I ssh into it

alias audio="yt-dlp -f 'ba' -x --audio-format mp3" # Download the audio version of a youtube video

alias wttr="curl wttr.in/Chicago" # Get the weather of my city in the terminal

Terminal Navigation

alias ba2sy="cp ~/.bash_aliases ~/Sync/" # copy my current iteration of my aliases to my shared syncthing folder so that it's accessible across devices

alias sy2ba="cp ~/Sync/.bash_aliases ~/" # replace the current iteration of my aliases w/ the synced version from my syncthing folder

alias mba='micro .bash_aliases' # open my aliases file in the modernized version of 'nano'

alias reload="source ~/.bashrc" # Quickly refresh my system so that the latest alias file is loaded

alias l='exa --group-directories-first -hlras modified --no-user --icons' # exa is a prettier version of ls. Options toggled: Human-readable, long format, reverse output, show hidden files/folders, sort by modified, hide the 'user' column since I'm the only one that uses the computer, and show the icons to make it look fancy```

Replaced Commands

alias cat='batcat --theme=ansi ' # Replace generic output of cat w/ a formatted version. This is bat (batcat in Debian)

alias rm='trash ' # Instead of auto-deleting files, put them in the 'trash' bin for 30 days, then delete.

Server & Docker-related

alias lazy='/home/macallik/.local/bin/lazydocker' # Run Docker

alias pad='ssh MyPad20334' # shorthand to ssh into my server
RaivoKulli@sopuli.xyz on 21 Sep 2023 09:31 next collapse

I wonder if you can be a madlad and symlink your bash-aliases to a synced file.

tvcvt@lemmy.ml on 22 Sep 2023 11:36 collapse

Not a symlink, but you can add source /path/to/aliases one your bashrc file to load them from another file. I do that and keep all of my dot files in a hit repo.

babeuh@lemmy.world on 26 Sep 2023 06:17 collapse

exa is unmaintained, as per the the developer you should use eza instead.

macallik@kbin.social on 26 Sep 2023 16:49 collapse

Thanks for the heads up

OpticalMoose@discuss.tchncs.de on 20 Sep 2023 17:09 next collapse

alias hgrep=‘function _f(){ history | grep $1; };_f’

Because I’m to lazy to type

history | grep whatever_I’m_looking_for

Pantherina@feddit.de on 20 Sep 2023 22:04 collapse

alias rpmfind='rpm -qa | grep'
OpticalMoose@discuss.tchncs.de on 20 Sep 2023 22:25 collapse

OMG. I originally got the impression (from somewhere) that you couldn’t pass arguments to an alias, so I googled and found that weird function nonsense. Oh well, live and learn. Thanks.

I_Am_Jacks_____@lemmings.world on 20 Sep 2023 17:17 next collapse

For system updates:

[ -r /etc/os-release ] && . /etc/os-release
case "$ID" in
  arch|archarm)
    if which paru > /dev/null 2>&1; then
      alias updates='echo Using paru; paru'
    else
      alias updates='echo Using pacman; sudo pacman -Syu --noconfirm'
    fi
    ;;
  debian|ubuntu)
    alias updates='echo Using apt dist-upgrade; sudo apt update && sudo apt dist-upgrade -y'
    ;;
esac
ShittyBeatlesFCPres@lemmy.world on 20 Sep 2023 17:38 collapse

I have a similar one but I did it this way:

function ins {
  PACKAGE="${1}"
  exists() {
    command -v "$1" >/dev/null 2>&1
  }

  if exists dnf; then #Fedora
    sudo dnf update && sudo dnf install -y $PACKAGE
  elif exists apt; then #Debian
    sudo apt update && sudo apt install -y $PACKAGE
  elif exists apk; then #Alpine
    apk -U upgrade && apk add $PACKAGE
  elif exists emerge; then #Gentoo
    sudo emerge $PACKAGE
  elif exists zypper; then #Suse
    sudo zypper ref && sudo zypper install $PACKAGE
  elif exists pacman; then #Arch
    pacman -S $PACKAGE
  elif exists brew; then #MacOS
    brew install $PACKAGE
  else
    echo 
ShittyBeatlesFCPres@lemmy.world on 20 Sep 2023 17:42 next collapse

Actually that’s the install one. Here’s the upgrade one:

function upg {
  exists() {
    command -v "$1" >/dev/null 2>&1
  }

  if exists dnf; then #Fedora
    sudo dnf update && sudo dnf -y upgrade && sudo dnf -y autoremove
  elif exists apt; then #Debian
    sudo apt update && sudo apt full-upgrade -y
  elif exists apk; then #Alpine
    apk -U upgrade
  elif exists emerge; then #Gentoo
    sudo emerge --ask --verbose --update --deep --newuse @world && sudo emerge --ask --verbose --depclean
  elif exists zypper; then #Suse
    sudo zypper ref && sudo zypper update
  elif exists pacman; then #Arch
    pacman -Syu
  elif exists brew; then #MacOS
    brew update &
I_Am_Jacks_____@lemmings.world on 20 Sep 2023 17:45 collapse

Very nice

doomkernel@sopuli.xyz on 20 Sep 2023 17:22 next collapse

I’ve got the standard ones (l, ll, ls) to be forms of ls -flags

df = df -h
mv = mv -i
rm = rm -i
nix-switch = sudo nix-rebuild --switch flake .
nix-upd = nix flake update
systat = systemctl status
sysena = sudo systemctl enable
systop = sudo systemctl stop

macallik@kbin.social on 20 Sep 2023 18:42 next collapse

Digging the systemctl ones. I added myself to the group so that I wouldn't have to write sudo each time, but I might as well alias the entire prompt for restart and status to make it even shorter

rutrum@lm.paradisus.day on 20 Sep 2023 21:28 collapse

I also use alias nd=nix develop a lot.

chrishazfun@lemmy.world on 20 Sep 2023 17:22 next collapse

alias getmp4="yt-dlp -f 'bestvideo+bestaudio[ext=m4a]/best[ext=mp4]' --recode-video mp4"
alias getmp3="yt-dlp -x --audio-format mp3"
alias downloadwebsite="wget -mkEpnp"

flushall () {
	sudo pacman -Scc
	sudo pacman -Rns $(pacman -Qdtq)
	flatpak uninstall --unused
}

updateall () {
	yay
	flatpak update
	while
		read -p "Clear cache and uninstall orphans? (y/N)" answer
	do
		case $answer in
			([yY][eE][sS] | [yY]) flushall;;
			(*) break;;
		esac
	done
}
megane_kun@lemm.ee on 20 Sep 2023 17:23 next collapse

Some QoL stuff my good friend set-up for me.

# ALIASES -- EXA
alias ls='exa --group-directories-first --color=auto -h -aa -l --git'

# ALIASES -- YAY
alias yy='yay -Y --needed --norebuild --nocleanafter --nodiffmenu --noredownload --nocleanmenu --removemake --sudoloop'
alias ya='yay -S --needed --norebuild --nocleanafter --nodiffmenu --noredownload --nocleanmenu --removemake --sudoloop'
alias yu='yay -R --recursive --nosave'

# ALIASES -- CP
alias cp="cp --reflink=auto -i"

And then there’s a bunch of stuff from the output of alias, most of them are git aliases. Those which aren’t git-related are listed below:

-='cd -'
...=../..
....=../../..
.....=../../../..
......=../../../../..
1='cd -1'
2='cd -2'
3='cd -3'
4='cd -4'
5='cd -5'
6='cd -6'
7='cd -7'
8='cd -8'
9='cd -9'
_='sudo '
cp='cp --reflink=auto -i'
egrep='grep -E --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}'
fgrep='grep -F --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}'
history=omz_history
l='ls -lah'
la='ls -lAh'
ll='ls -lh'
ls='exa --group-directories-first --color=auto -h -aa -l --git'
lsa='ls -lah'
md='mkdir -p'
rd=rmdir
run-help=man
which-command=whence
macallik@kbin.social on 20 Sep 2023 18:36 next collapse

Good to see another exa user. Care to break down what yay does btw?

megane_kun@lemm.ee on 20 Sep 2023 19:57 collapse

Ah, yay is an AUR helper, though I personally see it as a pacman helper as well. Link here. Some of the flags and options that can be used for pacman can be used for yay, thus, some of the flags in the aliases I use are actually for pacman. Anyways, on to the breakdown.

alias yy=‘yay -Y --needed --norebuild --nocleanafter --nodiffmenu --noredownload --nocleanmenu --removemake --sudoloop’

This one is what I use to look up for packages. The result of runnning yy «search term» would be a list of packages matching the search term and prompting the user on which package(s) to install.

flag description
-Y performs yay-specific operations.
–needed (pacman) do not reinstall up to date packages
–norebuild skips package build if in cache and up to date
–nocleanafter do not remove package sources after successful build
–noredownlod skip pkgbuild download if in cache and up to date
–nodiffmenu don’t show diffs for build files
–nocleanmenu don’t clean build PKGBUILDS
–removemake remove makedepends after install
–sudoloop loop sudo calls in the background to avoid timeout

alias ya=‘yay -S --needed --norebuild --nocleanafter --nodiffmenu --noredownload --nocleanmenu --removemake --sudoloop’

This one is what I use for installing packages. Useful if I already know what package I would be installing.

flag description
-S (pacman, extended by Yay to cover AUR as well) Synchronize packages. Packages are installed directly from the remote repositories, including all dependencies required to run the packages.

alias yu=‘yay -R --recursive --nosave’

This one is what I use when uninstalling packages. I usually check the package name with something like yay -Qi «package-name-guess» beforehand.

flag description
-R (pacman, extended by Yay to also remove cached data about devel packages) Remove package(s) from the system.
–recursive (pacman) Remove each target specified including all of their dependencies, provided that (A) they are not required by other packages; and (B) they were not explicitly installed by the user. This operation is recurisve and analogous to a backwards –sync operation.
–nosave (pacman) Instructs pacman to ignore file backup designations. (This avoids the removed files being renamed with a .pacsave extension.)

I actually don’t know much about both yay and pacman myself, since the aliases were just passed onto me by the same friend who helped me (re-)install my system (long story) and set-up the aliases. Having looked all these up, however, I might make a few changes (like changing the –nocleanafter and –nocleanmenu options to their clean ones`).

soloner@lemmy.world on 20 Sep 2023 18:43 collapse

I like the idea of binding numbers to parent directory traversal. I do cd …/… a lot in one of my projects (switching between source code and terraform folder), it’d be handy to get out of the terraform folder by just typing 2.

megane_kun@lemm.ee on 20 Sep 2023 20:12 collapse

I actually would do cd … and then do a pwd (and so on, repeatedly) because I often get confused and have a very short attention span that the aliases ended up unused.

iHUNTcriminals@lemm.ee on 20 Sep 2023 17:27 next collapse

What… I didn’t know this was a thing.

So I could make be “sudo gimme-dat-new-new” Instead of “sudo DNF upgrade -y”

Vilian@lemmy.ca on 20 Sep 2023 17:32 next collapse

you can just put “gimme-dat-new-new”

s20@lemmy.ml on 20 Sep 2023 18:49 collapse

alias gimmie-dat-new-new=‘sudo dnf upgrade -y’

Although you should probably look over your upgrade before applying it as a general good practice. But, hey, I do this myself (dnfup instead of gimmie-dat-etc.), so I can’t talk too much shit.

ETA: If you want it to be a persistent alias, though, you gotta add it to your .bashrc

Mambert@beehaw.org on 20 Sep 2023 17:34 next collapse

I Alias “sudo !!” with “plz”

Cwilliams@beehaw.org on 20 Sep 2023 23:12 next collapse
uberrice@feddit.de on 22 Sep 2023 23:13 collapse

For me it’s stfu

megane_kun@lemm.ee on 20 Sep 2023 17:35 next collapse

This is a separate reply since I didn’t know that you can include shell functions here.

I made this little function read_latest_log() because I just want to “read the latest log file” in a directory full of timestamped log files. I made a helper function separator_line_with_text() to help with the output, basically setting off the file-info portion (just the filename for now) from the file contents.

# # separator_line_with_text
# # Centers text in a separator line
# #
# # Usage:
# # separator_line_with_text «separator_char» «text»
separator_line_with_text() {
local separator_char="$1"
local contents_str="$2"

# Calculate separator_length
local separator_length=$(( $(tput cols) - 2 - ${#contents_str} ))

# Calculate the width of the left and right parts of the separator line
local half_line_width=$(( (${separator_length}) / 2 ))

# Construct the separator line using the $separator_char and $contents_str
for ((i = 0; i « half_line_width; i++))
do
echo -n ${separator_char}
done

echo -n ${contents_str}

for ((i = 0; i < half_line_width; i++))
do
echo -n ${separator_char}
done

echo ""
}

# # read_latest_log
# # Reads the latest log file with a timestamp in the filename.
# #
# # Usage:
# # read_latest_log [[«name_filter»] «extension»] «separator» «timestamp_field_number»
read_latest_log () {
  # Check if the function has sufficient parameters
  if [[ $# -lt 2 ]]; then
    echo "Error: insufficient parameters."
    echo "Usage: read_latest_log [[«name_filter» = *] [«extension» = log] «separator» «timestamp_field_number»"
    return 1
  fi

  # Supposing only two parameters are provided
  # «name_filter» parameter is "*"
  # «extension» parameter is "log"
  if [[ $# -eq 2 ]]; then
    local name_filter="*"
    local extension="log"
    local separator="$1"
    local field="$2"
  fi

  # Supposing only three parameters are provided,
  # assume that the «name_filter» parameter is "*"
  if [[ $# -eq 3 ]]; then
    local name_filter="*"
    local extension="$1"
    local separator="$2"
    local field="$3"
  fi

  # If all parameters are provided, assign them accordingly
  if [[ $# -eq 4 ]]; then
    local name_filter="$1"
    local extension="$2"
    local separator="$3"
    local f
GustavoM@lemmy.world on 20 Sep 2023 17:57 next collapse

Feel free to call me a poser, a scrub, etc but I don’t use aliases (other than the default ones, that is).

Why? Two words:

Brain. Exercise.

jana@leminal.space on 20 Sep 2023 19:13 collapse

Finger. Exercise.

Staraven1@lemmy.blahaj.zone on 20 Sep 2023 21:47 collapse

I’ve got a “println” finger reflex now xD

Scio@kbin.social on 20 Sep 2023 18:03 next collapse

I'm going to assume all these syntax highlighted HTML embeds are from Lemmy users. Sadly, illegible on Kbin.

macallik@kbin.social on 20 Sep 2023 18:37 collapse

Ahhh I was wondering what that was as a fellow kbin-er. I was pleasantly surprised when I found out I could create threads across the fediverse today as a consolation.

Edit: Click the 'more' button on the comment and get the fediverse link to view the formatted post

ProtonBadger@kbin.social on 20 Sep 2023 18:18 next collapse

Just some simple stuff:

Strix ~> alias
alias balanced 'asusctl profile -P balanced'
alias performance 'asusctl profile -P performance'
alias quiet 'asusctl profile -P quiet'
alias upd 'yay ; flatpak update'
Aatube@kbin.social on 20 Sep 2023 18:18 next collapse

alias cat lolcat
alias ccat whatever ohmyzsh does for their colorize extension, I know it’s a function alias

Limitless_screaming@kbin.social on 20 Sep 2023 18:20 next collapse

alias clear="clear; fastfetch"
alias sudo="doas"
alias clr="clear"
alias kx="killall Xwayland"
alias vpython="~/newVenv/bin/python"
alias vpip="~/newVenv/bin/pip"

ouch@lemmy.world on 20 Sep 2023 20:01 collapse

I just use ^L instead of clear.

macallik@kbin.social on 20 Sep 2023 22:27 collapse

same

olafurp@lemmy.world on 20 Sep 2023 19:42 next collapse

I have codebase of 5k lines. Most used are git commands (squash all to merge base, push to current branch, commit with format etc), work shortcuts for starting projects, time logging, startup programs. Then I have some cli interface for redo commands, size of current folders for disk pruning, abandoned project alias, os commands like brightness adjust, launch game on steam with qwert instead of dvorak keyboard, search cli history, kill with regex matching…

Just anything that I don’t want to Google twice. bash is life

clemdemort@lemmy.world on 20 Sep 2023 20:09 next collapse

I’ve got aliases for every faltpak app I launch in the terminal for instance I’ve got code for vscodium or steam for well steam for example, I also alias some system commands so I have an update-grub, update, etc…

I also alias LSD to LS for obvious reasons.

macallik@kbin.social on 20 Sep 2023 22:03 collapse

When I switched to KDE I started using kate, but I used to have code as my vscodium alias as well. One interesting thing is seeing how similar people think. No wonder standard password guesses are so easy lol.

On a related note, I tried to make my SSH port based on the letters turned into numbers and realized that had been done before and was google-able also lol

[deleted] on 20 Sep 2023 20:12 next collapse

.

[deleted] on 20 Sep 2023 20:17 next collapse

.

bennieandthez@lemmygrad.ml on 20 Sep 2023 20:19 next collapse

These are some pacman+fzf implementations from the arch wiki + a flatpak implementation i did with fzf(still needs some polish but it works).

alias pacq=$‘pacman -Q | fzf’

alias pacs=$‘pacman -Slq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S’

alias pacr=$‘pacman -Qq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -Rns’

alias flatr=$‘flatpak list | fzf --preview 'flatpak info {2} ' | grep -Eo '[a-ZA-Z]+.[^ ]+' |awk '{print $1}' | xargs -ro flatpak remove --delete-data’

FluffyPotato@lemm.ee on 20 Sep 2023 20:19 next collapse

I rawdog every single command, I use no aliases at all.

redxef@feddit.de on 21 Sep 2023 03:22 next collapse

I couldn’t even work if I had aliases in my muscle memory. Imagine ssh’ing to a server and every second command you issue doesn’t exist because it’s some weird alias you set up for yourself.

I’ll stick with the “pure” command and use tab completion.

That’s also part of the reason why I don’t use some of the fancy new tools like ripgrep and exa.

duncesplayed@lemmy.one on 21 Sep 2023 04:19 next collapse

Yeah, I remember when Linux was first becoming cool, in the mid-to-late 90s. There was a lot of folk wisdom going around, and one of them was “make an alias rm=‘rm -i’ so you don’t accidentally delete anything!”

And then there was the (correct, IMHO) counter-wisdom of “no, that actually makes it more likely to accidentally delete something, because one day you’re going to be on a machine where that alias doesn’t exist, but you’ve become dependent on it existing”.

I don’t mind creating aliases to add colour or change formatting a little bit or something, but don’t make an alias to keep yourself safe, because it’ll probably backfire on you.

RaivoKulli@sopuli.xyz on 21 Sep 2023 09:28 next collapse

You couldn’t even work if you made a few longer commonly used commands convenient aliases? Well alright.

I can’t imagine how you feel about bash scripts lol.

namingthingsiseasy@programming.dev on 22 Sep 2023 01:41 collapse

Not the person you responded to, but sure. Breaking muscle memory is extremely grating.

Also, it’s pretty easy to type long commands with little typing. If you use ctrl+r to search backward in your history, you can easily recall long commands - and also, you can use ctrl+x,ctrl+e to edit the current command line in $EDITOR so you can edit long commands. These two tricks make it very easy to type long commands quickly with very little typing.

RaivoKulli@sopuli.xyz on 22 Sep 2023 08:24 collapse

it’s pretty easy to type long commands with little typing

Big if true

[deleted] on 21 Sep 2023 22:23 collapse

.

RaivoKulli@sopuli.xyz on 21 Sep 2023 09:28 collapse

Metal

bubstance@lemmy.ml on 20 Sep 2023 20:49 next collapse

A different way to do the usual …=“cd …” and endless chains of …=“cd …/…” types of aliases:

bash/ksh version:

..() {
    local count="${1:-1}"
    local path="../"
    while (( --count > 0 )); do
        path="$path../"
    done
    cd -- "$path"
}

zsh single-line version:

..() { cd $(printf "../%.s" {1..${1:-1}}) }

These take the number of directories that you want to move up as an argument (e.g. … 3), otherwise they move you up one directory when used with no arguments.

macallik@kbin.social on 20 Sep 2023 22:05 next collapse

Thanks for sharing, likely will implement this!

adam@discuss.tchncs.de on 22 Sep 2023 12:38 collapse

There is a shell option for this (at least in zsh): setopt autocd. This allows you to change directories while omitting the cd in front

tho@lemmy.ml on 20 Sep 2023 20:53 next collapse

ccd() {
  mkdir "$1" && cd "$1"
}
SomeBoyo@feddit.de on 20 Sep 2023 21:01 next collapse

I mainly use an alias to ssh into my server and another to stream lofi girl audio with mpv

macallik@kbin.social on 20 Sep 2023 22:06 next collapse

Care to share the lofi mpv one? I use both lol

SomeBoyo@feddit.de on 21 Sep 2023 10:46 collapse

alias lofi='mpv --no-video www.youtube.com/watch?v=jfKfPfyJRdk

ryannathans@aussie.zone on 20 Sep 2023 22:48 collapse

Lofi girl audio?

macallik@kbin.social on 20 Sep 2023 22:52 collapse

More info. Got really big during the thick of covid.

TexasCrowbarMassacre@lemmy.world on 20 Sep 2023 21:10 next collapse

alias forgethist=unset HISTFILE

Useful when I run the same two commands 20 times in a row

tho@lemmy.ml on 20 Sep 2023 21:35 collapse

in zsh you can just forbid it to save duplicates

tho@lemmy.ml on 20 Sep 2023 21:37 next collapse

the only thing this does is add “–recursive” to every git clone invocation

git() {
  if [ "$1" = clone ]; then
    shift
    set -- clone --recursive "$@"
  fi
  command git "$@"
}
tho@lemmy.ml on 20 Sep 2023 21:37 collapse

same for gh (github cli)

gh() {
  if [[ "$1" = repo && "$2" = clone ]]; then
    shift
    shift
    set -- repo clone "$@" -- --recursive
  fi
  command gh "$@"
}
rutrum@lm.paradisus.day on 20 Sep 2023 21:38 next collapse

I don’t like having to renavigate to my project directory in a new terminal:

alias clone='(pwd | urxvt & disown $!)'

Takes my current directory and opens it in my terminal. Then it disowns that new terminal process, so if I close the current terminal the new one doesnt disappear with it.

conkbin@kbin.social on 20 Sep 2023 21:53 next collapse

I got so much crap gathered throughout the years... some of them I don't even use, but, here they are:

#!/usr/bin/zsh
# vi: ft=zsh

#############
# zsh aliases
#############

# grep
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias zgrep='zgrep --color=auto'

# processes
#alias pss='ps auxww | grep -v grep | grep'   # show all processes with user, hide grep itself
alias top='top -i -e m -E m'                # hide inactive and zombie processes, show ram in MB

# update system
alias p='sudo pacman'
alias pu='paru -Sua --noconfirm'
# clean up
alias pc='sudo pacman -Rsn $(pacman -Qdtq) --noconfirm 2>/dev/null; paru -Sccd --noconfirm'

# lvim
alias nvim='lvim'
alias vim='lvim'
alias vi='lvim'
alias v='lvim'

# cpg & mvg
alias cp='/usr/bin/cpg -ig'
alias mv='/usr/bin/mvg -ig'

# other useful ones
alias rm='trash'
alias duu='du -d 1 -h'

# wayland
alias gparted='sudo /bin/env WAYLAND_DISPLAY="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"  XDG_RUNTIME_DIR=/user/run/0  /usr/sbin/gparted'

# edit configs
alias vcs="$EDITOR $XDG_CONFIG_HOME/starship/config.toml"     # starship
alias vca="$EDITOR $XDG_CONFIG_HOME/alacritty/alacritty.yml"  # alacritty
alias vct="$EDITOR $XDG_CONFIG_HOME/tmux/tmux.conf"           # tmux
alias vcv="$EDITOR $XDG_CONFIG_HOME/nvim/init.vim"            # neovim
alias vcl="$EDITOR $XDG_CONFIG_HOME/lvim/config.lua"          # lunarvim
alias vch="$EDITOR $XDG_CONFIG_HOME/hypr/hyprland.conf"       # hyprland
alias vcw="$EDITOR $XDG_CONFIG_HOME/waybar/config"            # waybar

# edit & source zsh configs
alias scz="source $ZDOTDIR/.zshrc"
alias vcz="$EDITOR $ZDOTDIR/.zshrc && source $ZDOTDIR/.zshrc"
alias vczo="$EDITOR $ZDOTDIR/options && source $ZDOTDIR/options"
alias vczb="$EDITOR $ZDOTDIR/bindkeys && source $ZDOTDIR/bindkeys"
alias vcze="$EDITOR $ZDOTDIR/exports && source $ZDOTDIR/exports"
alias vcza="$EDITOR $ZDOTDIR/aliases && source $ZDOTDIR/aliases"
alias vczc="$EDITOR $ZDOTDIR/completions && source $ZDOTDIR/completions"
alias vczf="$EDITOR $ZDOTDIR/functions && source $ZDOTDIR/functions"

# other cool toys
alias exa='exa --long --header --git --sort=name --group-directories-first'
alias ls='exa'
alias cat='bat -pp'
alias bat='bat --style=full'

# x11
# alias X='startx ${XDG_CONFIG_HOME}/X11/xinitrc'
# alias XX='~/.screenlayout/home2.sh'
# alias kb='setxkbmap -rules evdev -model pc105 -layout "ro,de" -variant "basic" -option "grp:shift_caps_toggle"'

# tmux
alias tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf"
alias t="tmux new-session -A -s id"

# dmenu stuff
# alias dnm='networkmanager_dmenu'
# alias dbt='dmenu-bluetooth'

# other cli utils
alias pm='pulsemixer'

# locations
alias lab='cd ~/priv/code/lab'
alias own='cd ~/priv/code/own'
alias pixl='aft-mtp-mount ~/priv/pixl'

# cleanup home
alias irssi="irssi --home ${XDG_CONFIG_HOME}/irssi"
alias svn="svn --config-dir ${XDG_CONFIG_HOME}/subversion"
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts"

# dotfiles
alias stowe="sudo stow -d $HOME/.dotfiles/etc/ -t /etc/"

# ansible
alias ansible-vault='EDITOR=lvim ansible-vault'

# acme
alias acme='acme.sh --home "$XDG_CONFIG_HOME"/acme.sh/'

# vscode
alias code='vscodium --enable-features=UseOzonePlatform --ozone-platform=wayland'

# time sync
alias synctime='echo "time now:" && date && sudo systemctl stop ntpd && sudo ntpd -gq && sudo systemctl start ntpd && echo "new time:" && date'

# nordvpn
alias nvro='sudo systemctl start nordvpnd && nordvpn c ro && nordvpn whitelist add subnet 10.0.0.0/8 && nordvpn set dns 10.10.10.10'
alias nvdown='nordvpn d && sudo systemctl stop nordvpnd'

# work
alias vpnup='nmcli con up vpn-work --ask'
alias vpndown='nmcli con down vpn-work'
alias vpn='nmcli con down vpn-work; nmcli con up vpn-work --ask'
alias vault-connect='source $HOME/work/secrets/vault.work'
alias terraform-connect='source $HOME/work/secrets/terraform.work'
alias teamsx='killall -15 teams'
alias adm='sudo mount /home/$HOME/work/adm'
alias mongo='ssh -L \*:27777:appserver:27017 jumphost'
macallik@kbin.social on 20 Sep 2023 22:10 collapse

Good to see someone else using trash & bat. Kudos for the clean alias file w/ commented headers too! I just started doing it recently and it makes edits/additions so much easier

bnjmn@lemm.ee on 20 Sep 2023 22:18 next collapse

Using trash is good… aliasing it to rm, maybe not so good

macallik@kbin.social on 20 Sep 2023 22:24 collapse

Care to elaborate?

For me, it once caused an issue once when I thought I was deleting files to make space for /boot/efi/ being at capacity (dual booting issues at the time) when in actuality I was just moving files to an impromptu trash can created on /boot/efi (so the lack of space remained the same lol), but on numerous occasions, it has actually saved my ass and allowed me to retrieve documents that I realized I needed to look at again.

The only other quirk is it straight up ignores all options, so I've tried to delete interactively (rm -i) and then had to use trash-list to view the deleted files

bnjmn@lemm.ee on 20 Sep 2023 22:45 collapse

Maybe I’m being a little paranoid, but I DID accidentally delete a few directories with dotenvs in them, which is what led me to find trash in the first place. That experience really traumatized me… so to break the rm habit and make sure I don’t do that on ANY computer I set up abbr rm '# Don\'t use this! Use trash-cli instead’ # and abbr t trash.

conkbin@kbin.social on 20 Sep 2023 23:58 collapse

I try to keep backups of almost everything, so even if I accidentally delete something and only notice after a clear the trash, there is still a chance I will recover the missing pieces.

conkbin@kbin.social on 20 Sep 2023 23:56 collapse

Thanks. It's not the prettiest, but I try to keep an order of some kind... My zshrc was getting quite large, so I split it and when I did that I also put in some comments and headers.

Pantherina@feddit.de on 20 Sep 2023 22:01 next collapse

I alias most of my flatpaks to autorun, made a tool for that called flatalias.

github.com/trytomakeyouprivate/flatalias

Also

set fish_greeting

alias update='flatpak update -y && notify-send -a Updater "Flatpaks ready" && rpm-ostree update && notify-send -a Updater "rpm-ostree ready"'

alias upfin='flatpak update -y && rpm-ostree update && shutdown -h now''

alias flatrm='flatpak remove --delete-data'

alias ls="ls --color=auto -GF"

alias reload="source ~/.config/fish/config.fish && echo 'Fish-config updated'"

abbr conf "kate ~/.config/fish/config.fish && source ~/.config/fish/config.fish && echo 'Fish-config updated'"

### NETWORKING
abbr myip 'curl ifconfig.co'
abbr netlisten 'netstat -plntu'
abbr pingtest 'ping -c 2 wikipedia.de'

abbr rpmq "distrobox enter -n fedora -- dnf search"
abbr rstat "rpm-ostree status"

abbr rpmfind "rpm -qa | grep"

abbr flatinst 'flatpak install -y'

abbr flatfind "flatpak list | grep"

abbr history-off 'set +o history'

abbr sshcloud "ssh -i /home/user/.local/share/Cryptomator/mnt/SSH-keys/KEYNAME -p PORTNUMBER root@IP
# and others

abbr httpcode "curl --head --silent --output /dev/null --write-out '%{http_code}' "

abbr "pin-this" "ostree admin pin 0"
abbr "q" "exit"
abbr c "clear"

abbr errors-boot "journalctl -b"
abbr errors-last-boot "journalctl -b -1"

function copy
    if test -f $argv[1]
        cat $argv[1] | wl-copy
        echo "Copied to clipboard."
    else
        echo "Error: '$argv[1]' is not a file!"
    end
end

abbr off "shutdown -h now"

function findmod
    set mod_path (whereis $argv[1] | cut -d' ' -f2)
    kate $mod_path;
end

function mdtopdf -a filename
  set -x name (basename $filename .md)
  pandoc $filename -o $name.pdf | tee $name.pdf
end

function mdtoodt -a filename
  set -x name (basename $filename .md)
  pandoc $filename -o $name.odt | tee $name.odt
end

function mdtotex -a filename
  set -x name (basename $filename .md)
</
thurstylark@lemm.ee on 20 Sep 2023 22:37 next collapse

Here ya go

Discussion and suggestions welcome :)

macallik@kbin.social on 20 Sep 2023 22:41 collapse

I appreciate the focus on verbosity. I should probably set more of my defaults to follow the same thought process 🤔

garam@lemmy.my.id on 20 Sep 2023 23:13 next collapse

alias ls='ls --time-style=long-iso'
alias la='ls -alh'
alias ncdu='ncdu --color=off'
alias wttr='curl wttr.in/?T0'
alias vim='vimx'
alias ipinfo='curl ipinfo.io --no-progress-meter | jq "del(.readme)"'
alias pp="pkill -SIGSTOP -f "
alias pc="pkill -SIGCONT -f "
macallik@kbin.social on 21 Sep 2023 00:20 next collapse

Another wttr user 👏🏾👏🏾👏🏾

graham1@gekinzuku.com on 21 Sep 2023 03:47 collapse

wttr gang

noli@programming.dev on 21 Sep 2023 07:21 next collapse

Hehe pp

garam@lemmy.my.id on 23 Sep 2023 04:39 collapse

pp = process pause = pkill -f SIGSTOP

I hate when Win10 idle/pause on KVM/QEMU still taking much CPU, and the only way to stop it using pp/pkill…

blog.benyamin.xyz/…/stop-windows-vm-cpu-usage-whi…

darcy@sh.itjust.works on 21 Sep 2023 12:38 collapse

what is vimx just wondering ?

CjkOvPDwQW@lemmy.pt on 22 Sep 2023 11:46 collapse

Seems to be just normal vim, maybe some distros packages the binary (of vim with more options enabled at compile time) as vimx so that it doesn’t conflict with another vim package (as an example vim-tiny). www.systutorials.com/docs/linux/man/1-vimx/

But only @aram@garam@lemmy.my.id, can answer that for us.

garam@lemmy.my.id on 23 Sep 2023 04:37 collapse

vimx support X/Wayland copy paste, using "+y or "+p

Like GVim, but on terminal… haha…

Klaymore@sh.itjust.works on 20 Sep 2023 23:30 next collapse

github.com/K1aymore/Nixos-Config/…/aliases.nix

Krafting@lemmy.world on 21 Sep 2023 06:36 next collapse

ussr

For connecting as root with a private key on my main server named Undine Sous Speed.

macallik@kbin.social on 21 Sep 2023 15:26 collapse

The best alliases are little inside jokes that are easy to remember imo

darcy@sh.itjust.works on 21 Sep 2023 12:40 next collapse

vim grindset 💪

alias q=exit
alias :q=exit
alias :wq=exit
PseudoSpock@lemmy.dbzer0.com on 22 Sep 2023 02:04 next collapse

alias .=exit

gamma@programming.dev on 23 Sep 2023 10:31 collapse

That would make my shell unusable, since some plugins use ./source.

PseudoSpock@lemmy.dbzer0.com on 24 Sep 2023 03:20 collapse

./ and . Are two different things to your shell

gamma@programming.dev on 24 Sep 2023 15:40 collapse

I know; I’m not talking about ./. I put the slash outside the inline codeblock in the parent comment.

My shell is setup with a chdir hook to [[ -r. /.autoenv.zsh ]] &amp;&amp; . ./.autoenv.zsh.

(Edit: Jerboa is bugged with “&” in codeblocks, that should be a “&&”, not &amp;&amp;)

PseudoSpock@lemmy.dbzer0.com on 25 Sep 2023 15:44 collapse

Ah, ok. For me it was an alias common in the university labs back on Ultrix. Became a habit way back then.

alper_celik@lemmy.world on 25 Sep 2023 09:55 collapse

I have :q to exit too since i was trying to exit shell with :q. I guess (n)vim users cant exit their shells :)

darcy@sh.itjust.works on 25 Sep 2023 10:10 collapse

we spent so much time learning to exit vim, we forgot how to exit shell 😔

mysticallego@lemmy.world on 21 Sep 2023 13:02 next collapse

My favorite one: alias upgrate=“sudo apt update && sudo apt upgrade”

macallik@kbin.social on 21 Sep 2023 15:27 collapse

ahhh a pormanteau lol, I like it

learnbyexample@programming.dev on 21 Sep 2023 13:23 next collapse

alias a='alias'

a c='clear'
a p='pwd'
a e='exit'
a q='exit'

a h='history | tail -n20'
# turn off history, use 'set -o history' to turn it on again
a so='set +o history'

a b1='cd ../'
a b2='cd ../../'
a b3='cd ../../../'
a b4='cd ../../../../'
a b5='cd ../../../../../'

a ls='ls --color=auto'
a l='ls -ltrhG'
a la='l -A'
a vi='gvim'
a grep='grep --color=auto'

# open and source aliases
a oa='vi ~/.bash_aliases'
a sa='source ~/.bash_aliases'

# sort file/directory sizes in current directory in human readable format
a s='du -sh -- * | sort -h'

# save last command from history to a file
# tip, add a comment to end of command before saving, ex: ls --color=auto # colored ls output
a sl='fc -ln -1 | sed "s/^\s*//" >> ~/.saved_commands.txt'
# short-cut to grep that file
a slg='&lt; ~/.saved_commands.txt grep'

# change ascii alphabets to unicode bold characters
a ascii2bold="perl -Mopen=locale -Mutf8 -pe 'tr/a-zA-Z/𝗮-𝘇𝗔-𝗭/'"

### functions
# 'command help' for command name and single option - ex: ch ls -A
# see https://github.com/learnbyexample/command_help for a better script version
ch() { whatis $1; man $1 | sed -n "/^\s*$2/,/^$/p" ; }

# add path to filename(s)
# usage: ap file1 file2 etc
ap() { for f in 
noughtnaut@feddit.dk on 22 Sep 2023 07:17 collapse

What do you use the ascii to bold function for?

learnbyexample@programming.dev on 22 Sep 2023 12:45 collapse

I used to use it for posting on Twitter, with some keywords (like book title) in bold.

backhdlp@lemmy.blahaj.zone on 21 Sep 2023 21:37 next collapse

Don’t really organize my aliases after making them, so this might be a mess.

##################
#   ~/.aliases   #
##################

# Colours
alias color-GREEN='tput setaf 2'
alias color-RED='tput setaf 1'
alias color-CYAN='tput setaf 78'
alias color-PURPLE='tput setaf 128'
#alias color-BLUE='tput setaf 4'
alias color-RESET='tput sgr0'
alias color-LIGHT_PURPLE='tput setaf 5'
alias color-LIGHT_BLUE='tput setaf 12'
alias color-TEXT='tput setaf 15'
alias color-HIDDEN='tput setaf 236'

# don't set a shutdown timer
alias shutdown='shutdown now'

# grep
alias grep='grep --color=auto'
alias pgrep='pgrep -l'

# package manager
alias pacman='sudo pacman --color=auto'
alias paru='paru --color=auto'

# ls
alias ls='eza -aMF --hyperlink --group-directories-first --icons --color=auto'
alias ll='eza -alhMF@ --hyperlink --group-directories-first --icons --color=auto --color-scale'
alias lg='eza -alhMF@ --hyperlink --group-directories-first --icons --git --git-repos --git-ignore --color=auto --color-scale'

# confirm before overwriting
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'

# update grub.cfg
alias grub-update='sudo grub-mkconfig -o /boot/grub/grub.cfg'

# update function
u() {
	# update distro specific packages
	if command -v pacman &amp;> /dev/null
	then
		# update pacman packages
		printf "\n[Update] Updating Standard Packages:\n\n"
		sudo pacman -Syu --color=auto
		# update aur packages
		if command -v paru &amp;> /dev/null
		then
			printf "\n[Uodate] Updating AUR Packages:\n\n"
			paru -Sau --color=auto
		fi
	elif command -v apt &amp;> /dev/null
 	then
		# update apt packages
		printf "\n[Update] Updating Standard Packages:\n\n"
		sudo apt-get update
		sudo apt-get upgrade
	fi
	# update flatpaks
	if command -v flatpak &amp;> /dev/null
	then
		printf "\n[Update] Updating flatpaks:\n\n"
		flatpak update
	fi
	# todo:
	# - update grub
	# - source shell config
	printf "\n[Update] Done\n"
}

# view metadata
alias meta='exiftool'
macallik@kbin.social on 21 Sep 2023 23:24 next collapse

Gonna steal/repurpose the shutdown one, use the "sudo docker" = "docker" one and also the grub one. Good lord @ all the configs you edit lol.

reddit_sux@iusearchlinux.fyi on 22 Sep 2023 06:55 collapse

I agree pms is a pain especially if it is delayed for more than a month.

ExLisper@linux.community on 21 Sep 2023 22:19 next collapse

So I’ve checked and…

alias la='ls -a'
alias mplayer='mplayer -noautosub -alang en'
alias ll='ls $LS_OPTIONS -lh'
alias l='ls $LS_OPTIONS -lAa'
alias x='startx'
alias ekgi='ekg -i'
alias glinks='links2 -g'

My god, this must be in my .bashrc since forever. I mean… links2? ekg? startx? It’s like archeology.

I will keep it there for future historians.

deo@beehaw.org on 22 Sep 2023 14:13 next collapse

I will keep it there for future historians.

great, now i have spit coffee all over the place. thanks for the laugh!

[deleted] on 23 Sep 2023 02:38 collapse

.

flying_wotsit@feddit.uk on 22 Sep 2023 11:11 next collapse

here we go, in no particular order:

claer=clear
gvim='nvim +Gclog +Git'
vim=nvim
vi=/usr/bin/vim
v=/usr/bin/vi
glog='git log --oneline --graph --all'
rcp='rsync -r --info=progress2 --partial'
d0='du -h --max-depth 0'
d1='du -h --max-depth 1'
ls='ls --time-style=long-iso --color=tty'
icat=chafa
ssh='TERM=xterm-256color ssh' # (kitty messes with TERM)
lenathaw@lemmy.ml on 22 Sep 2023 13:30 collapse

I’m stealing claer

Pssk@lemmy.ml on 22 Sep 2023 15:02 next collapse

control+l is much easier

flying_wotsit@feddit.uk on 22 Sep 2023 17:59 collapse

I can’t spell when typing fast :P

SGHFan@lemdro.id on 22 Sep 2023 11:25 next collapse

Call me weird, I don’t have any.

d00phy@lemmy.ml on 23 Sep 2023 01:46 collapse

Me either. I do a lot of initial setup for customer sites. Don’t want to get too used to customized shells or tmux.

milkjug@beehaw.org on 22 Sep 2023 12:00 next collapse

I’m a simple man. I do simple things. I replace df, ls and top with more modern alternatives. Courtesy of this list.

alias df="duf"
alias ls="eza --group-directories-first --long --group --sort=ext --icons --all"
alias top="btm"
[deleted] on 22 Sep 2023 12:38 next collapse

.

craigevil@lemmy.ml on 22 Sep 2023 13:05 next collapse

A bit long, but here goes:

Start gomuks Matrix Client

alias gomuks=/home/craig/.local/bin/gomuks-linux-arm64

walk: Terminal File Manager

github.com/antonmedv/walk

alias walk=“walk --icons"

Weather:github.com/chubin/wttr.in

alias weather=”/home/craig/.local/bin/weather.sh"

Onelinershell github.com/Onelinerhub/shellhub

alias oh="/home/craig/.local/bin/oh.sh"

Show open ports

alias ports='sudo netstat -tulanp’

Refresh .bashrc

alias bashrc="source ~/.bashrc"

become root

alias root=‘sudo -i’ alias su='sudo su’

Fix which

alias which='command -v’

APT User Commands

alias search=‘apt search’ alias file=‘apt-file search’ alias policy=‘apt policy’ alias show="nala show"

if user is not root, pass all commands via sudo

if [ $UID -ne 0 ]; then alias update=‘sudo apt update’ alias ainstall=‘sudo apt install’ alias apurge=‘sudo apt purge -y --autoremove’ alias upgrade=‘sudo nala upgrade’ alias aremove=‘sudo apt autoremove -y’ alias clean=‘sudo nala clean’ alias reboot=‘sudo reboot’ alias shutdown=“sudo shutdown -P now” fi

Handy-dandy aliases for journalctl and systemctl

alias jc=‘sudo journalctl -b’ alias jca=‘sudo journalctl’ alias jcf=‘sudo journalctl -f’ alias jcr=‘sudo journalctl --list-boots’ alias sc='sudo systemctl’

Making files immortal & executable

alias im+=“sudo chattr +i” alias im-=“sudo chattr -i” alias exe=“sudo chmod +x”

#Add safety nets

do not delete / or prompt if deleting more than 3 files at a time

alias rm='rm -I --preserve-root’

confirmation

alias mv=‘mv -i’ alias cp=‘cp -i’ alias ln='ln -i’

Parenting changing perms on /

alias chown=‘chown --preserve-root’ alias chmod=‘chmod --preserve-root’ alias chgrp='chgrp --preserve-root’

copy the current working directory to the clipboard

alias cpwd='pwd | xclip -selection clipboard’

Clipboard

alias cpy="xclip -selection clipboard"

quick directory movement

alias …=‘cd …’ alias …=‘cd …/…’ alias …='cd …/…/…'

go to the last directory you were in

alias back='cd $OLDPWD’

quickly find files and directory

alias ff=‘find . -type f -name’ alias fd='find . -type d -name’

Create Python virtual environment

alias ve=‘python3 -m venv ./venv’ alias va='source ./venv/bin/activate’

Ping Commands

Stop after sending count ECHO_REQUEST packets

alias ping=‘ping -c 5’ alias pg="ping google.com -c 5"

alias shortcuts

alias rpi=“sudo rpi-update” alias rpi-next=“sudo BRANCH=next rpi-update” alias raspi=“sudo raspi-config” alias clr=“clear” alias clrh=“history -c -w ~/.bash_history” alias df=‘df -H’ alias du=‘du -ch’ alias mk=“mkdir -p” alias loading="sudo dmesg > ~/dmesg.txt"

ls Commands

Colorize the ls output and human readable sizes

alias ls='ls --color=auto --human-readable -al’

Use a long listing format

alias ll='ls -la’

Show hidden files

alias l.='ls -d .* --color=auto’

Listing files in folder

alias listkb=“ls -l --block-size=K” alias listmb="ls -l --block-size=M"

Colorize the grep command output for ease of use (good for log files)##

alias grep=‘grep --color=auto’ alias egrep=‘egrep --color=auto’ alias fgrep='fgrep --color=auto’

Colorize diff output

alias diff='colordiff’

Start calculator with math support

alias bc="bc -l"

Resume wget by default

alias wget="wget -c"

ps Commands

alias ps="ps auxf"

Get top process eating cpu

alias pscpu=“ps auxf | sort -nr -k 3” alias pscpu10="ps auxf | sort -nr -k 3 | head -10"

Get top process eating memory

alias psmem=‘ps auxf | sort -nr -k 4’ alias psmem10='ps auxf | sort -nr -k 4 | head -10’

Free and Used Ram

alias meminfo=‘free -l’ alias free='free -mt’

Run top in alternate screen

alias top=‘tput smcup; top; tput rmcup’

aes@lemm.ee on 22 Sep 2023 13:50 collapse

i wanna see u try use a vanilla profile

megane_kun@lemm.ee on 23 Sep 2023 14:05 collapse

The struggle I sometimes face when I SSH into somewhere, lol! Fortunately, there’s a lot of differences that it’s easy realize that “this is a different machine”, and I just open a different terminal tab/window to look up the pure command versions if I need to.

turing_spider574@lemm.ee on 22 Sep 2023 14:32 next collapse

alias nano=‘nano -l’

my only one, to have line numbers when searching for errors in log files

Exec@pawb.social on 22 Sep 2023 17:06 collapse

Copying multiple lines will be more difficult. You can use Ctrl+C to display the current position, use page up/down for coarse navigation.

mojo@lemm.ee on 22 Sep 2023 17:30 next collapse

alias upgrade=“sudo dnf upgrade --yes &amp;&amp; flatpak update &amp;&amp; flatpak remove --unused”

Or something like that, also a dnf remove unused command in there. Writing this from my phone so might be written wrong.

gamma@programming.dev on 23 Sep 2023 10:48 next collapse

(NOTE: A lot of my more interesting “aliases” are actually short functions, but I’m keeping myself to alias.)

Some of mine that I haven’t seen yet:

# Simple python calculator
alias pycalc='python3 -ic "
from math import *\nimport cmath as C
try:
    import numpy as np
except:
    pass
i, j = 1j, 1j
"'

# Defaults
alias cp='cp --interactive --reflink=auto'
alias gcc='gcc -fdiagnostics-color=auto'
# Lemmy doesn't handle ampersands in codeblocks correctly
alias rg='rg --max-columns=$((COLUMNS > 60 &amp;&amp; ! ZSH_SUBSHELL ? COLUMNS - 30 : 0))'
alias rj='rg --json'
alias rm='rm -s'
alias rscp='rsync -azP --human-readable --info=flist0,progress2,stats1'
alias rust-c='rustc --out-dir build -O'

# Shorter forms
alias g=git
alias v=$VISUAL
alias py=python
alias jfeu='journalctl --user -xfeu'
alias sys='systemctl --user'
alias Jfeu='journalctl -xfeu'
alias Sys=systemctl

# Desktop stuff
alias trash='gio trash'
alias ud=udisksctl
alias y=wl-copy
alias Y='wl-copy -p'
alias p=wl-paste
alias P='wl-paste -p'

# Colorize with acolor/grc
alias GRC='grc -es'
alias LA='acol ls -lFAhb --color'
alias LS='acol ls -lFhb --color'
alias df='GRC df -hT'
alias dig='GRC dig'
alias docker='GRC docker'
alias docker-machine='GRC docker-machine'
alias env='acol env'
alias lsblk='acol lsblk'
alias lsmount='command mount | rg --color=never "^/" | acol -i -o mount'
alias lspci='acol lspci'
alias mount='acol mount'
alias nmap='acol nmap'
alias ping='GRC ping'
alias ps='GRC ps --columns $COLUMNS'
alias traceroute='GRC traceroute'
macallik@kbin.social on 25 Sep 2023 22:04 collapse

Some random ones I created over the last week or so:

alias clipboard='xclip -selection clipboard' # Allows me to pipe output directly to my keyboard. good for pwd for example.

Function allows me to get tldr and cheat responses to commands quickly
function cht() {
curl cheat.sh/$1
}

Easy calculator so that I can do math w/o launching a specific app
function calc() {
echo "scale=3; $@" | bc
}