Linux: Shells, Scripting, and Data Management - dummies

Linux: Shells, Scripting, and Data Management

By Emmett Dulaney

The Linux+ certification exam from CompTIA requires knowledge of shells, scripting, and data management. This table shows the subtopics, weights, descriptions, and key knowledge areas for this topic of the Linux+ certification exam from CompTIA — the first of the 102 exam.

Breakout of Domain 105
Subtopic Weight Description Key Areas
Customize and use the shell environment 4 Be able to modify global and user profiles Set environment variables and work within bash
Customize or write simple scripts 4 Customize existing bash scripts and write new ones Be able to write code that includes loops and tests
SQL data management 2 Query databases and manipulate data with SQL Know basic SQL commands

To adequately address these topics, focus on the following files, terms, and utilities: /etc/profile, ~/.bash_login, ~/.bash_logout, ~/.bash_profile, ~/.bashrc, ~/.profile, alias, delete, env, export, for, from, function, group by, if, insert, join, lists, order by, read, select, seq, set, test, unset, update, where, and while.

Here are the top ten items to know as you study for this domain:

  1. Logic can be added to scripts by testing conditions with test or [. Commands can execute using if-then-fi deviations or through looping (while, until, or for). You can leave a script with the exit command or leave a loop with break.

  2. Variables can be given at the command line and referenced as $1, $2, and so on, or entered into the executing file with the read command.

  3. The alias command can be used to create an alias for a command to operate by another name (for example, being able to type dir and have ls –l performed).

  4. Environmental variables can be viewed with the env command.

  5. Variables can be added to the environment using the set command and export; they are removed using unset.

  6. The /etc/profile configuration file is executed whenever a user logs in.

  7. For those using the bash shell, the shell first looks for .bash_profile; if it does not file that profile, it looks for .bash_login.

  8. When the bash user logs out, the shell will look for .bash_logout and execute any commands found there.

  9. While other configuration files run only when the user logs in or out, the .bashrc file can execute each time a shell is run.

  10. Shell scripts must have executable permissions to run, or be called by a shell (for example: sh script). The normal exit status of any script or application is 0 and anything else signifies a non-normal exit.