NOTE: This website is alive and growing.
Table of Contents
To understand this tutorial you need to have a very basic knowledge of Ubuntu Linux. Here are some concepts you can’t miss:
Filenames, extensions and paths
Every file is defined by a name, an extension and a path. Take as an example my video file masterpiece.dv that is stored in my Home Folder.
masterpiece is the filename, that is a sequence of characters that identifies a file. Filenames can’t contain the character /. For separating words in filenames you can use spaces, but if you do you’ll regret it: many command line applications would understand it as two different filenames. NOTE: You can use capital letters or underscores instead.
.dv is the extension and it refers to the format of the file. If you forget to use the extension some applications will get confused. Cinelerra always writes the extension automatically.
To know more about Unix filenames see linfo.org.
The path of the file defines its location in the file system. Basically it’s a sequence of folders contained one inside the other. The path of my file masterpiece.dv is /home/raffa/masterpiece.dv. In fact my file masterpiece.dv is contained in a directory that is my Home Folder (called raffa after my username). The directory raffa is contained in the directory home that contains the Home Folders of all the users of the system. The directory home is contained in the main directory, that contains the whole system and is called root.
I can show you the description of this location using the Graphical User Interface and Nautilus, the File Browser.
Clicking on the black little arrow on the left of the icon of the folder raffa, I can move to the parent folder home and to the root folder, that contains the whole filesystem, represented with a disk symbol.
Clicking on the pen-and-paper icon I can visualize the location as a proper path, that is a sequence of folder names, separated by a slash. Note that the name of the main folder is omitted. Thus root is represented simply by a slash /.
Terminal commands, absolute and relative paths
You can open a terminal by going to Applications → Accessories → Terminal.
Usually the Command Line (a line of commands in the terminal) is considered less user friendly than the Graphical User Interface (icons and graphical widgets to be used with a mouse). In fact the command line (CL) is better understandable by computers whereas the Graphical User Interface (GUI) is better understandable by humans. Since humans are more clever and flexible than computers, often using the CL gives better and quicker results.
When you open a terminal you get a prompt, that is a location and a flashing cursor telling you the terminal is ready to accept commands and the directory that will be affected by the commands.
In my example I get:
That is raffa (my username) working on raffa-desktop (my system name).
Commands can be typed or copied-and-pasted. They are activated with the ENTER key.
To know your working directory (the directory affected by commands) type the following command:
(it stands for Present Working Directory).
I get this output:
and my prompt back.
Sometimes on manuals and tutorials, you’ll find commands written like this:
To list the content of the working directory (my Home Folder in this case) you can use the command:
Video MakingOfAlbero.wav masterpiece.dv movie_01_01.mpg movie_01_02.mpg
Video is a directory.
The first command uses the full path and use root as the reference for location. It is an absolute path.
My prompt is now:
If I check my working location with
I get the absolute path of my working directory:
Copy and paste, Drag and drop
To copy and paste text in Linux is a pleasant experience: it’s just a two moves operation.
The absolute path of a directory can be copied and pasted in the terminal from the location field in the Nautilus File Browser window.
If you drag a file icon from the Nautilus File Browser window and drop it anywhere inside a terminal, you’ll get the absolute path of that file instantly written after the prompt. Similarly you can drag the directory icon from the location field of the Nautilus File Browser window.