140
submitted 1 year ago* (last edited 1 year ago) by macallik@kbin.social to c/linux@lemmy.ml

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

you are viewing a single comment's thread
view the rest of the comments
[-] megane_kun@lemm.ee 15 points 1 year ago* (last edited 1 year ago)

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 7 points 1 year ago

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

[-] megane_kun@lemm.ee 4 points 1 year ago* (last edited 1 year ago)

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 2 points 1 year ago* (last edited 1 year ago)

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 1 points 1 year ago

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.

this post was submitted on 20 Sep 2023
140 points (97.9% liked)

Linux

47996 readers
1050 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS