wip/shell

This commit is contained in:
Marc Beninca 2024-11-15 16:27:41 +01:00
parent 672b385447
commit f52abc28b3
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
50 changed files with 0 additions and 0 deletions

71
shell/alias/apt.sh Normal file
View file

@ -0,0 +1,71 @@
# show package information
alias ac="\
apt-cache \
show \
"
# package versions policy
alias acp="\
apt-cache \
policy \
"
# search package
alias acs="\
apt-cache \
search \
"
#
alias agap="\
apt-get \
autopurge \
"
#
alias agar="\
apt-get \
autoremove \
"
# clean packages cache
alias agc="\
apt-get \
clean \
"
# upgrade allowing package installation or removal
alias agdu="\
apt-get \
dist-upgrade \
"
# install packages
alias agi="\
apt-get \
install \
"
#
alias agp="\
apt-get \
purge \
"
#
alias agr="\
apt-get \
remove \
"
# update packages catalog
alias agud="\
apt-get \
update \
"
# upgrade forbidding package installation or removal
alias agug="\
apt-get \
upgrade \
"

32
shell/alias/bash.sh Normal file
View file

@ -0,0 +1,32 @@
# change current directory to its parent
alias ..="\
cd \
.. \
"
# change current directory to its parent’s parent
alias ...="\
cd \
../.. \
"
# shorten alias
alias a="\
alias \
"
# swap directory (current ↔ previous)
alias sd="\
cd \
- \
"
# import source file
alias src="\
source \
"
# exit terminal
alias x="\
exit \
"

3
shell/alias/batcat.sh Normal file
View file

@ -0,0 +1,3 @@
alias bat="\
batcat \
"

48
shell/alias/btrfs.sh Normal file
View file

@ -0,0 +1,48 @@
alias bfdf="\
btrfs \
filesystem \
df \
"
alias bfdu="\
btrfs \
filesystem \
du \
--summarize \
"
alias bfu="\
btrfs \
filesystem \
usage \
"
alias bpg="\
btrfs \
property \
get \
"
alias bsc="\
btrfs \
subvolume \
create \
"
alias bsd="\
btrfs \
subvolume \
delete \
"
alias bss="\
btrfs \
subvolume \
snapshot \
"
alias bssr="\
btrfs \
subvolume \
snapshot -r \
"

19
shell/alias/byobu.sh Normal file
View file

@ -0,0 +1,19 @@
alias bb="\
byobu \
"
alias bba="\
byobu \
attach-session \
"
alias bbl="\
byobu \
ls \
"
alias bbn="\
byobu \
new-session \
-d \
"

11
shell/alias/chmod.sh Normal file
View file

@ -0,0 +1,11 @@
# change mode as directory
alias cmd="\
chmod \
\"755\" \
"
# change mode as file
alias cmf="\
chmod \
\"644\" \
"

11
shell/alias/chown.sh Normal file
View file

@ -0,0 +1,11 @@
# change owner as root
alias cor="\
chown \
\"0:0\" \
"
# change owner as user
alias cou="\
chown \
\"1000:1000\" \
"

4
shell/alias/clear.sh Normal file
View file

@ -0,0 +1,4 @@
# clear terminal
alias c="\
clear \
"

5
shell/alias/cp.sh Normal file
View file

@ -0,0 +1,5 @@
# copy interactively
alias cpi="\
cp \
--interactive \
"

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

@ -0,0 +1,4 @@
# short
alias em="\
emacs \
"

3
shell/alias/evince.sh Normal file
View file

@ -0,0 +1,3 @@
alias ev="\
evince \
"

441
shell/alias/git.sh Normal file
View file

