Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Aliases within a script

 
Minal Silimkar-Urankar
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to add aliases within sript.
I added

alias lm='ls -i | more'

in .bash_profile file.

but it is not working........
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add it in $HOME/.bashrc and do
 
Minal Silimkar-Urankar
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added
alias lm='ls -l | more'
in .bashrc file but after giving command "lm" it is showing command not found.
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding it in the .bashrc should do the trick unless you don't use bash shell at all.

Did you do

from your terminal?

The source command only affects the current terminal where you issued that command and all the new terminal opened that you're going to open later on. The other existing terminals won't be affected by the changes. You need to close them first.

But you can always restart the OS to reflect the changes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic