- Ubuntu is a Debian-based system.
- Everything in Linux is considered a file. There aren’t any weird registries or odd databases.
- Every file has a set of permissions that determine who can read, write, and execute code in reference to the file. Here is a very thorough tutorial on Linux File Permissions.
- The tilda (~), points to your home directory. Your home directory is where you would store your pictures, songs, documents, code, etc. Very similar to the C:\Users\<username> directory in Windows 7.
- In Ubuntu, every time you start a new terminal, the script file (.bashrc) in your home directory is executed.
- There is a ton of free software you can download through the Ubuntu Software Center. In Ubuntu 12.04, the Software Center can be accessed through the icon that looks like an explosion coming out of a bag.
- In Ubuntu 12.04, there is a great search feature that helps you find files and applications within your operating system by click on the “Dash Home” icon.
Let’s get started with some command line operations.
- Using your keyboard, hold down the CTRL, ALT, and T keys simultaneously (i.e. CTRL + ALT + T). This should have opened a new terminal window, where your user name, the computer’s name, and “$” sign should have been printed. From this point onward, text that I want you to type will be presented like this…
Where the “$” sign is not typed by you, but you would type “pwd” and hit the ENTER key on your keyboard.
- In fact, try it! Type pwd and hit enter. Something like “/home/username” will be printed to the screen. pwd stands for “Present Working Directory.” When you start a new terminal, it starts in your home directory.
- To see what files and folders are in your home directory, type:
Which stands for “list” (the contents). You will see folders for Documents, Music, Pictures, Desktop, etc. printed to the screen.
- Let’s create a directory.
$ mkdir test
This will make a new directory called test at the current location. Try ls again to see that you created the directory correctly. It should be noted that just typing ls doesn’t show what are called hidden files. Some hidden file start with a period (.), which are usually configuration files and some other hidden files end with a tilda (~) to denote a backup file. In order to see ALL the files in the current directory type:
$ ls -al
- Let’s change directory (cd) into our newly created directory:
The ./ portion of our command refers to, “the current directory.” So by typing, “./test” it infers that the “test” directory is located within the current directory. Now type:
to verify that you moved into your newly created directory, which will display something like:
- Now, change back to the home directory by typing:
$ cd ..
The double periods (..) refers to “up” one directory. You can string these double periods together to move up several directories in a single command.
$ cd ../../../
You can also change back to the home directory by using the cd command with the tilda (~)
$ cd ~
- You can quickly print the contents of a directory with the use of the TAB key. This can be especially useful when trying to browse files and directories via command line. Let’s try to browse some files in the Linux system folders. The top-level directory or “root” directory in your Linux system is the singe slash ( / ). That’s without a period. Let’s change to that location and list its contents.
$ cd /
Some of the directories that are listed are very important to the Linux operating system. Some of them are:
- bin – (binaries) binary executables
- dev – (devices) access point for device drives (hard drives, mouse, keyboard, joysticks, monitors, etc.)
- home – directory that holds each user’s home folder
- opt – (optional) location that holds user installed programs
You can find out more about the individual folders here: TuxFiles
Let’s use the TAB key. Type (without ending with the ENTER key):
$ cd /home/
Now hit the TAB key. The TAB key will autocomplete from what you have typed already or print out the possible options. Experiment with this.
- Let’s install some software using Ubuntu’s great package management. In order to install software you need to have sudo (kind of like admin) privileges, and you should sudo privileges since you installed this operating system. In order to run a command as sudo, just type sudo before a command and enter the root password when prompted:
$ sudo apt-get update
This command used Ubuntu’s package management to check for software updates.
- Now let’s install my favorite text editor: emacs. Which is a controversial topic.
sudo apt-get install emacs
You might have to type the letter “y” to say yes to downloading the software.
That should be enough information to get you started working at the command line. As I think of more things, I’ll add them. You should move along with the rest of the tutorials and start with installing MOOS.