unix terminal tutorial
Register

We are the best invite forum on the internet! Here you will find free invites, free seedboxes, free bonuses, and much more. Our members know the true meaning of sharing and have created a truly global bittorent community! Our site has the most up to date information on all private trackers and our members will guide you and introduce you to this truly secretive and enlightened club. Ready to get started? Register now!


Results 1 to 4 of 4
  1. #1

    Join Date
    Aug 2010
    Posts
    32

    Default unix terminal tutorial

    Welcome
    Hi, and welcome to my little tut on the linux terminal. I'm not even close to being a pro, so I apologize in advance if I mess up. I'm writing this tutorial with Ubuntu 10.4 Lucid Lynx.


    Commands sent to the console will have a
    quotation box
    Whatever the terminal shows/spits out will be in italics.


    I'm not sure why, but most *nix beginners tend to stay away from the terminal (I did, anyway)! But hey, you'll learn that its not that bad after all.

    Getting Started
    Ok. To get started, goto: Applications -->Accessories-->Terminal.


    Now, a terminal will pop up. It's easy to get intimidated, but don't get scared—it's easy. You should see a blinking cursor. Before that cursor, you probably see:



    yourName@ubuntu:~$

    Our first command
    Let's try something simple. Type
    pwd
    Good job! You just completed your first command in the console! (it wasn't that bad, right?)


    After typing “pwd”, you'll see that the terminal says something. It should say:
    /home/yourName


    This represents where you are. When you navigate graphically, you click, right? You double click on the folders that you wanna go into. Similarly, you move around in the terminal by issuing commands to the console. Let's try another.

    ls and hidden files
    Type:
    ls
    Your terminal should give you (most) of the folders/files that it can see in /home/yourName. For me, it has stuff like:
    Desktop Downloads Music Programming Videos Documents
    …etc


    However, we're not seeing the whole picture. Some files are hidden! To see those, type this:
    ls -a
    Whoaa! My whole screen filled up with more items! You should see stuff like .compiz, .evolution, .gconf, .mozilla, .bash_history, .bashrc
    …..etc

    Text Editing!
    Let's edit .bashrc. There are two ways to play around with this file. Let's first try vi/vim. Type
    vim .bashrc
    (note: if this doesn't work, type vi .bashrc)


    Now, you'll see some REALLY random stuff! All you are seeing is some code in bash. The weird thing about vi/vim is that you can't edit right off the bat (wouldn't recommend anyway, lol). Try it, if you don't believe me! Type f, or g, or h. Nothing happens! This is because you are in command mode. To edit stuff, you have to be in insert mode. Type “i” to enter insert mode. Now you can edit stuff. Anyway, don't be discouraged if vim feels weird. I'm learning it too. To exit insert mode, press Escape. Ok. We are going to quit without saving changes. To do this, type
    :q!
    After you type the semicolon, you should see what you type in the bottom left corner, like this:

    Press enter. This will quit the file you were editing without saving any changes you made. To save changes, you would type
    :wq
    If vim intimidated you, don't worry! There's nano too. Try this:
    nano .bashrc
    You should be more comfortable. You can move around and edit from the beginning. It's a lightweight but powerful text editor. To quit, simply press Control-X. If it asks if it wants to save changes, just hit N for “no.” See? Nano aint that bad, right?


    Shortcuts and Autocompletion
    Let's play around some more with the terminal. Type
    ls
    You know this command. It shows the files/directories you can access. Now, we will change directories with the cd command. Type
    cd Downloads
    You'll move into the Downloads folder. Check if you've really gone into it by typing
    ls
    again. Does it look different? Nice! You've successfully changed directories! Let's go back to the previous folder. We can do this the fast way or the slow way. Let's do it the slow way first. Type
    cd /home/yourName
    This'll transport you back to where you where. Ok let's go back to Downloads. Type
    cd Downloads.
    Ok. Now, type
    cd ..
    (two dots). And... you're back to your previous directory. Pretty cool huh? There's also a quicker way to go to the Downloads folder too. Ok. Type this:
    mkdir gooper_hash.99_pzxxs
    What this command does is create a directory with the name that we provided. It's pretty disgusting, huh? Sometimes, you'll get files that are just plain annoying to type. So, there's something called autocomplete. Type
    ls
    to make sure that the gooper directory exists. Ok. Now, type "goop" (w/o quotes) then press Tab. Then boom! The terminal should do all the work for you. Awesome, right? Ok, so, to go to Downloads (make sure that you are at /home/yourName), type
    cd Dow
    then press Tab. It should autocomplete.




    Wrapping up with something fun :laugh:
    The terminal is fun, no? Ok. Let's wrap up with something fun! Let's say that you're torrenting (or whatever) and you want your computer to shut off at 3:30 in the morning to save electricity after Dling/seeding for a couple hours. You can do that in the terminal easily! Type
    sudo shutdown -P timeInMinutes
    Replace "timeInMinutes" to how many minutes you want your machine to wait until shutdown. So, if its 12:00AM right now and I want a shutdown at 2:30AM, I would type
    sudo shutdown -P 150
    The "-P" flag will tell the computer to power off. If you typed
    sudo shutdown -r 5
    your computer will restart in 5 minutes. The terminal will then prompt for your pass. Simply type it in. I really hope I did the math right. Please correct me if I'm wrong (the 150 minute one).

    Fin
    And that's it! You have successfully mastered the basics of the terminal! Congrats!
    :laugh:
    Last edited by Osource; September 5th, 2010 at 10:32 PM. Reason: aesthetic changes


  2. To remove ads become VIP. Inquire about advertising here.
  3. #2

    Join Date
    Jul 2010
    Posts
    793

    Default

    This should help beginners like me embrace the power of CLI. I was a bit uncomfortable with vim. So I used nano/gedit. I will try to familiarize it though. I am glad I moved my torrenting to CLI.

  4. #3

    Join Date
    Jan 2010
    Posts
    133

    Default

    Nicely explained :)
    One remark though, it's not unix terminal like stated in topic name, and commands differ of course, not too much but they do :)
    Unix is completely different osys .

  5. #4

    Join Date
    Aug 2010
    Posts
    32

    Default

    Quote Originally Posted by Sidithuss View Post
    Nicely explained :)
    One remark though, it's not unix terminal like stated in topic name, and commands differ of course, not too much but they do :)
    Unix is completely different osys .

    Noted. Thanks for the clarification.

Similar Threads

  1. [BSD Unix] Accessing external drives through terminal
    By SunSpyda in forum Operating Systems
    Replies: 6
    Last Post: March 27th, 2009, 01:12 PM
  2. New Tutorial Competition. Prize: SuperTorrents.
    By Elonoir in forum Competitions
    Replies: 21
    Last Post: March 17th, 2009, 03:30 AM
  3. Beginner Sig [Tag] Tutorial..FOR BEGINNERS!
    By KlassicKool in forum Miscellaneous
    Replies: 3
    Last Post: September 11th, 2008, 04:21 AM
  4. Place tutorial board under Couch.
    By Elonoir in forum Suggestions
    Replies: 0
    Last Post: August 31st, 2008, 03:02 PM

Tags for this Thread

Posting Permissions

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