|
Linux Command Line System Update Script
|
|
10-01-2009, 11:18 PM
(This post was last modified: 10-02-2009 10:09 AM by safety.)
Post: #1
|
|||
|
|||
|
Linux Command Line System Update Script
In my experience with Linux distributions, Slackware and Ubuntu/Kubuntu, there are a couple of different methods used to update the system. Of course we can always use a gui to do the updates but what fun is that?
The two commands used to update a Debian based system are: Code: safety@nDarkness:~/bin$ sudo apt-get updateNow while this doesn't require a great deal of typing, let's see if we can shorten it to suit our needs. If you do not already have somewhere to store your personal scripts, the following command will do this for you and allow you to enter the code we will use: Code: safety@nDarkness:~$ mkdir bin; cd bin; vi apt-autoPress i for insert and create the following script: Code: #!/bin/bashThis is all we need to type for our script to produce the results we are looking for. Now let's save our script by pressing Esc => :wq => <enter>. To run our script we can type: Code: safety@nDarkness:~/bin$ bash ./apt-autoYou should see the output from the two commands used in the script printed to the screen. Now let's make our script executable so we don't have to type bash to make it run. The following command will accomplish what we are looking for: Code: safety@nDarkness:~/bin$ chmod +x apt-autoNow to run our command we simply need to type: Code: safety@nDarkness:~/bin$ ./apt-autoWe now have a working script to do our update process and it is significantly shorter than the first option we used. As always all comments are welcomed. |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread:






