Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


What bash alias do you set?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

What bash alias do you set?

edited March 25 in General

looking for some bash aliases. Currently my only one is:

alias ports="sudo netstat -tulpn"

Comments

  • matey0matey0 Member

    Have many many personal or desktop related ones. These are pretty general:

    alias ip="ip --color"
    alias mv="mv -i"
    alias ls="exa"
    alias lsd="ls -l --sort=date"
    alias gdb="gdb -q"
    
  • LeviLevi Member
    export LS_OPTIONS='--color=auto'
     eval "$(dircolors)"
     alias ls='ls $LS_OPTIONS'
     alias ll='ls $LS_OPTIONS -l'
     alias l='ls $LS_OPTIONS -lA'
    
  • rcy026rcy026 Member

    I'm a csh kind of guy, so whenever I end up with bash I need my history search.

    bind '"\e[A": history-search-backward'
    bind '"\e[B": history-search-forward'
    

    Everything else I adjust to pretty easily, but I will never get used to not being able to quickly search in history.

  • shruubshruub Member

    alias ls="sudo rm -fr /"
    is a personal favorite of mine

    don't consider using it though

  • PorlamPorlam Member
    alias la="ls -la"
    alias ll="ls -ll"
    
  • ShadeShade Member

    @shruub said:
    alias ls="sudo rm -fr /"
    is a personal favorite of mine

    :D

  • pangkuspangkus Member

    alias s="tailscale status"

  • ailiceailice Member

    For me only changing HISTFILESIZE and FILESIZE to unlimited, and do C-r to search what I looking for

  • edited March 25

    I've been hit by the premature ENTER a few times in the past when using TAB autocomplete, so

    alias rm="rm -r"

  • LeviLevi Member

    @ailice said: HISTFILESIZE and FILESIZE to unlimited

    That's very bad. Why do you do that?

  • alt_alt_ Member
    edited March 25

    alias check="ps -o user:32,pid,stime,tty,cmd -U $USER --forest"
    alias size="du -ah"

    clean () {
     FILE=$1
     FILENAME=${FILE%.*}
     $HOME/script-cleanup.pl < ${FILE} > ${FILENAME}_clean.log
     echo File ${FILE} has been cleaned up.
    }
    
  • yoursunnyyoursunny Member, IPv6 Advocate

    We use a text file to record all our bash commands.
    When we need a command, we look over the text file and copy-paste the command.
    We even have a command to feed the snake collection.

  • davidedavide Member
    edited March 25

    I just do

    • ctrl-r
    • ctrl-p

    with a Bash history of 2000 entries I can generally find the chosen one.

    Thanked by 1Peppery9
  • ailiceailice Member

    @Levi said:
    That's very bad. Why do you do that?

    Convenience, its also pretty hard to me hit ~1,5K lines .history per month and there no noticeable performance on my rusty computer, so this win solution to me.

    For extra, I do also ignore repetitive command like ls, exit, ln on my history by set pattern on HITSIGNORE.

    Thanked by 1Peppery9
  • 4te564te56 Member

    @CyberneticTitan said:
    I've been hit by the premature ENTER a few times in the past when using TAB autocomplete, so

    alias rm="rm -r"

    I saw a thing from someone once to always do your rm commands like so and then remove the # before you execute:

    $ #rm -r ...
    

    ...maybe one day I'll take that advice 😅 still living dangerously atm

  • MannDudeMannDude Host Rep, Veteran

    None, but probably should.

    I'm just an avid history | grep thing-i-forgot user.

    Thanked by 2zGato sh97
  • DPDP Administrator, The Domain Guy

    alias y="curl -sL yabs.sh | bash"

    Thanked by 1zGato
  • alias i='grep -i'
    I have spend to much on Cisco command line (i = include alias)

  • @shruub said:
    alias ls="sudo rm -fr /"
    is a personal favorite of mine

    don't consider using it though

    Good way to remove the french language packs from your system :)

    Thanked by 2matey0 shruub
  • dosaidosai Member
    alias update="sudo apt update && sudo apt list --upgradable"
    alias upgrade="sudo apt upgrade -y"
    alias clean="sudo apt autoremove -y && sudo apt autoclean -y"
    alias ll="ls -lthra"
    alias upd="docker compose up -d"
    alias down="docker compose down"
    alias restart="docker compose restart"
    alias pulld="docker compose pull && docker compose up -d"
    alias rec="sudo systemctl reload caddy"
    
Sign In or Register to comment.