This question already has an answer here:

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.

marked as duplicate by Alvar, karel, Eliah Kagan, Radu Rădeanu command-line Sep 6 '14 at 12:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    I am trying to figure out what is your main question. Is it handling directories in the terminal or installing from .tar.gz files? – Jacob Vlijm Sep 6 '14 at 9:02
  • hi Jacob, in answer to your query, i want to do both – bomberns127 Sep 6 '14 at 9:07
  • in response to Alvar and KasiyA i already followed the directions on that webpage and guess what? nowhere, i even just tried to simply change directory to the desktop and nothing, even tried to downloads and nothing, still get no such file or directory, so thanks for the -1 helpful – bomberns127 Sep 6 '14 at 9:14
  • 1
    @bomberns127 - add the exact commands you are using into your question - remember keep editing your question with new information. "Complete newbie" is not a question - please formulate your post to be a question and remember to format your text - big blocks of text are hard to scan and thus dont really get peoples attention. – fossfreedom Sep 6 '14 at 9:24

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:

~$ pwd

my result is:

/home/jacob

Only 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 Downloads

works:

~/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:

enter image description here

gives you:

enter image description here

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/somefile

I 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.bz2

Hope 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 =).

Not the answer you're looking for? Browse other questions tagged or ask your own question.