@ -0,0 +1,441 @@
# add to index
alias ga="\
git \
add \
"
# add all to index
alias gaa="\
git \
add \
--all \
"
# add parts to index
alias gap="\
git \
add \
--patch \
"
# create a branch
alias gb="\
git \
branch \
"
# delete a branch
alias gbd="\
git \
branch \
--delete \
"
# force a branch deletion
alias gbdf="\
git \
branch \
--delete \
--force \
"
# list branches
alias gbl="\
git \
branch \
--all \
--list \
--verbose \
--verbose \
"
# set the link to a remote branch from a local branch
alias gbsu="\
git \
branch \
--set-upstream-to \
"
# clone a remote repository
alias gc="\
git \
clone \
"
# clean untracked files
alias gcf="\
git \
clean \
-d \
--force \
"
# commit the index
alias gcm="\
git \
commit \
--message \
"
# redo the last commit with a different message
alias gcma="\
git \
commit \
--amend \
--message \
"
# make a root commit
alias gcme="\
git \
commit \
--allow-empty \
--allow-empty-message \
--message \"\" \
"
# commit the index and sign
alias gcms="\
git \
commit \
--gpg-sign \
--message \
"
# switch to a branch or checkout file(s) from a commit
alias gco="\
git \
checkout \
"
# checkout an orphan branch
alias gcoo="\
git \
checkout \
--orphan \
"
# pick a commit
alias gcp="\
git \
cherry-pick \
"
# abort the commit pick
alias gcpa="\
git \
cherry-pick \
--abort \
"
# continue the commit pick
alias gcpc="\
git \
cherry-pick \
--continue \
"
# configure the user name
alias gcun="\
git \
config \
user.name \
"
# configure the user email
alias gcue="\
git \
config \
user.email \
"
# differences from last or between commits
alias gd="\
git \
diff \
"
# display what is indexed in cache
alias gdc="\
git \
diff \
--cached \
"
# indexed character-level differences
alias gdcw="\
git \
diff \
--cached \
--word-diff-regex=. \
"
# differences via external tool
alias gdt="\
git \
difftool \
--dir-diff \
"
# character-level differences
alias gdw="\
git \
diff \
--word-diff-regex=. \
"
# fetch from the remote repository
alias gf="\
git \
fetch \
--verbose \
--tags \
"
# fetch from remote repository and prune local orphan branches
alias gfp="\
git \
fetch \
--verbose \
--tags \
--prune \
"
# garbage collect all orphan commits
alias ggc="\
git \
reflog \
expire \
--all \
--expire \"all\" \
; \
git \
gc \
--aggressive \
--prune=\"now\" \
"
# initialize a new repository
alias gi="\
git \
init \
"
# initialize a new bare repository
alias gib="\
git \
init \
--bare \
"
# log commits history
alias gl="\
git \
log \
--all \
--graph \
--format=\"%C(auto)%h%d %C(red)%ai%C(auto) %an%n%B\" \
"
# log medium information
alias glm="\
git \
log \
--all \
--decorate \
--graph \
--pretty=medium \
"
# log commits history with patches
alias glp="\
git \
log \
--all \
--graph \
--format=\"%C(auto)%h%d %C(red)%ai%C(auto) %an%n%B\" \
--patch \
"
# abort the current merge commit
alias gma="\
git \
merge \
--abort \
"
# do a merge commit
alias gmc="\
git \
merge \
--no-ff \
--message \
"
# do a signed merge commit
alias gmcs="\
git \
merge \
--no-ff \
--gpg-sign \
-m \
"
# fast-forward to remote branch
alias gmf="\
git \
merge \
--ff-only \
"
# squash a branch and index its modifications
alias gms="\
git \
merge \
--squash \
"
# merge via external tool
alias gmt="\
git \
mergetool \
"
# push to the remote repository
alias gp="\
git \
push \
--verbose \
--tags \
"
# delete from the remote repository
alias gpd="\
git \
push \
--verbose \
--delete \
"
# force the push to the remote repository
alias gpf="\
git \
push \
--verbose \
--tags \
--force \
"
# rebase current branch onto another
alias grb="\
git \
rebase \
"
# abort current rebase
alias grba="\
git \
rebase \
--abort \
"
# continue current rebase
alias grbc="\
git \
rebase \
--continue \
"
# force rebase without fast-forward
alias grbf="\
git \
rebase \
--force-rebase \
"
# rebase interactively
alias grbi="\
git \
rebase \
--interactive \
"
# remove and add removal to index
alias grm="\
git \
rm \
"
# add a new remote repository
alias grma="\
git \
remote \
add \
"
# list remote repositories
alias grml="\
git \
remote \
--verbose \
"
# show a connection to a repository
alias grms="\
git \
remote \
show \
"
# set the location of the remote repository
alias grmsu="\
git \
remote \
set-url \
"
# remove file(s) from index or move current branch pointer
alias grs="\
git \
reset \
"
# wipe modifications or reset current branch to another commit
alias grsh="\
git \
reset \
--hard \
"
# current state of repository
alias gs="\
git \
status \
--untracked-files=all \
"
# show a commit
alias gsc="\
git \
show \
"
# tag a commit
alias gt="\
git \
tag \
"
# delete a tag
alias gtd="\
git \
tag \
--delete \
"
# tag a commit and sign
alias gts="\
git \
tag \
--sign \
"

12
shell/alias/gpg.sh Normal file
View file

