0

In this tutorial, we will see two methods that will allow us to combine two frequently used terminal commands in a single command under a system running Ubuntu/Linux Mint. We will help you run "apt-get update" and "apt-get upgrade" with one command called "update", which will be easier to write and will save you time.

Method 1

Open the terminal (CTRL+ALT+T) and run this command:

 > ~/.bash_aliases; gedit ~/.bash_aliases

For Linux Mint, run this command:

 > ~/.bash_aliases; pluma ~/.bash_aliases

Add now these lines:

alias update='sudo apt-get update; sudo apt-get upgrade'


Save your file and close it, then restart your terminal by closing and opening it again. You can now run two commands using this one:

update

Method 2

Open the terminal and run this command:

sudo gedit /usr/local/bin/update

For Linux Mint, run this command:

sudo pluma /usr/local/bin/update

Add now this line:

sudo apt-get update; sudo apt-get upgrade


Save your file and exit, then give execution permission to this file with this command:

sudo chmod +x /usr/local/bin/update

Run now this command to test your script:

update

I hope you find this tip useful!

Post a Comment

 
Top