This commit is contained in:
Marc Beninca 2024-11-17 22:27:38 +01:00
parent 1084edee23
commit 02a743fc1b
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
45 changed files with 0 additions and 0 deletions

83
sh/alias/apt.sh Normal file
View file

@ -0,0 +1,83 @@
# show package information
acl() {
apt-cache \
show \
"${@}"
}
# package versions policy
acp() {
apt-cache \
policy \
"${@}"
}
# search package
acs() {
apt-cache \
search \
"${@}"
}
#
agap() {
apt-get \
autopurge \
"${@}"
}
#
agar() {
apt-get \
autoremove \
"${@}"
}
# clean packages cache
agc() {
apt-get \
clean \
"${@}"
}
# upgrade allowing package installation or removal
agfu() {
apt-get \
full-upgrade \
"${@}"
}
# install packages
agi() {
apt-get \
install \
"${@}"
}
#
agp() {
apt-get \
purge \
"${@}"
}
#
agr() {
apt-get \
remove \
"${@}"
}
# update packages catalog
agud() {
apt-get \
update \
"${@}"
}
# upgrade forbidding package installation or removal
agug() {
apt-get \
upgrade \
"${@}"
}

4
sh/alias/batcat.sh Normal file
View file

@ -0,0 +1,4 @@
bat() {
batcat \
"${@}"
}

56
sh/alias/btrfs.sh Normal file
View file

@ -0,0 +1,56 @@
bfdf() {
btrfs \
filesystem \
df \
"${@}"
}
bfdu() {
btrfs \
filesystem \
du \
--summarize \
"${@}"
}
bfu() {
btrfs \
filesystem \
usage \
"${@}"
}
bpg() {
btrfs \
property \
get \
"${@}"
}
bsc() {
btrfs \
subvolume \
create \
"${@}"
}
bsd() {
btrfs \
subvolume \
delete \
"${@}"
}
bss() {
btrfs \
subvolume \
snapshot \
"${@}"
}
bssr() {
btrfs \
subvolume \
snapshot -r \
"${@}"
}

23
sh/alias/byobu.sh Normal file
View file

@ -0,0 +1,23 @@
bb() {
byobu \
"${@}"
}
bba() {
byobu \
attach-session \
"${@}"
}
bbl() {
byobu \
ls \
"${@}"
}
bbnd() {
byobu \
new-session \
-d \
"${@}"
}

13
sh/alias/chmod.sh Normal file
View file

@ -0,0 +1,13 @@
# change mode to directory
cmd() {
chmod \
"755" \
"${@}"
}
# change mode to file
cmf() {
chmod \
"644" \
"${@}"
}

13
sh/alias/chown.sh Normal file
View file

@ -0,0 +1,13 @@
# change owner to root
cor() {
chown \
"0:0" \
"${@}"
}
# change owner to user
cou() {
chown \
"1000:1000" \
"${@}"
}

5
sh/alias/clear.sh Normal file
View file

@ -0,0 +1,5 @@
# clear terminal
c() {
clear \
"${@}"
}

6
sh/alias/cp.sh Normal file
View file

@ -0,0 +1,6 @@
# copy interactively
cpi() {
cp \
--interactive \
"${@}"
}

4
sh/alias/emacs.sh Normal file
View file

@ -0,0 +1,4 @@
em() {
emacs \
"${@}"
}

4
sh/alias/evince.sh Normal file
View file

@ -0,0 +1,4 @@
ev() {
evince \
"${@}"
}

8
sh/alias/grep.sh Normal file
View file

@ -0,0 +1,8 @@
# grep from current directory with regex
g() {
grep \
--directories "recurse" \
--line-number \
--regexp \
"${@}"
}

12
sh/alias/kill.sh Normal file
View file

@ -0,0 +1,12 @@
# kill a process by id
k() {
kill \
"${@}"
}
# force kill a process by id
kf() {
kill \
-9 \
"${@}"
}

12
sh/alias/killall.sh Normal file
View file

@ -0,0 +1,12 @@
# kill all instances of a process by name
ka() {
killall \
"${@}"
}
# force kill all instances of a process by name
kaf() {
killall \
-9 \
"${@}"
}

