Link to home
Start Free TrialLog in
Avatar of Simon336697
Simon336697Flag for Australia

asked on

Executing 2 commands one after the other

Hi guys,
Id like to issue 2 commands to linux one after the other and just would like your help.
This is what im trying to do.

In the .bashrc file, i have a list of aliases that I have entered which save me time with certain things.
One of them is as follows....

alias viewbash='grep alias ~/.bashrc'

So, if from a command line, i enter...

viewbash

I get a listing of all my aliases in the file .bashrc

What Id like to do is to enter

viewbash

at a command line,

but to first clear the screen before issuing the listing of all aliases.

I dont know how to change

alias viewbash='grep alias ~/.bashrc'

to a way to first clear the screen, the run

alias viewbash='grep alias ~/.bashrc'

Thank you.
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

here the way, change it to:

alias viewbash='clear ; grep alias ~/.bashrc'
Avatar of Simon336697

ASKER

Thanks omarfarid appreciate it mate.

So if you wanted to execute multiple commands one after the other, are you saying that you separate each command with a semicolon?

Eg. A ; ?
SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Tintin thank you mate :>)

Thanks omar.

You guys are great :>)