OK, let's see. I was just wondering whether that opera file is right inside your home directory, not inside a subdirectory. It won't be found by your terminal if it isn't. The quick solution is to make sure it is in the proper place. But if you want to understand more, here is a little theory (be sure to try it out as you are reading this).
The terminal can't read your mind so it doesn't know which directory it is supposed to look in. By default, it searches only the user's home directory (in this case, yours). You can see that confirmed if you use the
(=print working directory) command, which makes the terminal tell you where it is located. Just type it into your terminal and it should return "/home/your_username".
If you need it to look elsewhere, whether it is a directory inside your home or some other location, you instruct it to do so explicitly. The command to use in that case is
Quote:
cd (=change directory) followed by the name of the directory in question
|
For example, if you have a folder called "Videos" or "Desktop" inside your home directory, you would use
cd Videos or
cd Desktop. If there is another directory inside one of those, you would add it. So if you have folder foo inside Movies, you would use cd Videos/foo. That is, if the terminal is still pointing to your home directory. If you have already moved to Videos (using cd Videos), you should use
cd foo (there isn't any Videos folder inside Videos after all - the terminal would object that it can't find any Videos/foo inside Videos).The prompt should show at any time where the terminal is located but, as pointed out, you can also use
pwd to find out. If there is a further folder inside foo, then you use cd Videos/foo/foldername (or cd foo/foldername, or cd foldername, depending on where the terminal is pointing to at the moment). I think that you get the pattern.
All of that applies to climbing
down directories, if you want to climb up, you use
which takes you up one level at a time.
Wherever your terminal is situated, it can be returned to your home directory at once with a plain
cd. Just give it a try:
Quote:
cd ..
pwd
cd ..
pwd
cd
pwd
|
Or a little more fancy:
Quote:
cd ..
cd ..
cd usr
pwd
cd local
pwd
cd
pwd
|
That also works from any subdirectory or your home.
So far I have discussed only
relative paths i.e. directories defined in relation to other ones (in this case, your home directory). There is another thing called an
absolute path, which is defined in terms of the root of your filesystem. In order to understand this concept, you should click on the Computer icon on your desktop. The "Filesystem" icon stands for the root of your filesystem, also represented as "/". All the other directories branch out from it, directly or indirectly. Thus if you click on "Filesystem, your are presented with a first level of directories that sit on top of root (/home is one of those). If you click on any one of those, you get a further level of directories, which sit on top of that one directory that sits on top of root (e.g. your personal home directory if you click on the home icon). You can go on clicking around until you reach a directory that hasn't got any further subdirectories. Now, here is where the
absolute path comes in. You can define a location relative to root. For example, you can move from anywhere in the filesystem to Videos with one command:
cd /home/username/Videos
That one command can be analyzed as:
First move to root:
cd /
then to its home subdirectory
cd /home
and from there to your home directory:
cd /home/your_username
and further
cd /home/your_username/Videos
and so on.
Absolute paths are really convenient for traveling quickly from one branch of root to another one. If you were inside your home directory and you needed to move to, say, /boot/grub in order to edit your grub configuration file, you could use a relative path but that would take many steps:
first move up to /home: cd ..
then up from there to the next level up (/): cd ..
then from / to boot: cd boot
and from there to grub: cd grub
That is four commands, when you could have used only a single one by using an absolute path:
cd /boot/grub
As you can see, the distinguishing feature of absolute paths is that they all start with a slash - relative ones don't.
Bear in mind that Linux is case sensitive. If something has a capital, then that's exactly how it should be typed or it won't be found. But luckily, folder names can be completed using the tab key.
Now for another command: ls (=list segments), which shows the contents of a directory. A plain ls will show the contents of the directory that your terminal is pointing to, an ls followed by a path (relative or absolute) will show the contents of the specific directory in question (e.g. ls /usr or ls Desktop). Like so many commands, ls has all kinds of options that you can add to get even more information. Thus ls -l will show extensive information about the files in a directory, ls -a will show hidden files as well, ls -al will do both. You can find more information about your options by typing commandname --help or man commandname into your terminal. Clearly, if you bring up your terminal and you type ls and it does not show your opera package, then it is not right inside your home directory. In that case you either make sure that it is or you use the terminal to cd to the proper location. Both work just fine.
OK, I hope that you now understand a bit better. It will save you a lot of frustration in the long run. But if you are lazy (so am I a lot of the time), you should install nautilus-terminal (sudo aptitude install nautilus-terminal). It will add an "open in terminal" entry to your contect menu that automatically points to the directory where it is opened so you never have to do any of that cd stuff anymore (although it doesn't work for Desktop for some reason).