0

Let’s say I have the following alias defined:

alias agi='sudo apt-get install'

When I execute agi I would like to see sudo apt-get install displayed before the command is run. This would serve as a reminder of what is actually being done. Is there a way to make this happen?

1 Answers1

4

Here's one way you can do it. I am certain there are more ways than one to do it.

alias agi='echo "sudo apt-get install"; sudo apt-get install'
Terrance
  • 41,612
  • 7
  • 124
  • 183