Page 1 of 12 12311 ... LastLast
Results 1 to 10 of 117

Thread: NEW UBUNTU USERS: Becoming friends with the terminal...

  1. #1
    Join Date
    Oct 2005
    Beans
    693

    NEW UBUNTU USERS: Becoming friends with the terminal...

    For all the new people, just starting out on Ubuntu, if you're wondering why the people here tend to solve your problems using code rather than giving you directions, this short guide is for you.

    PART 1: What's the Terminal?

    A pretty good way of describing the terminal is a window into the core of your PC. What I mean by that is, with the right knowledge, you can modify ANY aspect of Ubuntu. If you're not sure what it looks like, open a terminal window now!

    Head to Applications, then Accessories, then "Terminal".

    Looks scary? Yes, it can be. To anyone but the experienced computer users among us, the terminal can seem way out of your depth. Luckily, when using Ubuntu, you barely need to touch it unless you are having problems and need to ask for help here. In the terminal, you will see your username as text, looking slightly like the format used in an email, for example:

    Code:
    name@name-desktop$
    
    or 
    
    name@name-desktop$
    Now, you're probably thinking this is a bit archaic. In this day and age, with windows, buttons and graphics, who on earth would want to use this?

    The truth is, the terminal is, with the right frame of mind, SIMPLER to use than navigating endless menus and selections. It is simpler because it is simply a faster way of doing things. It does things automatically for you. It is a friend, not an enemy. It wants to help you, as long as you give it respect.

    PART 2: Why does it help me?

    The terminal helps you because it allows people helping you to give you a standardised code to solve your problems. This means that whatever version of Ubuntu you use, this code will, in the vast majority of cases, work fine. So, rather than helpful forum members having to tell you to click "here, here, down here, right there, here, there, where, there", the code will do the whole thing for you.

    In fact, as a normal user who just wants to use his/her computer, you don't need to understand one bit of code. The vast majority of time, it's a simple copy and paste of what may seem like garbled nonsense, but it'll do the trick. Of course, it can help if you understand some of the lingo used, but by and large, you don't necessarily have to do all that much.

    PART 3: How do I add code to the terminal from guides on Ubuntu Forums?

    It's pretty simple. Select the whole of a line of code on the page, select the code (e.g click and drag the mouse), copy it (ctrl + C is fastest, but you can also right-click and copy from there). How do you know what a line of code is like? Most guides put them in quotes or code boxes, like this:

    Code:
    Hello!
    Please note that if you see multiple lines of code at once in a guide, copy and paste them one at a time.

    Once you've copied the line of code, go to your terminal window, and, if you have a middle mouse button, you can press it with the cursor hovering over the terminal window, and it'll appear in the terminal. If you don't, press CTRL + SHIFT + V to paste it. To run that code, simply press enter.

    Okay, let's give this a test drive!

    Here's the code you need for Ubuntu to check for updates to programs.

    Code:
    sudo apt-get update
    Copy this line of code, and paste it into the terminal. Then press enter. You should see something scary. You'll get a response like:

    Code:
    [sudo] password for (your name):
    In the terminal. The terminal is simply asking for your permission to do this. It's asking if you are really you, and not some random person. Enter your password - note that it gives no recognition that you're entering anything in, so if you think you've gone wrong, hold backspace down for a few seconds and re-enter.

    Press enter once you've entered your password.

    Boom... lots of code zooming past you now. What Ubuntu is doing here is going to all the addresses of all the software you use (provided you're connected to the internet) and asking if there's a new version available. If it asks whether you want to update (it'll have a Y/N option, Y being "Yes" and N being "No"), make your choice by typing Y or N. This command actually does exactly the same thing as the Update Manager found in System > Administration, except this method shows more detail. Remember, it's entirely your choice whether you use this method or open the program - you may, in time, find this method more efficient.

    So now you know how to copy, paste and run code from guides...

    PART 4: "Sudo"? Is that a new brand of soap?

    The answer is no. You may see this often in lines of code. It is a literal abbreviation of "SUper-user DO". Still confused?

    SUDO is the way of telling lines of code that this line of code is important, because it wants to do something which modifies the system (e.g install something, remove it). By entering the password for SUDO, you are effectively giving the terminal access to your whole PC for a temporary time. Remember that it is only you who can do this, as long as only you know your password. Why do we need SUDO? Because, unlike Windows XP, which gives you access to your PC all the time, Ubuntu only gives access to those who it can trust - you. You may, from time to time, especially when opening programs in the system menu, see a popup box asking for your password. This is also SUDO but in a popup rather than in the terminal.

    PART 5: Rogue commands

    Now you have some basic knowledge of the terminal, it is very important that you understand a particularly dangerous line of code. It is very powerful (and can be useful in a minority of cases), but as they say, with great power comes great responsibility.

    The name of this infamous and legendary command is:

    SUDO RM -RF /
    Do not run this command, ever.

    I repeat - never, ever run this command, unless you absolutely know what you are doing!

    I know this seems like scaremongering, there have been a few cases in the past of malicious users posting this code for people to copy and paste, especially in "guides" which aren't really that. I'd like to take this opportunity to explain exactly what it is about this command that makes it particularly nasty. Luckily for you, if you enter this code accidentally, it will give you one last safeguard - SUDO. Remember, in this case, SUDO is a guardian. It'll ask for your permission. Make sure that if you see this code, do NOT give your password. SUDO is one of the greatest security features ever added to an OS, but it cannot protect you from your own mistakes.

    One such mistake is if you have run a command using SUDO within 15 minutes previously. Ubuntu will allow commands to be run without you having to enter your password for up to 15 minutes after entering the first SUDO command. This means that if you accidentally enter this code, SUDO won't always be there to save you!

    Okay, here's a breakdown of what this command will do to your PC. You can find this information out for yourself if you want by typing:

    Code:
    man rm
    However, for everyone else, this is what the command will do.

    SUDO: Gives the code the permission to do anything to your PC, but remember, only with your permission first.

    RM: ReMove a file or multiple files (Can you guess where this is going?)

    -R Recursive - this option will remove any subfolders as well. For example, if you did RM -R /home/bob, then any folders contained within "bob" would be deleted too.

    F (part of -RF) - Force. This means that despite any protests by the system, this command has absolute power. It WILL be run, no matter what. It will not ask for any confirmation at all either.

    / By far the most dangerous bit of the command. Whereas

    sudo rm -rf /home/bob/downloads
    ...could be useful if bob wanted to get rid of his downloads folder for whatever reason, the "/" means EVERYTHING. every system file and folder you have. So, in summary, this command will trash Ubuntu, rendering it unusable when you restart. Note that, unbeliveably, you will still be able to use your PC until you restart - this is because everything is already loaded into memory. It is possible to recover files from your home folder by using a LiveCD, but everything else will have to be reinstalled. Not good.

    The best way to describe this nasty command is the 10-character code of death.

    _____________________


    Thanks for reading this guide - it was intended for the newest of new users, as I don't think there's much help given for people who are just starting out.
    Last edited by Mazza558; December 21st, 2008 at 12:22 PM.

  2. #2
    Join Date
    Oct 2007
    Location
    New Zealand
    Beans
    133
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: NEW UBUNTU USERS: Becoming friends with the terminal...

    Also become friendly with the user and groups management system
    there are apps out there that require the user to be part of a specific group i.e virtualbox.

    this has a nice gui and isnt too complicated

    if all else fails especially with folder access

    sudo chown

    should see you right

    PS: I love you mazza
    Last edited by Vitamin-Carrot; March 4th, 2008 at 12:55 AM. Reason: Spreading the love since ages ago
    If someone asks you to sudo rm -rf anything don't do it.

  3. #3
    Join Date
    Nov 2007
    Location
    127.0.0.1
    Beans
    138
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: NEW UBUNTU USERS: Becoming friends with the terminal...

    Nice guide! Considering that the gui is made for new people who are coming maybe you can also add the "Tab" buton as giving all the commands and "-help" after a command for more information about how to use it.
    Regards!
    Linux is like a wigwam - No Windows, No Gates, Apache inside!

  4. #4
    Join Date
    Aug 2007
    Location
    Manchester, UK
    Beans
    10,285
    Distro
    Ubuntu

    Re: NEW UBUNTU USERS: Becoming friends with the terminal...

    Good guide...might need a little work/addition, but so far so good

  5. #5
    Join Date
    Oct 2005
    Beans
    693

    Re: NEW UBUNTU USERS: Becoming friends with the terminal...

    Thanks for all the comments guys, I hope this helped someone

  6. #6
    Join Date
    Feb 2008
    Beans
    542
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: NEW UBUNTU USERS: Becoming friends with the terminal...

    Thank you mazza558,
    It is very nice of you to write this useful information.

  7. #7
    Join Date
    Nov 2007
    Location
    UK
    Beans
    288
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: NEW UBUNTU USERS: Becoming friends with the terminal...

    Nicely written, also remember that typing

    Code:
    man foobar
    Will show you the manual for the command 'foobar' (if it existed), replacing 'foobar' with any other command will show you the manual page. This is handy if you're trying to remember a particular option for a command, though some man pages are a bit dense, try reading the ones for rsync too early on and you'll never use the terminal again
    Last edited by Cadmus; March 4th, 2008 at 04:33 PM. Reason: Changed for clarity after Andavane's post

  8. #8
    Join Date
    Nov 2006
    Location
    Denmark
    Beans
    185
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: NEW UBUNTU USERS: Becoming friends with the terminal...

    I think this guide has a great potential as a common Terminal help guide.

    However only if you keep it updated and listen to fellow users ideas.

    /Astral-1

  9. #9
    Join Date
    Jun 2006
    Location
    Switzerland
    Beans
    Hidden!
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: NEW UBUNTU USERS: Becoming friends with the terminal...

    maybe add also a warning with regard to certain commands, especially:

    Code:
    sudo rm -Rf /
    And maybe also say how to find out more what a command does (reference to the man pages).

  10. #10
    Join Date
    Mar 2007
    Location
    England & India
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: NEW UBUNTU USERS: Becoming friends with the terminal...

    Quote Originally Posted by Cadmus View Post
    Nicely written, also rememeber that typing

    Code:
    man foobar
    Will show you the manual for the command 'foobar', this is handy if you're trying to remember a particular option for a command, though some man pages are a bit dense, try reading the ones for rsync too early on and you'll never use the terminal again
    Oooeerrr... When I type this I get:

    No manual entry for foobar
    Regards
    John
    a) Sony Vaio VGN-S3HP (12.04 Precise)
    b) Lenovo Thinkpad X201i (12.04 Precise) Dual-boot ī Windows 7

Page 1 of 12 12311 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •