Terminal?

Discussion in 'macOS' started by rooster676, Sep 2, 2009.

  1. rooster676 macrumors newbie

    Joined:
    Apr 4, 2009
    #1
    I really would like to learn to use the console and terminal on my macs-
    do any of you know of a good manual, book or otherwise that could serve as a guide? I am hesitant to simply fumble around and learn that way (which is how I've learned everything else) because it is my understanding that one can do serious damage when playing around in terminal!

    thx D
     
  2. broken-chaos macrumors regular

    broken-chaos

    Joined:
    Sep 2, 2009
    Location:
    Toronto, Ontario
    #2
    OSX uses a very standard Unix shell called Bash. Basic usage shouldn't do too much harm (except hapless wielding of the 'rm' command), and you can find many simple guides if you Google for basic shell usage or beginner bash tutorial (or other similar things).

    You'll find a lot related to Linux or other Unix variants, but most of what you learn in those will be applicable in very similar ways to OSX. Two of the most notable differences are in the directory structure (OSX stores user files under /Users, not /home, for example), and the existence of some Mac-specifc commands like the awesome 'open' command, which will open any file or directory you tell it to as though you opened it from the Finder.
     
  3. keatonEC macrumors newbie

    Joined:
    Feb 14, 2009
    Location:
    Calgary
    #3
    this might sound like a newb thing to say.. no im not going to as what terminal is.. i was wondering what you actually use terminal for. jus for coding or designing apps or what? :confused:
     
  4. Some Guy 555 macrumors regular

    Joined:
    May 26, 2009
    #4
    I can answer this question perfectly for you since I am taking second year University classes in computer science.

    I am fairly proficient in using the unix command line, but this book is VERY useful for listing almost ALL commands and how to use them (even with examples and what parameters they take).

    https://www.usask.ca/consumer_services/bookstore/store.php?item_key=40000082315&search_type=class

    Also, if you want to know how to use a command type this:

    man command where "command" is any command that you are unsure on how to use such as: grep, sudo, shutdown, ls, etc.

    using "man" brings up "manual" pages that are 10-30 pages long for each showing typical usage, parameters, different modifiers to be used with the command, and system usage as well.


    Here is a few basic commands for you to help you "navigate" through your directories (which is what finder does, except with a gui).

    1. ls lists current directories that you can go to (and files) in your current directory.
    2. cd directory changes your current directory (where you are) to "directory" (change directory to what you want to go to if its listed from "ls" such as "documents".
    3. mkdir directory make directory, where directory is the directory that you want to make.

    There are many many more that I can show you (hundreds), but I don't think that would be very pleasant to read through, best to be done at ones own pace :D
     
  5. broken-chaos macrumors regular

    broken-chaos

    Joined:
    Sep 2, 2009
    Location:
    Toronto, Ontario
    #5
    It can be used for a wide variety of things - depending on what programs you use in it. Under OSX, most people use it for advanced system configuration or for some programs commonly used by developers (such as version control systems that don't have a graphical interface).

    In other OSes (and sometimes on OSX, if you really want to!) it can be used for nearly anything, such as file management, editing, IRC, web browsing (not commonly, but possible!), and many, many other things. Old OSes used to have an interface like the Terminal as the only way to do anything.
     
  6. Some Guy 555 macrumors regular

    Joined:
    May 26, 2009
    #6
    Lets say you want to relocate 10 folders inside "documents folder" to somewhere else. Normally you would have to either move each one individually with 2 finder windows, or move them all with selecting each and then moving using GUI (finder).

    Now the command line (terminal) can do this in one simple command.

    Moving 10 folders inside documents to the parent directory of ducuments (your home folder):

    Code:
    [B]mv folder1 folder2 folder3 folder4 folder5 folder6 folder7 folder8 folder9 folder10 ..[/B]
    
    Moves all those folders (there actual names to the previous folder, hence the ".." move up directory command.

    Much faster than using a GUI and that is only the tip of the iceberg of what command lines can do. Basically everything graphical uses the command line, it is just a front end to terminal so that you can just "click here or there".

    BTW: I am unsure if that command above works, I do know this works:

    Code:
    [B]mv folder1 ..[/B]
    
    The above moves folder1 up a directory.
     
  7. MadGoat macrumors 65816

    MadGoat

    Joined:
    Jul 30, 2007
    Location:
    Canada
    #7
    I'm not telling that terminal is like a dos prompts on steroids that you use to type in everything from ls(to get a direrectory listing) or rm (to remove stuff)

    If I told you that, that would be a newb thing to say :)

    But, Sure you could code using Vi and compile everything using gcc.
     
  8. Some Guy 555 macrumors regular

    Joined:
    May 26, 2009
    #8
    Vim is awesome, glad someone else actually (possibly) uses it besides me... :)
     
  9. broken-chaos macrumors regular

    broken-chaos

    Joined:
    Sep 2, 2009
    Location:
    Toronto, Ontario
    #9
    MacVim!

    I prefer it slightly over the terminal variant, but I use both nearly equally, depending on what I'm doing at the moment.
     
  10. rooster676 thread starter macrumors newbie

    Joined:
    Apr 4, 2009
    #10
    Thank you everyone for the great info!

    I know it seems like I posted the question and went AWOL- but no, just took me til now to come back and I really REALLY appreciate all of the great info you all posted. and looks like some other folks learned something too, so its all good.

    I will try all of the stuff you suggested, and thanks esp. for the linux primer!

    I will have to take linux next year, so from what you all are saying, this will pretty much be the same....


    rooster:)
     
  11. Zerozal macrumors 6502

    Joined:
    Apr 3, 2009
    Location:
    PA
    #11
    Learning UNIX for Mac OS X

    I went through the Panther version of this book when I had Leopard and learned a lot. I looks like "Tiger" is the most recent version of the book, but the UNIX commands don't change very much over the years, so this would still be a great book to get your feet wet in Terminal, even in 10.6.
     
  12. old-wiz macrumors G3

    Joined:
    Mar 26, 2008
    Location:
    West Suburban Boston Ma
    #12
    And of course if you just go into terminal and start fooling around with commands, especially sudo, you can cause all kinds of weird problems that are extremely difficult to fix.
     

Share This Page