1 Introduction to the shell command line
2 Introduction
2.1 What is the shell?
The shell is a command-line interface (CLI) program that allows users to interact with an operating system’s services, applications, and utilities. The shell is an interface between the user and the kernel, which is the core of the operating system.
There are several different types of shells available, including the Bourne shell (sh), the Bourne-Again shell (bash), the C shell (csh), and the Korn shell (ksh). Each shell has its own set of features and syntax, but they all share the same basic functionality of providing a command-line interface for users to interact with an operating system.
2.2 How to access the shell
You access the shell using the “terminal”. The terminal is a window into which we will type commands in. The terminal is already available on Mac and Linux. For windows you must download a separate program.
2.3 Starting with the shell
We will spend most of our time learning about the basics of the shell by manipulating some experimental data from a hearing test.
2.3.1 Making a new directory
First, we’re going to create a new directory to work in using the command mkdir
which stands for “make directory”.
The word “directory” a location for storing files on a computer and it is synonym to “folder”.
To create the directory, we must type the following command in the terminal and hit return to execute the command.
mkdir training
2.4 Arguments
Most commands offer additional arguments that control their exact behavior. For example, -F
and -l
are arguments to ls
. The ls
program, like many programs, take a lot of arguments. But how do we know what the options are to particular commands? We can consult the manual!
2.5 Manuals
We can consult the manual using the following:
man ls
To exit the manual, hit the q
key to “quit”.
Every single command has its own manual. Earlier, we used the command cd
and we can also consult the manual for mkdir
:
man mkdir
Programs that are run from the command line can be complex. To see an example, open up the manual page for the find
program. No one can possibly learn all of these arguments, of course. So you will probably find yourself referring back to the manual page frequently.