There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

SHARE WITH THE CLASS: What aliases are you using?

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

gamma ,
@gamma@programming.dev avatar

(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:


<span style="color:#323232;"># Simple python calculator
</span><span style="color:#323232;">alias pycalc='python3 -ic "
</span><span style="color:#323232;">from math import *nimport cmath as C
</span><span style="color:#323232;">try:
</span><span style="color:#323232;">    import numpy as np
</span><span style="color:#323232;">except:
</span><span style="color:#323232;">    pass
</span><span style="color:#323232;">i, j = 1j, 1j
</span><span style="color:#323232;">"'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Defaults
</span><span style="color:#323232;">alias cp='cp --interactive --reflink=auto'
</span><span style="color:#323232;">alias gcc='gcc -fdiagnostics-color=auto'
</span><span style="color:#323232;"># Lemmy doesn't handle ampersands in codeblocks correctly
</span><span style="color:#323232;">alias rg='rg --max-columns=$((COLUMNS > 60 &amp;&amp; ! ZSH_SUBSHELL ? COLUMNS - 30 : 0))'
</span><span style="color:#323232;">alias rj='rg --json'
</span><span style="color:#323232;">alias rm='rm -s'
</span><span style="color:#323232;">alias rscp='rsync -azP --human-readable --info=flist0,progress2,stats1'
</span><span style="color:#323232;">alias rust-c='rustc --out-dir build -O'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Shorter forms
</span><span style="color:#323232;">alias g=git
</span><span style="color:#323232;">alias v=$VISUAL
</span><span style="color:#323232;">alias py=python
</span><span style="color:#323232;">alias jfeu='journalctl --user -xfeu'
</span><span style="color:#323232;">alias sys='systemctl --user'
</span><span style="color:#323232;">alias Jfeu='journalctl -xfeu'
</span><span style="color:#323232;">alias Sys=systemctl
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Desktop stuff
</span><span style="color:#323232;">alias trash='gio trash'
</span><span style="color:#323232;">alias ud=udisksctl
</span><span style="color:#323232;">alias y=wl-copy
</span><span style="color:#323232;">alias Y='wl-copy -p'
</span><span style="color:#323232;">alias p=wl-paste
</span><span style="color:#323232;">alias P='wl-paste -p'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Colorize with acolor/grc
</span><span style="color:#323232;">alias GRC='grc -es'
</span><span style="color:#323232;">alias LA='acol ls -lFAhb --color'
</span><span style="color:#323232;">alias LS='acol ls -lFhb --color'
</span><span style="color:#323232;">alias df='GRC df -hT'
</span><span style="color:#323232;">alias dig='GRC dig'
</span><span style="color:#323232;">alias docker='GRC docker'
</span><span style="color:#323232;">alias docker-machine='GRC docker-machine'
</span><span style="color:#323232;">alias env='acol env'
</span><span style="color:#323232;">alias lsblk='acol lsblk'
</span><span style="color:#323232;">alias lsmount='command mount | rg --color=never "^/" | acol -i -o mount'
</span><span style="color:#323232;">alias lspci='acol lspci'
</span><span style="color:#323232;">alias mount='acol mount'
</span><span style="color:#323232;">alias nmap='acol nmap'
</span><span style="color:#323232;">alias ping='GRC ping'
</span><span style="color:#323232;">alias ps='GRC ps --columns $COLUMNS'
</span><span style="color:#323232;">alias traceroute='GRC traceroute'
</span>
flying_wotsit ,

here we go, in no particular order:


<span style="color:#323232;">claer=clear
</span><span style="color:#323232;">gvim='nvim +Gclog +Git'
</span><span style="color:#323232;">vim=nvim
</span><span style="color:#323232;">vi=/usr/bin/vim
</span><span style="color:#323232;">v=/usr/bin/vi
</span><span style="color:#323232;">glog='git log --oneline --graph --all'
</span><span style="color:#323232;">rcp='rsync -r --info=progress2 --partial'
</span><span style="color:#323232;">d0='du -h --max-depth 0'
</span><span style="color:#323232;">d1='du -h --max-depth 1'
</span><span style="color:#323232;">ls='ls --time-style=long-iso --color=tty'
</span><span style="color:#323232;">icat=chafa
</span><span style="color:#323232;">ssh='TERM=xterm-256color ssh' # (kitty messes with TERM)
</span>
lenathaw ,

I’m stealing claer

Pssk ,
@Pssk@lemmy.ml avatar

control+l is much easier

flying_wotsit ,

I can’t spell when typing fast :P

Klaymore ,
@Klaymore@sh.itjust.works avatar
rutrum ,
@rutrum@lm.paradisus.day avatar

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


<span style="color:#323232;">alias clone='(pwd | urxvt &amp; disown $!)'
</span>

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.

SomeBoyo ,

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

macallik OP ,

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

SomeBoyo ,

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

ryannathans ,

Lofi girl audio?

macallik OP ,

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

clemdemort ,
@clemdemort@lemmy.world avatar

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 OP ,

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

megane_kun , (edited )

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.


<span style="color:#323232;"># # separator_line_with_text
</span><span style="color:#323232;"># # Centers text in a separator line
</span><span style="color:#323232;"># #
</span><span style="color:#323232;"># # Usage:
</span><span style="color:#323232;"># # separator_line_with_text «separator_char» «text»
</span><span style="color:#323232;">separator_line_with_text() {
</span><span style="color:#323232;">local separator_char="$1"
</span><span style="color:#323232;">local contents_str="$2"
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Calculate separator_length
</span><span style="color:#323232;">local separator_length=$(( $(tput cols) - 2 - ${#contents_str} ))
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Calculate the width of the left and right parts of the separator line
</span><span style="color:#323232;">local half_line_width=$(( (${separator_length}) / 2 ))
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Construct the separator line using the $separator_char and $contents_str
</span><span style="color:#323232;">for ((i = 0; i « half_line_width; i++))
</span><span style="color:#323232;">do
</span><span style="color:#323232;">echo -n ${separator_char}
</span><span style="color:#323232;">done
</span><span style="color:#323232;">
</span><span style="color:#323232;">echo -n ${contents_str}
</span><span style="color:#323232;">
</span><span style="color:#323232;">for ((i = 0; i &lt; half_line_width; i++))
</span><span style="color:#323232;">do
</span><span style="color:#323232;">echo -n ${separator_char}
</span><span style="color:#323232;">done
</span><span style="color:#323232;">
</span><span style="color:#323232;">echo ""
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;"># # read_latest_log
</span><span style="color:#323232;"># # Reads the latest log file with a timestamp in the filename.
</span><span style="color:#323232;"># #
</span><span style="color:#323232;"># # Usage:
</span><span style="color:#323232;"># # read_latest_log [[«name_filter»] «extension»] «separator» «timestamp_field_number»
</span><span style="color:#323232;">read_latest_log () {
</span><span style="color:#323232;">  # Check if the function has sufficient parameters
</span><span style="color:#323232;">  if [[ $# -lt 2 ]]; then
</span><span style="color:#323232;">    echo "Error: insufficient parameters."
</span><span style="color:#323232;">    echo "Usage: read_latest_log [[«name_filter» = *] [«extension» = log] «separator» «timestamp_field_number»"
</span><span style="color:#323232;">    return 1
</span><span style="color:#323232;">  fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">  # Supposing only two parameters are provided
</span><span style="color:#323232;">  # «name_filter» parameter is "*"
</span><span style="color:#323232;">  # «extension» parameter is "log"
</span><span style="color:#323232;">  if [[ $# -eq 2 ]]; then
</span><span style="color:#323232;">    local name_filter="*"
</span><span style="color:#323232;">    local extension="log"
</span><span style="color:#323232;">    local separator="$1"
</span><span style="color:#323232;">    local field="$2"
</span><span style="color:#323232;">  fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">  # Supposing only three parameters are provided,
</span><span style="color:#323232;">  # assume that the «name_filter» parameter is "*"
</span><span style="color:#323232;">  if [[ $# -eq 3 ]]; then
</span><span style="color:#323232;">    local name_filter="*"
</span><span style="color:#323232;">    local extension="$1"
</span><span style="color:#323232;">    local separator="$2"
</span><span style="color:#323232;">    local field="$3"
</span><span style="color:#323232;">  fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">  # If all parameters are provided, assign them accordingly
</span><span style="color:#323232;">  if [[ $# -eq 4 ]]; then
</span><span style="color:#323232;">    local name_filter="$1"
</span><span style="color:#323232;">    local extension="$2"
</span><span style="color:#323232;">    local separator="$3"
</span><span style="color:#323232;">    local field="$4"
</span><span style="color:#323232;">  fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">  # Find all log files with the specified extension, sort them based on the separator and field
</span><span style="color:#323232;">  local log_files=$(find . -type f -name "${name_filter}.${extension}" | sort -n -t "${separator}" -k "${field}")
</span><span style="color:#323232;">
</span><span style="color:#323232;">  # If no log files are found, display a message and return
</span><span style="color:#323232;">  if [[ -z "$log_files" ]]; then
</span><span style="color:#323232;">    echo "No log files found."
</span><span style="color:#323232;">    return 0
</span><span style="color:#323232;">  fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">  # Get the latest log file and its full path
</span><span style="color:#323232;">  local latest_log_file=$(echo "$log_files" | tail -1)
</span><span style="color:#323232;">  local full_path=$(realpath "$latest_log_file")
</span><span style="color:#323232;">
</span><span style="color:#323232;">  # Define the strings for the separator line and
</span><span style="color:#323232;">  # calculate the appropriate length of the separator line
</span><span style="color:#323232;">  local contents_str=" Contents "
</span><span style="color:#323232;">  local separator_char="—"
</span><span style="color:#323232;">
</span><span style="color:#323232;">  separator_line_with_text ${separator_char} ""
</span><span style="color:#323232;">  separator_line_with_text " " ${full_path}
</span><span style="color:#323232;">  separator_line_with_text ${separator_char} ${contents_str}
</span><span style="color:#323232;">  cat "$(echo "$log_files" | tail -1)"
</span><span style="color:#323232;">}
</span>

Sorry for all the edits, for some reason anything that looks like an HTML tag gets erased.

I_Am_Jacks_____ ,

For system updates:


<span style="color:#323232;">[ -r /etc/os-release ] &amp;&amp; . /etc/os-release
</span><span style="color:#323232;">case "$ID" in
</span><span style="color:#323232;">  arch|archarm)
</span><span style="color:#323232;">    if which paru > /dev/null 2>&amp;1; then
</span><span style="color:#323232;">      alias updates='echo Using paru; paru'
</span><span style="color:#323232;">    else
</span><span style="color:#323232;">      alias updates='echo Using pacman; sudo pacman -Syu --noconfirm'
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">    ;;
</span><span style="color:#323232;">  debian|ubuntu)
</span><span style="color:#323232;">    alias updates='echo Using apt dist-upgrade; sudo apt update &amp;&amp; sudo apt dist-upgrade -y'
</span><span style="color:#323232;">    ;;
</span><span style="color:#323232;">esac
</span>
ShittyBeatlesFCPres ,

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


<span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">function </span><span style="font-weight:bold;color:#795da3;">ins </span><span style="color:#323232;">{
</span><span style="color:#323232;">  PACKAGE</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">"${</span><span style="color:#323232;">1</span><span style="color:#183691;">}"
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#795da3;">exists</span><span style="color:#323232;">() {
</span><span style="color:#323232;">    </span><span style="color:#62a35c;">command </span><span style="color:#323232;">-v </span><span style="color:#183691;">"$</span><span style="color:#323232;">1</span><span style="color:#183691;">" </span><span style="font-weight:bold;color:#a71d5d;">></span><span style="color:#323232;">/dev/null </span><span style="color:#0086b3;">2</span><span style="font-weight:bold;color:#a71d5d;">>&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">;</span><span style="color:#323232;">1
</span><span style="color:#323232;">  }
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">exists dnf</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Fedora
</span><span style="color:#323232;">    sudo dnf update </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">; </span><span style="color:#323232;">sudo dnf install -y $PACKAGE
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists apt</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Debian
</span><span style="color:#323232;">    sudo apt update </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">; </span><span style="color:#323232;">sudo apt install -y $PACKAGE
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists apk</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Alpine
</span><span style="color:#323232;">    apk -U upgrade </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">; </span><span style="color:#323232;">apk add $PACKAGE
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists emerge</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Gentoo
</span><span style="color:#323232;">    sudo emerge $PACKAGE
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists zypper</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Suse
</span><span style="color:#323232;">    sudo zypper ref </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">; </span><span style="color:#323232;">sudo zypper install $PACKAGE
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists pacman</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Arch
</span><span style="color:#323232;">    pacman -S $PACKAGE
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists brew</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#MacOS
</span><span style="color:#323232;">    brew install $PACKAGE
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">else
</span><span style="color:#323232;">    </span><span style="color:#62a35c;">echo </span><span style="color:#183691;">"Error can't install package $</span><span style="color:#323232;">PACKAGE</span><span style="color:#183691;">. No package manager is detected."
</span><span style="color:#323232;">    </span><span style="color:#62a35c;">exit</span><span style="color:#323232;"> 1</span><span style="font-weight:bold;color:#a71d5d;">;
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">fi
</span><span style="color:#323232;">}
</span>
ShittyBeatlesFCPres ,

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


<span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">function </span><span style="font-weight:bold;color:#795da3;">upg </span><span style="color:#323232;">{
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#795da3;">exists</span><span style="color:#323232;">() {
</span><span style="color:#323232;">    </span><span style="color:#62a35c;">command </span><span style="color:#323232;">-v </span><span style="color:#183691;">"$</span><span style="color:#323232;">1</span><span style="color:#183691;">" </span><span style="font-weight:bold;color:#a71d5d;">></span><span style="color:#323232;">/dev/null </span><span style="color:#0086b3;">2</span><span style="font-weight:bold;color:#a71d5d;">>&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">;</span><span style="color:#323232;">1
</span><span style="color:#323232;">  }
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">exists dnf</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Fedora
</span><span style="color:#323232;">    sudo dnf update </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">; </span><span style="color:#323232;">sudo dnf -y upgrade </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">; </span><span style="color:#323232;">sudo dnf -y autoremove
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists apt</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Debian
</span><span style="color:#323232;">    sudo apt update </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">; </span><span style="color:#323232;">sudo apt full-upgrade -y
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists apk</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Alpine
</span><span style="color:#323232;">    apk -U upgrade
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists emerge</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Gentoo
</span><span style="color:#323232;">    sudo emerge --ask --verbose --update --deep --newuse @world </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">; </span><span style="color:#323232;">sudo emerge --ask --verbose --depclean
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists zypper</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Suse
</span><span style="color:#323232;">    sudo zypper ref </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">; </span><span style="color:#323232;">sudo zypper update
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists pacman</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Arch
</span><span style="color:#323232;">    pacman -Syu
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">elif </span><span style="color:#323232;">exists brew</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#MacOS
</span><span style="color:#323232;">    brew update </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp</span><span style="font-weight:bold;color:#a71d5d;">; </span><span style="color:#323232;">brew upgrade
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">else
</span><span style="color:#323232;">    </span><span style="color:#62a35c;">echo </span><span style="color:#183691;">"Error: cannot update packages. No package manager is detected."
</span><span style="color:#323232;">    </span><span style="color:#62a35c;">exit</span><span style="color:#323232;"> 1</span><span style="font-weight:bold;color:#a71d5d;">;
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">exists snap</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Snaps
</span><span style="color:#323232;">    sudo snap refresh
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">fi
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">exists flatpak</span><span style="font-weight:bold;color:#a71d5d;">; then </span><span style="font-style:italic;color:#969896;">#Flatpak
</span><span style="color:#323232;">    flatpak update -y
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">fi
</span><span style="color:#323232;">}
</span>
I_Am_Jacks_____ ,

Very nice

milkjug ,
@milkjug@beehaw.org avatar

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


<span style="color:#323232;">alias df="duf"
</span><span style="color:#323232;">alias ls="eza --group-directories-first --long --group --sort=ext --icons --all"
</span><span style="color:#323232;">alias top="btm"
</span>
TexasCrowbarMassacre ,

alias forgethist=unset HISTFILE

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

tho ,
@tho@lemmy.ml avatar

in zsh you can just forbid it to save duplicates

bennieandthez ,
@bennieandthez@lemmygrad.ml avatar

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’

Scio ,
@Scio@kbin.social avatar

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

macallik OP ,

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

chrishazfun ,
@chrishazfun@lemmy.world avatar

<span style="color:#323232;">alias getmp4="yt-dlp -f 'bestvideo+bestaudio[ext=m4a]/best[ext=mp4]' --recode-video mp4"
</span><span style="color:#323232;">alias getmp3="yt-dlp -x --audio-format mp3"
</span><span style="color:#323232;">alias downloadwebsite="wget -mkEpnp"
</span><span style="color:#323232;">
</span><span style="color:#323232;">flushall () {
</span><span style="color:#323232;">	sudo pacman -Scc
</span><span style="color:#323232;">	sudo pacman -Rns $(pacman -Qdtq)
</span><span style="color:#323232;">	flatpak uninstall --unused
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">updateall () {
</span><span style="color:#323232;">	yay
</span><span style="color:#323232;">	flatpak update
</span><span style="color:#323232;">	while
</span><span style="color:#323232;">		read -p "Clear cache and uninstall orphans? (y/N)" answer
</span><span style="color:#323232;">	do
</span><span style="color:#323232;">		case $answer in
</span><span style="color:#323232;">			([yY][eE][sS] | [yY]) flushall;;
</span><span style="color:#323232;">			(*) break;;
</span><span style="color:#323232;">		esac
</span><span style="color:#323232;">	done
</span><span style="color:#323232;">}
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines