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"
11 points
alias ..='cd ..'
permalink
report
reply
3 points

AmigaOS style!

permalink
report
parent
reply
2 points

My variant (u mean “up” in my head)

alias u  ='cd ..'
alias uu ='cd ../..'
alias uuu='cd ../../..'
permalink
report
parent
reply
10 points
*

mkcd() { mkdir -p “$1” && cd “$1”; }

Make a directory and immediately cd into it. I rarely make a directory and not cd into it.

permalink
report
reply
2 points

My app keeps crashing. That’s the older version of my alias.

mkcd() { mkdir -p “$1” && cd “$1”; }

permalink
report
parent
reply
1 point

Uuuuh needed this one so many times.

permalink
report
parent
reply
10 points

alias weather=‘curl wttr.in

permalink
report
reply
1 point

I found a function version of this version somewhere. Same thing except it defaults to my local area but can be overridden if you specify a different zip code.

weather() {
 if [ $(command -v curl) ]; then
   if ! (($#)); then
     curl wttr.in/44113
   else
     curl wttr.in/$1
   fi
 else
   echo "curl not installed. Aborting."
 fi
}
permalink
report
parent
reply
1 point

That is really neat. I never knew I needed that.

permalink
report
parent
reply
7 points

alias ll=“ls - l”

My most-used, by far, for decades.

permalink
report
reply
4 points

This and alias la="ls -lhA"

permalink
report
parent
reply
2 points

In addition to this, I have lat & las with -t & -s sorting added respectively.

permalink
report
parent
reply
4 points

For just a second I thought this was Loss

permalink
report
parent
reply
6 points

Not exactly an alias but a short script. First, get git-revise which is a replacement for git rebase, and fzf if for some reason you don’t have it yet. Then make a script in your ~/.local/bin called git-f or whatever you’d like:

#!/bin/bash
REF=${1:-origin/main}  # adjust to your favorite trunk branch name
COMMIT=$(git log --pretty=oneline ${REF}.. \
         | fzf --preview "git show -p --stat {+1}" | cut -d' ' -f1)
if [ -n "$COMMIT" ]; then
    exec git revise "$COMMIT"
else
    exit 1
fi

Now hack away in a branch, make some commits, and at some point you will realize you want to modify an earlier commit. Use git add -p to add the relevant lines, but then instead of making a fixup commit just type git f and pick the target commit from the list.

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