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...


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

What Id like to do is to enter


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.
LinuxLinux Distributions

Avatar of undefined
Last Comment

8/22/2022 - Mon

here the way, change it to:

alias viewbash='clear ; grep alias ~/.bashrc'

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 ; ?

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

Tintin thank you mate :>)

Thanks omar.

You guys are great :>)
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes