Favorite aliases?

I found that on all my linux installs I put in my own custom aliases in my user directory
under .bash_aliases
here are my commonly used ones…

alias upev='sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean -y && sudo apt autoclean -y'
alias c='clear'

## get rid of command not found ##
alias cd..='cd ..'
 
## a quick way to get out of current directory ##
alias ..='cd ..'
alias ...='cd ../../../'
alias ....='cd ../../../../'
alias .....='cd ../../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../..'

## mount differently
alias mounts='mount | column -t'
## show open ports
alias ports='nmap localhost'

## pass options to free ##
alias meminfo='free -m -l -t'

## get server cpu info ##
alias cpuinfo='lscpu'

##resume wget by default
## this one saved by butt so many times ##
alias wget='wget -c'

## make parent directories and verify
alias mkdir="mkdir -pv"

##ncdu as du
alias du="ncdu"

##check all running services
alias whatsup='service --status-all'  

##Debian doesnt have the -ll- alias created by default, like Ubuntu.
alias ll='ls -lahF'

##cleaner looking df
alias df="df -Tha --total"

Then to activate them w/o a reboot I type
source ~/.bashrc

What are some of your favorite aliases?

5 Likes

Just added this line to my favorites


##nano with line
alias nano="nano -c"

but can also be done by creating a file ~/.nanorc and putting set constantshow that in the file

now I get the number lines listed on my nano instance so if I need to find a particular line, I can find it

I still can’t go without my little ASCII Weather forecast … not really an alias but just so fun

2 Likes

I really like the updated weather entry…very nice! Thanks!

Yea me too.
There are also other nice options, try curl v2.wttr.in.

https://github.com/chubin/wttr.in

1 Like

my favorite aliases:

# Lista de servicios
SERVICES="kavita komga ubooquity mopidy deluged deluged-web navidrome gmediarender minidlna airsonic home-assistant"

# Alias para detener todos los servicios listados en la variable SERVICES y hacer echo del tiempo real
alias stop_services='for service in $SERVICES; do \
    START_TIME=$(date +%s%N) ; \
    sudo systemctl stop "$service" ; \
    END_TIME=$(date +%s%N) ; \
    ELAPSED_TIME=$(echo "scale=2; ($END_TIME - $START_TIME)/1000000000" | bc) ; \
    echo "Stopped service $service in $ELAPSED_TIME seconds" ; \
done'

# dmesg con marca de tiempo
alias dmesg='dmesg -T'

# fu nano
alias nano='vim'

ahahahahahahahaahahahahaha

4 Likes

I like these :smiley:. Here are some I use, for coloured and shorter directory listings, and verification prompts when removing over overwriting files: hacks/rootfs/etc/bashrc.d/micha.sh at 1e4ad0be62c081ee256aa7fb53cc8e93c22a5bac · MichaIng/hacks · GitHub

Does this not breakt things like mount /dev/sda1 /mnt/mountpoint? But the listing is beautified indeed.

1 Like

Yeah…I really like the colored listings!

I always use ll as ls -lah so it’s always human readable…but most DEFINTIELY a much more nice looking listing by far!

As for the breaking thing…I guess it would for dietpi…but I also use these as my regular flavored Linux…maybe a dietpi specific alias for the backwards mount thing would be better

Having a few readily available “baked in” aliases would be useful, as it would set dietpi above and beyond “vanilla” flavor distro’s

Ah…maybe mount should be “mounts” this way it doesn’t confuse the scripting language…good catch!!! (updated OP post)

1 Like

haha…that’s a good one

# fu nano

I prefer nano over vi…guess I should learn it as well huh?

I would say it depends.
If I just need to edit 2 lines in a config, I just use nano.

If I need to write more, like code for some apps etc, I use neovim / vim. You can integrate LSPs and linters, file trees etc into it (https://nvchad.com/ :smiley: which is not the case for nano, at least I don’t know such features for nano :slight_smile:

I prefer ls -latrh to sort them as well with last modified time. :slight_smile:

Try -A instead of -a to not show . and .. :slightly_smiling_face:.

1 Like