@ -0,0 +1,12 @@
# turn gpg agent off
alias gak="\
gpgconf \
--kill \"gpg-agent\" \
"
# bind gpg agent to current tty
alias gau="\
gpg-connect-agent \
updatestartuptty \
/bye \
"

7
shell/alias/grep.sh Normal file
View file

@ -0,0 +1,7 @@
# grep from current directory with regex
alias g="\
grep \
--directories \"recurse\" \
--line-number \
--regexp \
"

10
shell/alias/kill.sh Normal file
View file

@ -0,0 +1,10 @@
# kill a process by id
alias k="\
kill \
"
# force kill a process by id
alias kf="\
kill \
-9 \
"

10
shell/alias/killall.sh Normal file
View file

@ -0,0 +1,10 @@
# kill all instances of a process by name
alias ka="\
killall \
"
# force kill all instances of a process by name
alias kaf="\
killall \
-9 \
"

13
shell/alias/ls.sh Normal file
View file

@ -0,0 +1,13 @@
export LS_COLORS="\
di=0;94\
"
# list current directory’s entries
alias l="\
ls \
--all \
--color \
-l \
-p \
--time-style \"+%Y%m%d-%H%M%S%-:::z\" \
"

12
shell/alias/lsblk.sh Normal file
View file

@ -0,0 +1,12 @@
# list block devices
alias lb="\
lsblk \
--output \"NAME,SIZE,TYPE,FSTYPE,LABEL,MOUNTPOINTS\" \
--noempty \
"
# list block devices (old)
alias lbo="\
lsblk \
--output \"NAME,SIZE,TYPE,FSTYPE,LABEL,MOUNTPOINT\" \
"

3
shell/alias/micro.sh Normal file
View file

@ -0,0 +1,3 @@
alias µ="\
micro \
"

10
shell/alias/mkdir.sh Normal file
View file

@ -0,0 +1,10 @@
# make a directory
alias md="\
mkdir \
"
# make a directory after making its parents
alias mdp="\
mkdir \
--parents \
"

10
shell/alias/mount.sh Normal file
View file

@ -0,0 +1,10 @@
alias m="\
mount \
"
# remount read-only medium in read-write
alias remount="\
mount \
-o \"remount,rw\" \
\"/usr/lib/live/mount/medium\" \
"

5
shell/alias/mv.sh Normal file
View file

@ -0,0 +1,5 @@
# move interactively
alias mvi="\
mv \
--interactive \
"

3
shell/alias/nano.sh Normal file
View file

@ -0,0 +1,3 @@
alias n="\
nano \
"

3
shell/alias/newsboat.sh Normal file
View file

@ -0,0 +1,3 @@
alias nb="\
newsboat \
"

View file

@ -0,0 +1,12 @@
# list otp accounts
alias otpl="\
otpclient-cli \
list \
"
# display otp code
alias otps="\
otpclient-cli \
show \
-a \
"

10
shell/alias/pass.sh Normal file
View file

@ -0,0 +1,10 @@
# display pass entry’s content
alias p="\
pass \
"
# copy passphrase into clipboard
alias pc="\
pass \
--clip \
"

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

@ -0,0 +1,7 @@
# look for a string in processes names
alias pg="\
ps \
-A \
| \
grep \
"

16
shell/alias/pwgen.sh Normal file
View file

@ -0,0 +1,16 @@
# generate passwords
alias pwg="\
pwgen \
-1 \
--num-passwords 1048576 \
--secure \
"
# generate passwords with symbols
alias pwgs="\
pwgen \
-1 \
--num-passwords 1048576 \
--secure \
--symbols \
"

29
shell/alias/rsync.sh Normal file
View file

@ -0,0 +1,29 @@
# synchronize
alias rs="\
rsync \
--archive \
--partial \
--progress \
--verbose \
--no-inc-recursive \
"
# synchronize and delete after
alias rsda="\
rsync \
--archive \
--partial \
--progress \
--verbose \
--delete-after \
"
# synchronize and delete before
alias rsdb="\
rsync \
--archive \
--partial \
--progress \
--verbose \
--delete-before \
"

21
shell/alias/tar.sh Normal file
View file

@ -0,0 +1,21 @@
alias tc="\
tar \
--verbose \
--create \
--auto-compress \
--file \
"
alias tl="\
tar \
--verbose \
--list \
--file \
"
alias tx="\
tar \
--verbose \
--extract \
--file \
"

8
shell/alias/tree.sh Normal file
View file

@ -0,0 +1,8 @@
alias t="\
tree \
"
alias ta="\
tree \
-a \
"