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

FluffyPotato,

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

RaivoKulli,

Metal

redxef,

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,

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,

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,

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,

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

Big if true

backhdlp,
@backhdlp@lemmy.blahaj.zone avatar

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


<span style="color:#323232;">##################
</span><span style="color:#323232;">#   ~/.aliases   #
</span><span style="color:#323232;">##################
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Colours
</span><span style="color:#323232;">alias color-GREEN='tput setaf 2'
</span><span style="color:#323232;">alias color-RED='tput setaf 1'
</span><span style="color:#323232;">alias color-CYAN='tput setaf 78'
</span><span style="color:#323232;">alias color-PURPLE='tput setaf 128'
</span><span style="color:#323232;">#alias color-BLUE='tput setaf 4'
</span><span style="color:#323232;">alias color-RESET='tput sgr0'
</span><span style="color:#323232;">alias color-LIGHT_PURPLE='tput setaf 5'
</span><span style="color:#323232;">alias color-LIGHT_BLUE='tput setaf 12'
</span><span style="color:#323232;">alias color-TEXT='tput setaf 15'
</span><span style="color:#323232;">alias color-HIDDEN='tput setaf 236'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># don't set a shutdown timer
</span><span style="color:#323232;">alias shutdown='shutdown now'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># grep
</span><span style="color:#323232;">alias grep='grep --color=auto'
</span><span style="color:#323232;">alias pgrep='pgrep -l'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># package manager
</span><span style="color:#323232;">alias pacman='sudo pacman --color=auto'
</span><span style="color:#323232;">alias paru='paru --color=auto'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># ls
</span><span style="color:#323232;">alias ls='eza -aMF --hyperlink --group-directories-first --icons --color=auto'
</span><span style="color:#323232;">alias ll='eza -alhMF@ --hyperlink --group-directories-first --icons --color=auto --color-scale'
</span><span style="color:#323232;">alias lg='eza -alhMF@ --hyperlink --group-directories-first --icons --git --git-repos --git-ignore --color=auto --color-scale'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># confirm before overwriting
</span><span style="color:#323232;">alias cp='cp -i'
</span><span style="color:#323232;">alias mv='mv -i'
</span><span style="color:#323232;">alias rm='rm -i'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># update grub.cfg
</span><span style="color:#323232;">alias grub-update='sudo grub-mkconfig -o /boot/grub/grub.cfg'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># update function
</span><span style="color:#323232;">u() {
</span><span style="color:#323232;">	# update distro specific packages
</span><span style="color:#323232;">	if command -v pacman &amp;> /dev/null
</span><span style="color:#323232;">	then
</span><span style="color:#323232;">		# update pacman packages
</span><span style="color:#323232;">		printf "n[Update] Updating Standard Packages:nn"
</span><span style="color:#323232;">		sudo pacman -Syu --color=auto
</span><span style="color:#323232;">		# update aur packages
</span><span style="color:#323232;">		if command -v paru &amp;> /dev/null
</span><span style="color:#323232;">		then
</span><span style="color:#323232;">			printf "n[Uodate] Updating AUR Packages:nn"
</span><span style="color:#323232;">			paru -Sau --color=auto
</span><span style="color:#323232;">		fi
</span><span style="color:#323232;">	elif command -v apt &amp;> /dev/null
</span><span style="color:#323232;"> 	then
</span><span style="color:#323232;">		# update apt packages
</span><span style="color:#323232;">		printf "n[Update] Updating Standard Packages:nn"
</span><span style="color:#323232;">		sudo apt-get update
</span><span style="color:#323232;">		sudo apt-get upgrade
</span><span style="color:#323232;">	fi
</span><span style="color:#323232;">	# update flatpaks
</span><span style="color:#323232;">	if command -v flatpak &amp;> /dev/null
</span><span style="color:#323232;">	then
</span><span style="color:#323232;">		printf "n[Update] Updating flatpaks:nn"
</span><span style="color:#323232;">		flatpak update
</span><span style="color:#323232;">	fi
</span><span style="color:#323232;">	# todo:
</span><span style="color:#323232;">	# - update grub
</span><span style="color:#323232;">	# - source shell config
</span><span style="color:#323232;">	printf "n[Update] Donen"
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;"># view metadata
</span><span style="color:#323232;">alias meta='exiftool'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># makepkg dependencies and install
</span><span style="color:#323232;">alias makepkg='makepkg -si'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># git
</span><span style="color:#323232;">alias gc='git clone'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># quick probe
</span><span style="color:#323232;">alias probe='sudo -E hw-probe -all -upload -show -verbose'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># shorten pacman commands
</span><span style="color:#323232;">alias pm='pacman'
</span><span style="color:#323232;">alias pms='pm -Syu'
</span><span style="color:#323232;">alias pmr='pm -Rns'
</span><span style="color:#323232;">alias pmq='pm -Q'
</span><span style="color:#323232;">alias pmu='pm -U'
</span><span style="color:#323232;">alias pmd='sudo downgrade'
</span><span style="color:#323232;">alias pmc='sudo paccache'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># rm pacman lock
</span><span style="color:#323232;">alias rmpml='sudo rm /var/lib/pacman/db.lck'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># quick access to configs
</span><span style="color:#323232;">alias brc='$EDITOR ~/.bashrc'
</span><span style="color:#323232;">alias bash='exec bash'
</span><span style="color:#323232;">alias zrc='$EDITOR ~/.zshrc'
</span><span style="color:#323232;">alias zsh='exec zsh'
</span><span style="color:#323232;">alias alia='$EDITOR ~/.aliases'
</span><span style="color:#323232;">alias expo='$EDITOR ~/.exports'
</span><span style="color:#323232;">alias swayc='$EDITOR ~/.config/sway/config'
</span><span style="color:#323232;">#alias alac-conf='$EDITOR ~/.config/alacritty/alacritty.yml'
</span><span style="color:#323232;">alias starc='$EDITOR ~/.config/starship.toml'
</span><span style="color:#323232;">alias kittc='$EDITOR ~/.config/kitty/kitty.conf'
</span><span style="color:#323232;">alias nvimc='$EDITOR ~/.config/nvim/init.vim'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># alias fetch scripts with hyfetch during pride month
</span><span style="color:#323232;">[[ $(date +'%b') == "Jun" ]] &amp;&amp; alias neofetch='hyfetch -b neofetch'
</span><span style="color:#323232;">[[ $(date +'%b') == "Jun" ]] &amp;&amp; alias fastfetch='hyfetch -b fastfetch'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># use fastfetch backend for hyfetch
</span><span style="color:#323232;">alias hyfetch='hyfetch -b fastfetch'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># add sudo
</span><span style="color:#323232;">alias docker='sudo docker'
</span><span style="color:#323232;">alias systemctl='sudo systemctl'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># systemd
</span><span style="color:#323232;">alias sc='systemctl'
</span><span style="color:#323232;">alias sce='sc enable'
</span><span style="color:#323232;">alias scd='sc disable'
</span><span style="color:#323232;">alias scs='sc start'
</span><span style="color:#323232;">alias scu='sc stop' # the u comes from unset
</span><span style="color:#323232;">alias scr='sc restart'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># yt-dlp
</span><span style="color:#323232;">alias ytm='yt-dlp -x -o "~/Music/%(title)s.%(ext)s" --add-metadata --embed-thumbnail --audio-quality 0'
</span><span style="color:#323232;">alias ytv='yt-dlp -o "~/Videos/%(title)s.%(ext)s" --add-metadata --embed-thumbnail --embed-subs --embed-chapters'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># edit quicker
</span><span style="color:#323232;">alias e='$EDITOR'
</span><span style="color:#323232;">alias se='sudoedit'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># ryujinx (created by pinejinx)
</span><span style="color:#323232;">alias ryu="AMD_DEBUG=w32ge,w32cs,nohyperz,nofmask glsl_zero_init=true radeonsi_clamp_div_by_zero=true force_integer_tex_nearest=true mesa_glthread=false vblank_mode=0 RADV_PERFTEST=bolist gamemoderun DOTNET_EnableAlternateStackCheck=1 GDK_BACKEND=x11 /home/luna/.local/share/Ryujinx/Ryujinx"
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Vencord
</span><span style="color:#323232;">alias inven="sudo VencordInstallerCli-linux -install &amp;&amp; sudo VencordInstallerCli-linux -install-openasar"
</span><span style="color:#323232;">alias unven="sudo VencordInstallerCli-linux -uninstall &amp;&amp; sudo VencordInstallerCli-linux -uninstall-openasar"
</span><span style="color:#323232;">
</span><span style="color:#323232;"># bun > npm
</span><span style="color:#323232;">alias npm='bun'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># replace cat
</span><span style="color:#323232;">alias cat='bat'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># sudo
</span><span style="color:#323232;">alias s='sudo'
</span>
reddit_sux,

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

macallik,

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.

mysticallego,

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

macallik,

ahhh a pormanteau lol, I like it

Krafting,
@Krafting@lemmy.world avatar

ussr

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

macallik,

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

bobman,

Literally none, lol.

SomeBoyo,

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

macallik,

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,

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

conkbin, (edited )

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,

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,

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

macallik,

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,

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,

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,

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.

Klaymore,
@Klaymore@sh.itjust.works avatar
thurstylark,

Here ya go

Discussion and suggestions welcome :)