29
sh/alias/ls.sh Normal file
View file

@ -0,0 +1,29 @@
export LS_COLORS="\
di=0;94\
"
# list current directory’s entries
l() {
ls \
--all \
--color \
-l \
-p \
--time-style "+" \
"${@}"
}
# list timestamps
lt() {
l \
--time-style "+%Y%m%d-%H%M%S%-:::z" \
"${@}"
}
# list timestamps recent last
ltt() {
lt \
--reverse \
-t \
"${@}"
}

27
sh/alias/lsblk.sh Normal file
View file

@ -0,0 +1,27 @@
# list block devices
lb() {
lbo \
"SIZE" \
"TYPE" \
"FSTYPE" \
"LABEL" \
"MOUNTPOINTS"
}
# base arguments
lbb() {
lsblk \
--noempty \
"${@}"
}
# output arguments
lbo() {
local argument
local arguments="NAME"
for argument in "${@}"; do
arguments="${arguments},${argument}"
done
lbb \
--output "${arguments}"
}

12
sh/alias/mkdir.sh Normal file
View file

@ -0,0 +1,12 @@
# make a directory
md() {
mkdir \
"${@}"
}
# make a directory after making its parents
mdp() {
mkdir \
--parents \
"${@}"
}

11
sh/alias/mount.sh Normal file
View file

@ -0,0 +1,11 @@
m() {
mount \
"${@}"
}
# remount read-only medium in read-write
remount() {
mount \
-o "remount,rw" \
"/usr/lib/live/mount/medium"
}

6
sh/alias/mv.sh Normal file
View file

@ -0,0 +1,6 @@
# move interactively
mvi() {
mv \
--interactive \
"${@}"
}

4
sh/alias/nano.sh Normal file
View file

@ -0,0 +1,4 @@
nn() {
nano \
"${@}"
}

5
sh/alias/newsboat.sh Normal file
View file

@ -0,0 +1,5 @@
nb() { news_boat "${@}"; }
news_boat() {
newsboat \
"${@}"
}

12
sh/alias/pass.sh Normal file
View file

@ -0,0 +1,12 @@
# display pass entry’s content
p() {
pass \
"${@}"
}
# copy passphrase into clipboard
pc() {
pass \
--clip \
"${@}"
}

7
sh/alias/ps.sh Normal file
View file

@ -0,0 +1,7 @@
# look for a string in processes names
pg() {
ps \
-A |
grep \
"${@}"
}

15
sh/alias/pwgen.sh Normal file
View file

@ -0,0 +1,15 @@
# generate passwords
pwg() {
pwgen \
-1 \
--num-passwords 1048576 \
--secure \
"${@}"
}
# generate passwords with symbols
pwgs() {
pwg \
--symbols \
"${@}"
}

6
sh/alias/rm.sh Normal file
View file

@ -0,0 +1,6 @@
# remove interactively
rmi() {
rm \
--interactive \
"${@}"
}

31
sh/alias/rsync.sh Normal file
View file

@ -0,0 +1,31 @@
# synchronize
rs() {
rsb \
"${@}"
}
# base arguments
rsb() {
rsync \
--archive \
--no-inc-recursive \
--partial \
--progress \
--verbose \
"${@}"
}
# synchronize and delete after
rsda() {
rsb \
--delete-after \
"${@}"
}
# synchronize and delete before
rsdb() { r_sync_delete_before "${@}"; }
r_sync_delete_before() {
rsb \
--delete-before \
"${@}"
}

27
sh/alias/tar.sh Normal file
View file

@ -0,0 +1,27 @@
tc() {
tv \
--create \
--auto-compress \
--file \
"${@}"
}
tl() {
tv \
--list \
--file \
"${@}"
}
tv() {
tar \
--verbose \
"${@}"
}
tx() {
tv \
--extract \
--file \
"${@}"
}

4
sh/alias/tmux.sh Normal file
View file

@ -0,0 +1,4 @@
tm() {
tmux \
"${@}"
}

10
sh/alias/tree.sh Normal file
View file

@ -0,0 +1,10 @@
t() {
tree \
"${@}"
}
ta() {
tree \
-a \
"${@}"
}