LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-25-2008, 11:10 AM   #1
shivanrathore
Member
 
Registered: Apr 2008
Posts: 33

Rep: Reputation: 15
alias help


can some body help me ???? ....... how to make my alias name permanently ?

i did it as alias lol="init 0" but once i restart my machine , alias name doesn't work.
 
Old 07-25-2008, 11:16 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
From the Advanced Bash Scripting Guide:
Quote:
A Bash alias is essentially nothing more than a keyboard shortcut, an abbreviation, a means of avoiding
typing a long command sequence. If, for example, we include alias lm="ls −l | more" in the ~/.bashrc
file, then each lm typed at the command line will automatically be replaced by a ls −l | more.
this essentialy suggests to put your aliases in ~/.bashrc (if using bash of course). Since ~/.bashrc is sourced every time you open a shell, the alias will be always assigned and will be available after reboot.

This happens because aliases are local to the current shell (as like environment variables). If you define an alias directly from the command line and open a new terminal (that is a new shell session) the alias will not be available in the new terminal.

Last edited by colucix; 07-25-2008 at 11:18 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IP alias? Machine name alias? JohnLocke Linux - Newbie 4 01-16-2008 12:21 PM
Alias question (2 commands for one alias) gflores Linux - Newbie 3 01-21-2006 12:40 AM
alias xviddivxoggmp3 Slackware 9 01-25-2005 10:05 AM
Alias ChimpFace9000 Linux - General 9 01-14-2004 04:01 AM
alias nobu Slackware 5 01-11-2003 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration