What are your most liked alias for long commands or just to give them better names.

Mine are:

alias load="source .load.sh"
alias eload="$EDITOR .load.sh"
alias gpush="git push"
alias gadd="git add --all"
alias gcommit="git commit -m "
alias gst="git status -s"
alias gpull="git pull"
1 point
*

I like to use the ones includes in oh-my-zsh. It’s a big list, but the ones I use the most are:

gst --> git status

gcam --> git commit -am

gcp --> git cherry-pick

gsta --> git stash save

gstp --> git stash pop

gpsup --> git push --set-upstream origin $(git_current_branch)

grb --> git rebase

permalink
report
reply
3 points

alias fuck='sudo $(fc -ln -1)'

permalink
report
reply
1 point

Just use sudo !!

permalink
report
parent
reply
1 point

yeah, I could do that. Kinda prefer to use my alias anyway as the expletive is almost always the first word that comes to mind when I forget to sudo something

permalink
report
parent
reply
2 points

Can’t argue with that but it reminds me of thefuck which is similar but does more

permalink
report
parent
reply
6 points

I always set these because I’ve been burned too many times:

Turn on interactive mode for dangerous commands

alias cp='cp -iv'
alias mv='mv -iv'
alias rm='rm -iv'
permalink
report
reply
2 points
*

For git and working with a mix of master and main default branch repos my favourite is gsm='git switch $(git_main_branch)' to switch back to main/master

permalink
report
reply
3 points

Technically not aliases but I have these in my ~/.bash_aliases so…

bind ‘“\e[A”: history-search-backward’
bind ‘“\e[B”: history-search-forward’

Type a few letters and press up/down arrow to scroll through matching history entries.

Also…

alias s=“cd -”

It’s like Alt+Tab for CLI.

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

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

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

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

Community stats

  • 6.7K

    Monthly active users

  • 6.5K

    Posts

  • 176K

    Comments