What is a shell and why should I care?A shell is a computer program that presents a command line interface which allows you to control your computer using commands entered with a keyboard instead of controlling graphical user interfaces (GUIs) with a mouse/keyboard/touchscreen combination. There are many reasons to learn about the shell:
In this lesson you will learn how to use the command line interface to move around in your file system. How to access the shellOn a Mac or Linux machine, you can access a shell through a program called “Terminal”, which is already available on your computer. The Terminal is a window into which we will type commands. If you’re using Windows, you’ll need to download a separate program to access the shell. To save time, we are going to be working on a remote server where all the necessary data and software available. When we say a ‘remote sever’, we are talking about a computer that is not the one you are working on right now. You will access the Carpentries remote server where everything is prepared for the lesson. We will learn the basics of the shell by manipulating some data files. Some of these files are very large , and would take time to download to your computer. We will also be using several bioinformatic packages in later lessons and installing all of the software would take up time even more time. A ‘ready-to-go’ sever let’s us focus on learning. How to access the remote serverYou can log-in to the remote server using the instructions
here. Your instructor will supply to you the Each of you will have a different After logging in, you will see a screen showing something like this:
This provides a lot of information about the remote server that you’re logging into. We’re not going to use most of this information for our workshop, so you can clear your screen using the Type the word This will scroll your screen down to give you a fresh screen and will make it easier to read. You haven’t lost any of the information on your screen. If you scroll up, you can see everything that has been output to your screen up until this point.
Navigating your file systemThe part of the operating system that manages files and directories is called the file system. It organizes our data into files, which hold information, and directories (also called “folders”), which hold files or other directories. Several commands are frequently used to create, inspect, rename, and delete files and directories.
The dollar sign is a prompt, which shows us that the shell is waiting for input; your shell may use a different character as a prompt and may add information before the prompt. When typing commands, either from these lessons or from other sources, do not type the prompt, only the commands that follow it. Let’s find out where we are by running a command called Let’s look at how our file system is organized. We can see what files and subdirectories are in this directory by running
The command to change locations in our file system is Let’s say we want to navigate to the Let’s look at what is in this directory:
We can make the
Anything with a “/” after it is a directory. Things with a “*” after them are programs. If there are no decorations, it’s a file.
No one can possibly learn all of these arguments, that’s what the manual page is for. You can (and should) refer to the manual page or other help files as needed. Let’s go into the
This directory contains two files with Shortcut: Tab CompletionTyping out file or directory names can waste a lot of time and it’s easy to make typing mistakes. Instead we can use tab complete as a shortcut. When you start typing out the name of a directory or file, then hit the Tab key, the shell will try to fill in the rest of the directory or file name. Return to your home directory: then enter: The shell will fill in the rest of the directory name for Now change directories to
Using tab complete can be very helpful. However, it will only autocomplete a file or directory name if you’ve typed enough characters to provide a unique identifier for the file or directory you are trying to access. For example, if we now try to list the files which names start with The shell auto-completes your command to
Tab completion can also fill in the names of programs, which can be useful if you remember the beginning of a program name.
Displays the name of every program that starts with SummaryWe now know how to move around our file system using the command line. This gives us an advantage over interacting with the file system through a GUI as it allows us to work on a remote server, carry out the same set of operations on a large number of files quickly, and opens up many opportunities for using bioinformatic software that is only available in command line versions. In the next few episodes, we’ll be expanding on these skills and seeing how using the command line shell enables us to make our workflow more efficient and reproducible.
Which option represents the program that provides the user's command line prompt?A shell is a computer program that presents a command line interface which allows you to control your computer using commands entered with a keyboard instead of controlling graphical user interfaces (GUIs) with a mouse/keyboard/touchscreen combination.
Which command specifies the command line interpreter?Use the Command Line Interpreter adapter command ( -CL or -CLI ) to specify the command line interpreter used to execute the batch file or shell script.
Which item or file represents the location of the local group information?Which item or file represents the location of the local group information? /etc/group 4. Which item or file represents the location of the user's personal files? Home directory 5. Which item represents a number that identifies the group at the most fundamental level?
Which item or file represents the location of the user's password information?Most of the user account information is stored in the passwd file.
|