1

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.

terdon
  • 100,812
  • 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 06 '14 at 09:02
  • hi Jacob, in answer to your query, i want to do both – bomberns127 Sep 06 '14 at 09: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 06 '14 at 09: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 06 '14 at 09:24
  • I've read what you've written, but what have you actually tried? Copy the exact command so can find what is wrong! cd ~/Desktop will take you to the current users desktop. – Alvar Sep 06 '14 at 09:29
  • The -1 usually doesn't relate to the subject of your question, but the way you ask it. Provide the necessary information, otherwise no one can be helpful. – Kalle Richter Sep 06 '14 at 10:10
  • @bomberns127 After attempting something in the Terminal that doesn't work the way you want (and that you want help with), I recommend selecting all the text in the Terminal (Ctrl+Shift+A or Edit > Select All), copying it to the clipboard (Ctrl+Shift+C or Edit > Copy), [edit]ing your question, and pasting the copied Terminal text into your question. You can then select it and press Ctrl+K (or click <$> on your editing toolbar) to format it as code so it's readable). This should better clarify what commands you're running and what's happening as a result. – Eliah Kagan Sep 06 '14 at 11:45
  • Since you mention DOS, my guess is you are typing the name of the directory wrong. Unlike DOS, Linux is case sensitive. That is, Documents, documents, and documenTs are three different directories. – user68186 Sep 06 '14 at 12:23

2 Answers2

3

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
Jacob Vlijm
  • 83,767
0

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