This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Aliases within a script  RSS feed

 
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!