For example, instead of typing all 5 commands in my terminal:
command 1
command 2
command 3
command 4
command 5
I just want to enter one command that runs all 5 commands above:
command everything
Is that possible? What would I need to edit in Ubuntu to do so?
If you're running a bash shell, you can type
alias commandall='command1 ; command2 ; command3 ; command4; command5'
Then commandall
will run these commands
You can put the alias in your ~/.bashrc
file and it will be there whenever you log in.
create a bash script.
#!/bin/bash
command1
command2
command3
then set its mode to executable
chmod a+x commandall
then you can call it from the command line
./commandall
if you put it in a directory in your PATH, you can call it like any other command.
~/bin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With