Book Image

Linux Mint System Administrator's Beginner's Guide

By : Arturo Fernandez Montoro
Book Image

Linux Mint System Administrator's Beginner's Guide

By: Arturo Fernandez Montoro

Overview of this book

<p>System administrators are responsible for keeping servers and workstations working properly. They perform actions to get a secure, stable, and robust operating system. In order to do that, system administrators perform actions such as monitoring, accounts maintenance, restoring backups, and software installation. All these actions and tasks are crucial to business success.<br /><br />"Linux Mint System Administrator’s Beginner’s Guide" is a practical and concise guide that offers you clear step-by-step exercises to learn good practices, commands, tools, and tips and tricks to convert users into system administrators in record time.<br /><br />You’ll learn how to perform basic operations, such as create user accounts and install software. Moving forward, we’ll find out more about important tasks executed daily by system administrators.</p> <p><br />Data and information are very important so you’ll learn how to create and restore backups. You will also learn about one of the most important points of an operating system: security.</p> <p><br />Thanks to "Linux Mint System Administrator’s Beginner’s Guide", you’ll learn all the basics you need to install and keep a robust and reliable Linux Mint operating system up to date.</p>
Table of Contents (18 chapters)
Linux Mint System Administration Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating your first shell script


So far, we have launched commands by directly typing into the shell and pressing Enter, but it's also possible to use a text file for writing a set of commands and launch this file through the shell. This technique allows us to create scripts or small applications for launching commands or executing different shell operations. In fact, the Bash shell offers us a particular domain-specific programming language for this purpose. Although the learning curve for this specific programming language is not trivial, we're going to learn how to create a simple Bash script for executing some commands using control structures.

In our example, we'll create a script for checking whether a text file exists. If the answer is in the affirmative, we'll launch a message informing you about it. Otherwise, we'll create a new text file with a single line. Finally, whatever happens, we'll list the created text file.