macallik,

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

Limitless_screaming,
Limitless_screaming avatar

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,

I just use ^L instead of clear.

macallik,

same

OpticalMoose,
@OpticalMoose@discuss.tchncs.de avatar

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

Because I’m to lazy to type

history | grep whatever_I’m_looking_for

Pantherina,

<span style="color:#323232;">alias rpmfind='rpm -qa | grep'
</span>
OpticalMoose,
@OpticalMoose@discuss.tchncs.de avatar

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.

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,

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

Pantherina, (edited )

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

github.com/trytomakeyouprivate/flatalias

Also


<span style="color:#323232;">set fish_greeting
</span><span style="color:#323232;">
</span><span style="color:#323232;">alias update='flatpak update -y &amp;&amp; notify-send -a Updater "Flatpaks ready" &amp;&amp; rpm-ostree update &amp;&amp; notify-send -a Updater "rpm-ostree ready"'
</span><span style="color:#323232;">
</span><span style="color:#323232;">alias upfin='flatpak update -y &amp;&amp; rpm-ostree update &amp;&amp; shutdown -h now''
</span><span style="color:#323232;">
</span><span style="color:#323232;">alias flatrm='flatpak remove --delete-data'
</span><span style="color:#323232;">
</span><span style="color:#323232;">alias ls="ls --color=auto -GF"
</span><span style="color:#323232;">
</span><span style="color:#323232;">alias reload="source ~/.config/fish/config.fish &amp;&amp; echo 'Fish-config updated'"
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr conf "kate ~/.config/fish/config.fish &amp;&amp; source ~/.config/fish/config.fish &amp;&amp; echo 'Fish-config updated'"
</span><span style="color:#323232;">
</span><span style="color:#323232;">### NETWORKING
</span><span style="color:#323232;">abbr myip 'curl ifconfig.co'
</span><span style="color:#323232;">abbr netlisten 'netstat -plntu'
</span><span style="color:#323232;">abbr pingtest 'ping -c 2 wikipedia.de'
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr rpmq "distrobox enter -n fedora -- dnf search"
</span><span style="color:#323232;">abbr rstat "rpm-ostree status"
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr rpmfind "rpm -qa | grep"
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr flatinst 'flatpak install -y'
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr flatfind "flatpak list | grep"
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr history-off 'set +o history'
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr sshcloud "ssh -i /home/user/.local/share/Cryptomator/mnt/SSH-keys/KEYNAME -p PORTNUMBER root@IP
</span><span style="color:#323232;"># and others
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr httpcode "curl --head --silent --output /dev/null --write-out '%{http_code}' "
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr "pin-this" "ostree admin pin 0"
</span><span style="color:#323232;">abbr "q" "exit"
</span><span style="color:#323232;">abbr c "clear"
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr errors-boot "journalctl -b"
</span><span style="color:#323232;">abbr errors-last-boot "journalctl -b -1"
</span><span style="color:#323232;">
</span><span style="color:#323232;">function copy
</span><span style="color:#323232;">    if test -f $argv[1]
</span><span style="color:#323232;">        cat $argv[1] | wl-copy
</span><span style="color:#323232;">        echo "Copied to clipboard."
</span><span style="color:#323232;">    else
</span><span style="color:#323232;">        echo "Error: '$argv[1]' is not a file!"
</span><span style="color:#323232;">    end
</span><span style="color:#323232;">end
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr off "shutdown -h now"
</span><span style="color:#323232;">
</span><span style="color:#323232;">function findmod
</span><span style="color:#323232;">    set mod_path (whereis $argv[1] | cut -d' ' -f2)
</span><span style="color:#323232;">    kate $mod_path;
</span><span style="color:#323232;">end
</span><span style="color:#323232;">
</span><span style="color:#323232;">function mdtopdf -a filename
</span><span style="color:#323232;">  set -x name (basename $filename .md)
</span><span style="color:#323232;">  pandoc $filename -o $name.pdf | tee $name.pdf
</span><span style="color:#323232;">end
</span><span style="color:#323232;">
</span><span style="color:#323232;">function mdtoodt -a filename
</span><span style="color:#323232;">  set -x name (basename $filename .md)
</span><span style="color:#323232;">  pandoc $filename -o $name.odt | tee $name.odt
</span><span style="color:#323232;">end
</span><span style="color:#323232;">
</span><span style="color:#323232;">function mdtotex -a filename
</span><span style="color:#323232;">  set -x name (basename $filename .md)
</span><span style="color:#323232;">  pandoc $filename -s -o $name.tex | tee $name.tex
</span><span style="color:#323232;">end
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr rootfish "sudo -i fish"
</span><span style="color:#323232;">
</span><span style="color:#323232;">abbr eng "export LANG=en_US.UTF-8"
</span><span style="color:#323232;">abbr english "export LANG=en_US.UTF-8"
</span><span style="color:#323232;">alias conf='nano ~/.config/fish/config.fish'
</span><span style="color:#323232;">alias reload='. ~/.config/fish/config.fish'
</span><span style="color:#323232;">
</span><span style="color:#323232;">alias pipwire-restart="systemctl --user restart pipewire.service"
</span><span style="color:#323232;">
</span><span style="color:#323232;">function tarbrot #not yet fully working I think
</span><span style="color:#323232;">    if test -z $argv[1]
</span><span style="color:#323232;">        echo "Usage: tarbrot "
</span><span style="color:#323232;">        return 1
</span><span style="color:#323232;">    end
</span><span style="color:#323232;">
</span><span style="color:#323232;">    set folder $argv[1]
</span><span style="color:#323232;">    set tarball (basename $folder).tar
</span><span style="color:#323232;">    set brotli_file $tarball.br
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Start the timer
</span><span style="color:#323232;">    set start_time (date +%s)
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Create a tarball without compression
</span><span style="color:#323232;">    tar -cf $tarball $folder
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Display the time elapsed
</span><span style="color:#323232;">    set end_time (date +%s)
</span><span style="color:#323232;">    set elapsed_time (math $end_time - $start_time)
</span><span style="color:#323232;">
</span><span style="color:#323232;">    # Compress the tarball with Brotli
</span><span style="color:#323232;">    brotli $tarball &amp;&amp; rm -f "$tarball"
</span><span style="color:#323232;">
</span><span style="color:#323232;">    echo "Folder '$folder' has been tarred and Brotli compressed as '$brotli_file'"
</span><span style="color:#323232;">    echo "Time elapsed: $elapsed_time seconds"
</span><span style="color:#323232;">    echo "Size of compressed file: (du -h $brotli_file | awk '{print $1}')"
</span><span style="color:#323232;">end
</span>

I use fish btw, nice shell.

GustavoM,
@GustavoM@lemmy.world avatar

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,

Finger. Exercise.

Staraven1,

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

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.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • GTA5RPClips
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • ngwrru68w68
  • Youngstown
  • everett
  • slotface
  • rosin
  • ethstaker
  • Durango
  • kavyap
  • cubers
  • provamag3
  • modclub
  • mdbf
  • khanakhh
  • vwfavf
  • osvaldo12
  • cisconetworking
  • tester
  • Leos
  • tacticalgear
  • anitta
  • normalnudes
  • megavids
  • JUstTest
  • All magazines