Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
We all have them. Aliases. And I'm curious, what aliases do you use? Who knows, might even give a few good ideas Well, I guess I have go go first. ...
  1. #1
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047

    Post your `alias`

    We all have them. Aliases. And I'm curious, what aliases do you use?
    Who knows, might even give a few good ideas


    Well, I guess I have go go first. These are some of mine:
    Code:
    alias renet="/etc/rc.d/rc.inetd restart && /etc/rc.d/rc.inet1 restart"
    alias ll="ls -lh"
    alias la="ls -a"
    alias lk="ls -B"
    alias lla="ls -alh"
    alias lss="ls -gGShr"
    alias df="df -h"
    alias du="du -h"
    alias grep="grep --color=auto"
    alias clr="clear ; fortune -as"
    alias ping="ping -c 4"
    alias scrash="screen bash"
    alias beep="play /usr/share/sounds/KDE_Window_Open.wav &> /dev/null"
    alias dir="echo Do people still use that ancient relic from what... 1994 or so?"
    alias mnt="mount|grep -v .zfs"
    Can't tell an OS by it's GUI

  2. #2
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,287
    I have these.

    Code:
    alias canhaz='sudo apt-get install'
    alias cansee='sudo apt-cache search'
    alias egrep='egrep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias grep='grep --color=auto'
    alias l='ls -CF'
    alias la='ls -A'
    alias ll='ls -alF'
    alias ls='ls --color=auto'
    only two of which I set up

    example: canhaz sauerbraten
    Last edited by elija; 09-17-2010 at 05:23 PM.
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  3. #3
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Au! Elija, I'm very mad at you There's coffee all over my screen lol

    Code:
    IM in ur PROFILE looking AT ur ALIAS
       { for ALIAS in PROFILE do ROFL kthnx }
    KTHNXBYE
    Can't tell an OS by it's GUI

  4. #4
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    951
    I have:

    alias ls='ls --color=auto'
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'
    alias cdd='cd /home/data'

    /home/data is the "My Documents" partition, shared between Crux and Debian.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  5. #5
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Mine plus a function.

    Code:
    alias in='sudo clyde -S'
    alias up='sudo bauerbill -Syu --rebase'
    alias upp='sudo clyde -Su --aur'
    alias re='sudo pacman -Rcsn'
    alias play="DISPLAY=:0 mplayer -fs"
    alias wbur='mplayer http://wbur-ogg.streamguys.com:80/wburlive.ogg'
    alias back='cd $OLDPWD'
    alias ..="cd .."
    alias ...="cd ../.."
    alias ....="cd ../../.."
    alias .....="cd ../../../.."
    alias ......="cd ../../../../.."
    
    extract () {
    if [ -f $1 ] ; then
    case $1 in
    *.tar.bz2) tar xvjf $1 ;;
    *.tar.gz) tar xvzf $1 ;;
    *.bz2) bunzip2 $1 ;;
    *.rar) rar x $1 ;;
    *.gz) gunzip $1 ;;
    *.tar) tar xvf $1 ;;
    *.tbz2) tar xvjf $1 ;;
    *.tgz) tar xvzf $1 ;;
    *.zip) unzip $1 ;;
    *.Z) uncompress $1 ;;
    *.7z) 7z x $1 ;;
    *) echo "don't know how to extract '$1'..." ;;
    esac
    else
    echo "'$1' is not a valid file!"
    fi
    }

  6. #6
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,391
    Here's mine at work

    Code:
    Microsoft Windows [Version 5.2.3790]
    (C) Copyright 1985-2003 Microsoft Corp.
    
    U:\>alias
    'alias' is not recognized as an internal or external command,
    operable program or batch file.
    
    U:\>
    You must all pity me.

    My cygwin has this:

    Code:
    # alias
    alias gvim='"/cygdrive/c/Program Files/Vim/vim72/gvim.exe"'
    alias less='/bin/less -r'
    alias ls='/bin/ls -F --color=tty --show-control-chars'
    alias vi='"/cygdrive/c/Program Files/Vim/vim72/gvim.exe"'
    alias vim='"/cygdrive/c/Program Files/Vim/vim72/gvim.exe"'
    Linux user #126863 - see http://linuxcounter.net/

  7. #7
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Quote Originally Posted by Roxoff
    You must all pity me.
    Mine isn't much different I'm afraid.

    Mine doesn't even know `ls`



    Also part of my profile, with different machinenames having different machine colours, my main account gets a green prompt, the root account gets a red prompt, and all other accounts a yellow one.
    Note also how I've never decided whether to use en-US or en-UK
    Code:
    ################################################
    # IMPORT COLORS (where available)
    if [ -f /etc/colors ] ; then
            . /etc/colors
            MACHINECOLOR="$BROWN"
    else
            NAMECOLOR="31m"
            MACHINECOLOR="36m"
    fi
    
    
    ################################################
    # Setting fancy prompts
    if [ "`id -u`" = "0" ]; then
            NAMECOLOR="$RED"
    elif [ $UID = "1000" ] ; then
            NAMECOLOR="$GREEN"
    else
            NAMECOLOR="$YELLOW"
    fi
    PS1="\[\e[${NAMECOLOR}\]\l \u\[\e[${MACHINECOLOR}@\]\h:\w \$\[\e[$CEND\]"

    They wont work unless you define colours:
    Code:
    # /etc/colors
    # To get the escape character in Vim, in insert mode press
    # [ctrl]+[V] 
    ESC="^[["
    CEND="${ESC}0;00m"
    BLACK="${ESC}0;30m"
    RED="${ESC}0;31m"
    GREEN="${ESC}0;32m"
    BROWN="${ESC}0;33m"
    BLUE="${ESC}0;34m"
    PURPLE="${ESC}0;35m"
    CYAN="${ESC}0;36m"
    GRAY="${ESC}0;37m"
    
    LBLACK="${ESC}1;30m"
    LRED="${ESC}1;31m"
    LGREEN="${ESC}1;32m"
    YELLOW="${ESC}1;33m"
    LBLUE="${ESC}1;34m"
    LPURPLE="${ESC}1;35m"
    LCYAN="${ESC}1;36m"
    WHITE="${ESC}1;37m"


    It never occurred to me that you could get working functions in your profile, but indeed, why not? It's so easy. For example:
    Code:
    warp()
    {
    if      [ ! $1 ]
    then
                    echo    "Warp where?"
    else
            case $1 in
                    www)
                    cd      /var/www/htdocs
                    ;;
                    rc)
                    cd      /etc/rc.d
                    ;;
                    log)
                    cd      /var/log
                    ;;
                    src)
                    cd      ~/src
                    ;;
            esac
            fi
    }
    Can't tell an OS by it's GUI

  8. #8
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568
    Cool,I never thought alias will be such a valuable stuff .thanks for this useful post!!! now i added my first custom alias-
    alias yinstall ="yum -y install"
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  9. #9
    Linux User
    Join Date
    Jan 2006
    Posts
    414
    alias maek='make'
    Guess who makes regular typo's?

  10. #10
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Quote Originally Posted by Lakshmipathi
    Cool,I never thought alias will be such a valuable stuff .thanks for this useful post!!!
    Well, I had a feeling this could turn out useful. I always thought that I could do more with it but I could never really quite lay the finger on it...


    But like Hazels cautious ' -i' flag on commands, that can be a lifesaver. Elija's canhaz had me rolling of my cough with tears in my eyes of laughing and reed9's... it never occurred to me you could define functions. That's so cool there's no limit to what you can break^H^H^H^H^Hdo with a function!


    Quote Originally Posted by darkrose0510
    Guess who makes regular typo's?
    Eh... To quote Louis XIV: "Le typo, c'est moi"
    Can't tell an OS by it's GUI

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •