2007-12-17

Alias - how to

Definition (alias [ˈeiliəs] noun):
a false name

Example: What alias did the crook use this time?
Arabic: إسْم مُسْتَعَار
Chinese (Simplified): 化名
Chinese (Traditional): 化名
Czech: falešné jméno
Danish: alias; dæknavn
Dutch: alias
Estonian: valenimi
Finnish: peitenimi
French: faux nom
German: der Deckname
Greek: ψευδώνυμο
Hungarian: álnév
Icelandic: falskt nafn, tökuheiti
Indonesian: nama palsu, nama lain
Italian: pseudonimo

Japanese: 偽名, 通称
Korean: 별명
Latvian: pieņemts vārds
Lithuanian: slapyvardis, pravardė
Norwegian: dekknavn
Polish: pseudonim, fałszywe nazwisko
Portuguese (Brazil): pseudônimo
Portuguese (Portugal): pseudónimo
Romanian: supranume
Russian: кличка; прозвище
Slovak: falošné meno
Slovenian: lažno ime
Spanish: seudónimo
Swedish: alias
Turkish: sahte a
source: dictionary.com


Alias command definition:

Alias is a built-in shell command that allows you create shortcuts/synonyms for other shell commands.

How to make an alias:
  • Sintax
alias [name=['command']]
  • example - make an alias for clear command:
$ alias cl='clear'
  • description: now when you type cl at your terminal, is the same thing as type clear. This can be used for more and/or long stings..
  • other alias:
$ alias p='pwd'

$ alias x="exit"

$ alias folderx='cd /home/your_user/Desktop/folderx'


How to remove an alias:

  • Sintax
unalias [alias_name]
  • example - remove an alias for clear command:
$ unalias cl

Note:

When the computer is rebooted all alias will be lost.
How to prevent it? All alias must be added to .bashrc file located at your user folder (example: /home/uterrorista/.bashrc)
  • example:
$ gedit /home/uterrorista/.bashrc
  • paste:
alias cl='clear'
etc...
  • now you have to 'compile' your .bashrc file
$ source .bashrc
  • Now cl alias it's saved..
My tutorial:

Make an alias to create other alias..
  • Edit .bashrc
$ cd
$ gedit .bashrc

  • and paste (replace your_user_name with your nick session):
## Add new alias and compile i
alias aalias='gedit /home/
your_user_name/.bashrc && source /home/your_user_name/.bashrc'
  • compile
$ source .bashrc
  • Now you can add the alias you want just simple doing:
$ aalias
  • add (for example. you can make now your desired alias):
## One folder up
alias up='cd ..'

## Clear screen
alias cl='clear'

alias ff='find . -name $*'
alias untar='tar zxvf'
alias p='pwd'

alias ls="ls --color=auto"
alias ll="ls -l --color=auto"
alias la="ls -l -a --color=auto"

alias x="exit"

alias compilar='sudo ./configure && sudo make && sudo make install'

alias apti='sudo apt-get install'
alias aptud='sudo apt-get update'
alias aptug='sudo apt-get upgrade'

alias aptar='sudo apt-get autoremove'
alias aptr='sudo apt-get remove'

alias aptc='sudo apt-get clean'
alias aptac='sudo apt-get autoclean'


function today {
echo "Today's date is:"
date +"%A, %B %-d, %Y"
}


  • Note: you if have noticed i have a function on my .bashrc file - function today. To run it type: today.
  • to remove an alias: just edit the .bashrc file (aalias) and remove/delete the alias you don't need anymore..
Be free to submit a comment and post your alias..

5 comments:

  1. Gostei muito desse post e seu blog é muito interessante, vou passar por aqui sempre =) Depois dá uma passada lá no meu site, que é sobre o CresceNet, espero que goste. O endereço dele é http://www.provedorcrescenet.com . Um abraço.

    ReplyDelete
  2. Gostei muito desse post e seu blog é muito interessante, vou passar por aqui sempre =) Depois dá uma passada lá no meu site, que é sobre o CresceNet, espero que goste. O endereço dele é http://www.provedorcrescenet.com . Um abraço.

    ReplyDelete
  3. I'm an avid blog reader and I find blogs like this are genuinely beneficial when scouring the web for finasteride. It seriously helps when you come across an excellent source from a trustworthy website. The prices are fantastic too, especially for generic levitra.

    ReplyDelete