Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I create a new alias command called cet103demo which displays the contents of the bash history list one page at a time, and also making sure the new alias is automatically loaded when the virtual machine starts up?

share|improve this question

Fairly simple. Just run the following in a terminal:

echo 'alias cet103demo="history | more"' >> ~/.bash_aliases
source ~/.bash_aliases
cet103demo  # to test

You'll only have to run these once to remove it, you'll just need to edit ~/.bash_aliases (it'll be the last line).

share|improve this answer
Isn't it better to put aliases in ~/.bash_aliases than in ~/.bashrc, though it does matter technically, just to organize things better? – i08in Apr 3 '14 at 14:02
@Jobin Probably, yeah. – Oli Apr 3 '14 at 14:06
So i would open Gedit add #!/bin/bash and paste in "echo 'alias cet103demo="history | more"' >> ~/.bash_aliases source ~/.bash_aliases' " under neath ?? – user264934 Apr 3 '14 at 17:37
@user264934 No. You must to open the terminal and run those commands inside of. – Radu Rădeanu Apr 3 '14 at 19:31

Add the following line to your ~/.bashrc file:

alias cet103demo="history | more"

And just hit SPACE to page down

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.