Alias Thread

Post your aliases:

alias please='sudo'
alias leave='gnome-session-quit'
alias q='exit'
alias c='clear'
alias shutn='shutdown now'
alias spac='sudo pacman'
alias pac='pacman'
alias saura='sudo aura'

Other urls found in this thread:

stackoverflow.com/questions/7131670/make-a-bash-alias-that-takes-a-parameter
somafm.com/groovesalad.pls'
gnu.org/software/bash/manual/bash.html#Programmable-Completion-Builtins
twitter.com/NSFWRedditGif

A lot of these won't work cause you didn't pass arguments, but who am I kidding, you've probably never even used Linux before.

works on my machine

What are you even talking about? And does 'clear' even have arguments?

?Why wouldn't they work?
I use
>alias install='sudo pacman -S'
and it works fine.

but they do, I use them daily

>he doesn't know that aliases still accept arguments

lmao winblow yourself

>not using fuctions
kys

function edit() {
emacsclient -n $1
}

first post best retard

stackoverflow.com/questions/7131670/make-a-bash-alias-that-takes-a-parameter

>alias please='sudo'
alias takes longer to type than an actual command... a mark of a true newbie retard.

Learn to fucking read.

bash aliases do accept arguments, but only at the end:

$ alias speak=echo
$ speak hello world
hello world

Putting arguments into the middle of command via alias is indeed possible but it gets ugly.

alias op='faggot'

...

>using sudo

functions > aliases

# Git
grm() { git rm --cached "$(git status --porcelain | awk '$1 ~ /D/ {print $2}')"; }
gpush() { git add ./* && git commit --message='wip' && git push --set-upstream origin master; }
gclone() { git clone ${1}:neeto/${2}.git; }

# Package manager
upg() { sudo apt-get update && sudo apt-get upgrade; }

# Systemd
jctl() { sudo journalctl --all --quiet --catalog --pager-end; }
sctl() { sudo systemctl "$@"; }
sctlfi() { systemctl list-unit-files --all; }
sedit() { sudo systemctl edit --full "$@"; }
sstatus() { sudo systemctl status "$@"; }
sstart() { sudo systemctl start "$@"; sudo systemctl status "$@"; }
sstop() { sudo systemctl stop "$@"; sudo systemctl status "$@"; }
srestart() { sudo systemctl restart "$@"; sudo systemctl status "$@"; }
senable() { sudo systemctl enable "$@"; sudo systemctl status "$@"; }
sdisable() { sudo systemctl disable "$@"; sudo systemctl status "$@"; }
ustart() { systemctl --user start "$@"; systemctl --user status "$@"; }
urestart() { systemctl --user restart "$@"; systemctl --user status "$@"; }
ustop() { systemctl --user stop "$@"; systemctl --user status "$@"; }
uenabled() { systemctl --user enable "$@"; systemctl --user status "$@"; }
udisabled() { systemctl --user disable "$@"; systemctl --user status "$@"; }
ustatus() { systemctl --user status "$@"; }

# Misc
lefix() { sed --in-place 's/\r//g' "$@"; }
mcd() { mkdir --parents "$1" && cd "$1"; }
mntext() { sudo mount "$1" "$2" --options user,rw,umask=111,dmask=000; }
tarx() { tar xaf "$1" && rm "$1"; }
tarc() { tar caf "${1:-tarchive}" --remove-files "$2"; }
getmem() { free --mega | grep Mem | awk '{print $4}'; }
lsobj() { sudo awk '{printf "%5d MB %s\n", $3*$4/(1024*1024), $1}' /proc/slabinfo | sort --numeric-sort; }
rlog() { awk '$1 !~ /^(DEBUG|INFO|STATUS)/ {print}' "$1"; }
gc() { gcc -std=c11 -Wall -Wextra -g -o "${1%.*}" "$1"; }

hey that's pretty good

Dat boilerplate

Just write a wrapper to systemctl at that point you fucking retard

thx senpai here's my bash_profile as an added bonus
pathCheck() {
while read -r path; do
[[ $1 = $path ]] && return 1
done <

>alias q='exit'
>he doesn't know about Ctrl-D

ive thought about it but im too lazy and havent added anymore sctl functions since

I do but I prefer typing

>gpush() { git add ./* && git commit --message='wip' && git push --set-upstream origin master; }
That is shit. You just end up with numerous commits with 'wip' message. Since you use a function you could just end a message as argument.

worth noting that bash can handle substitutions and that sed line can be replaced with

...

yeah i had a feeling. only use git for personal use and im really bad about actually learning how to use it.

Not having aliases so you can pretend to be a cute anime girl. senpai=sudo

alias c='clear'
>ctl+l
alias spac='sudo pacman'
alias pac='pacman'
>wtf?

what's wrong

>clear && screenfetch
kys faggot

>he can't into screenfetch

Not OP but ctr+l doesn't clear scrollback history.

depends on your $TERM i believe

it does not
it's like typing clear

someone was so assblasted that he quoted all these posts only to embarrass himself again.

Even that's unnecessary, you can just use read with -d : or set IFS.

>alias please='sudo'
kek

how to do
> cd ... = cd ../..
but only for this case with cd?

cd() {
if [[ $1 = ... ]]; then
builtin cd ../..
else
builtin cd "$@"
fi
}

nice, thank you

lmao you're right. thanks for the insight.

Steal my di.fm listen key if you want. It's just a free trial I sign up for every week.

alias pacman='pacman --color auto'
alias gsalad='mpv somafm.com/groovesalad.pls'
alias ghop="mpv prem1.di.fm:80/glitchhop?$87d8fc90d43e6d190b83a8a4"
alias ghopc='mpv --shuffle --ytdl-format="bestvideo[height

please tab completes at pl and sudo completes at sud

no it doesn't
it tab completes at ple

what does pl complete to?

...

none of that seems to have precedence over sudo whereas su does because it's what you ought to be using in MOST cases

None.

you forget alias osx="gay"
nice hipster shell btw faggot

ksh is the opposite of hipster

-ancient
-only semantics seperate it from its competition
-miros shell

>posix compliant
>just works
>shell of a good os

-old standard created by fascists that has inhibited the adaption of non-shit middleware environments
-not a arguement
-shell of a hipster os

Only have a couple

jesus christ
I share a forum with peasants
disgusting

>forum
Nice try, newfag. Now get out.

he's right tho

Do you work on other boxes at all? it must be a pain to depend on so many alias like that.

gnu.org/software/bash/manual/bash.html#Programmable-Completion-Builtins

Something like:

complete -o nosort -F script_complete script

Where script is your script name and script_complete is a function which sets COMPREPLY.

Using zsh.
Having alias to change directory. Wtf??