I have been googling how to use the terminal in Ubuntu 14.04. Many years ago, I could find my way around DOS, albeit I'm a bit rusty. It seems that it's basically similar but when I try to change directory all I get is no such file or directory. This happens on every cd command I tried.
I even followed youtube videos and still no joy. Is there an app I need to install first?
I want to install tarz files I have downloaded but I still want to be able to use the terminal for other things.
2 Answers
Handling directories in the terminal
if I open a terminal, this is what I see:
jacob@jacob-System-Product-Name:~$The terminal initiates from a directory, which you don't see in the prompt. In most cases it is the current user's home directory. This home directory is part of a bigger tree that starts in / (the "root" directory). to see what is the current directory, type in the terminal:
~$ pwdmy result is:
/home/jacobOnly if I cd to another directory which is directly below the current directory (a subfolder), I do not need to include the current directory:
~$ cd Downloadsworks:
~/Downloads$ (which is in fact: /home/jacob/Downloads)However, in any other case I need to use the full path. for example when I want to cd ("sideways") from the Downloads folder to the Dropbox folder :
~/Downloads$ cd Dropbox
bash: cd: Dropbox: Bestand of map bestaat niet (saying it does not exist)But when I use the full path
~/Downloads$ cd /home/jacob/Dropbox
~/Dropbox$It works.
The easy way to work with files and directories
To easily cd to another directory, simply open a terminal window, type cd and drag the directory from a nautilus window's bar over the terminal window:
gives you:
Similarly, you can drag a file over the terminal window to include its full path (gnome-terminal).
Using the tilde (~)
Another way to reduce the amount of "typing work" is to use the tilde instead of typing out your home directory. An example:
instead of:
/home/jacob/Downloads/somefileI can use:
~/Downloads/somefile Typing 'ls' is handy because it lets you know the name of the directory under linux. Also remember that, if your directory / file name contains spaces, then use the forwardslash. For example My\ Documents. If you want to copy/paste you can too - just remember that in most terminal programs it's control+shift+c and control+shift+v.
As far as untarring files - tar.gz and tar.bz2 are just compression formats - like zip. You can use a program called 'Archive Manager' to unpack them, but if you want to use the command line you can use the following commands (for the different types of tar files):
tar xzf filename.tar.gz
tar xjf file.tar.bz2Hope that gets you started. I've learnt a lot from searching askubuntu for my specific question, as well as forums, friends, and blogs. I highly recommend 'It's FOSS' and OMG Ubuntu, which both have great tutorials. It's FOSS especially has an awesome community.
Welcome to Linux. I hope you have fun =).