What is a Shell
A shell is a tool we use to interact with a computer. It is pretty powerful. There are a few basic commands that will help you navigate the computer using a shell.
Frequently Used Shell Commands
ls is a command that lists all files in the current directory. If you had a directory that had three files in it, file1.txt, file2.txt, and file3.txt, and you ran ls, you would see something like:
cd is a command that changes what directory you are currently in. If you are currently in directory A, and want to go up one level, you would use ‘../’ as the directory you want to change to. For example, if you have a folder called ‘Downloads’, you could access that directory contents by running cd Downloads:
mkdir is a command that creates a new directory. For example, to create a new directory called ‘files’ you would run ‘mkdir files’ as seen here:
nano opens a file in the nano text editor. If you want to create a file, you can run nano to create that file, and open it.
We can see a demo of nano in action in the below demonstration.
cat prints the contents of a file. If we have a file named ‘file.txt’ which contains the words ‘this is a file’, we can see its contents using cat.
rm is a dangerous command. It removes files. If we have a text file named ‘file.txt’ we can remove it with rm:
Here is a short demo making use of all of these commands.