How to create commands?

Asked by Navin Talati on 2011-08-01

Friends,
I am learning linux. I am gradually switching over to Ubuntu.
During my efforts, I am getting nice response from resource persons
like you and my work rolls on. You friends will appreciate my efforts
as I am proceeding in this activity at the age of 60. I have no computer
background. despite that I am putting my efforts to learn Ubuntu 11.04
at my best. Could you please guide me How to create commands to launch
in the Terminal ?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu bash Edit question
Assignee:
No assignee Edit question
Solved by:
Navin Talati
Solved:
2011-09-05
Last query:
2011-09-05
Last reply:
2011-08-01
Jon Charge (seropith) said : #1

Is there a particular command you would like to create?

or

Are you asking for a list of commands that do things?

You can bash scripts. These are small programs which can perform logic, take user input and also run system commands. I personally have about 5 core scripts I use daily. One is to update in terminal and is basically:

#!/bin/bash
sudo apt-get update
sudo apt-get upgrade

Once the script is marked as executable, you can call it as you wish. The top line will always be #!/bin/bash then the other lines will be the commands you want to run. There are plenty of bash tutorials and example code around and you can make some glorious scripts to make life a lot easier, or even more.

If you can provide more information about what you want your commands to do, it might be possible for us to give you a more specific answer.

If, on the other hand, by "create commands" you mean you want to know how to run commands, you can do that in the Terminal (Ctrl+Alt+T). If you want to know what some of the commands are that are available for you to run and how to use them, there are plenty of resources available for this. You may want to search the web for Linux command-line tutorials and bash tutorials, and you can refer to manual pages for bash and for various commands in order to see how to use them. (Manual pages for Ubuntu are browsable in Yelp, your help browser, and also at http://manpages.ubuntu.com and on the command-line itself using the man command.)

Navin Talati (n-m-talati) said : #4

Friends,
Thanks for the guidance.
I am learning..... but.... very very slowly...!
as it is self learning.
Navin Talati /5-9-2011