from small one page howto to huge articles all in one place

search text in:

Which kernel version do you use?

poll results

Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs






average rating: 1.7 (102 votes) (1=very good 6=terrible)

May 25th. 2007:




why adblockers are bad

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels






average rating: 1.4 (42 votes) (1=very good 6=terrible)

April, 26th. 2006:

Druckversion . pdf icon
You are here: System->Tips and Tricks

Alias, Setting command aliases

The alias command allows you to make new shortcuts and synonyms for commonly used comands. The basic usage is:

alias newcommand='yourcommand -arguments'

If you want to start aterm according to your preferences with the command term, do something like:

alias term='aterm -ls -fg gray -bg black'

If you want a quick alias like ll for a more informative file listing:

ls -al --color=yes

Starting alias without any options lists the current aliases:


alias ls='ll'  
alias ls -al --color=yes  
alias term='aterm -ls -fg gray -bg black'

Use unalias to remove an alias.

unalias term

You can also make aliases for existing commands. If you want ls to show colors by default, do:

alias ls='ls --color=yes'

These aliases can be put in your login script (.bash_profile or .profile depending on what shell you are using).

Alias with variables

You can not make aliases with variables. But you can make functions, having a function in your .profile/.bashrc will work just like an alias. To use ssh to copy files to a location on a server you can use

sendpic () { scp "$@"; }

Another way for aliases with variables

If you dont like to use a function, if you need variables, try the following to change to the last working directory:

alias cdo="cd \"\$OLDPWD\""

Note: it is important, that there are ONLY double quotes in the expression above, no single quotes like in the other examples!

Creating aliases on shell startup

You can have your aliases created anytime you open an instance of a shell. If you are using bash, edit your ~/.bashrc file and add one alias per line. Once you save and close the file, run this to load your new aliases immediately:

source ~/.bashrc

Otherwise, the new aliases will load whenever you open a new instance of the shell.

Another place to put your aliases if you want them to be system-wide for all users is in /etc/bashrc. To load those aliases, add this line to ~/.bashrc

source /etc/bashrc


rate this article:
current rating: average rating: 1.2 (1370 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)


Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 56.4 ms