Terminal tricks

Discussion in 'Mac Help/Tips' started by Liamcow, Nov 14, 2002.

  1. Liamcow macrumors member

    Joined:
    Jun 16, 2002
    Location:
    Hyannis, MA
    #1
    If anyone who knows ANY terminal coding, just drop it into this thread please? I really want to learn some more about terminal, but i can't find any resources ANYWHERE... so if you know a terminal code, just tell me please... and a description of what it does would be nice, also.
     
  2. macktheknife macrumors 6502a

    macktheknife

    Joined:
    Jan 24, 2002
    #2
    I'm learning some Terminal code too, but my knowledge is so basic that passing them on would be like the blind leading the blind. :) However, if you really want to go hardcore in learning Terminal, check out "Mac OS X Unleashed." The +1,000 page door stopper is filled with info on getting the most out of Terminal. I've placed an order for the 2nd edition that's coming out in December.
     
  3. lmalave macrumors 68000

    lmalave

    Joined:
    Nov 8, 2002
    Location:
    Chinatown NYC
    #3
    Terminal just gives you access to the Unix command line. In terms of programming, you can write and execute programs in just about any language including Perl, C/C++, Java, etc. I know there is a new book out called "Mac OS X for Unix Geeks", but I think it is more geared to folks that have used Unix extensively already. I would try to find a beginner's guide to Unix. In Mac OS X you should be able to do anything that is covered in an Intro to Unix book.....
     
  4. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #4
  5. macktheknife macrumors 6502a

    macktheknife

    Joined:
    Jan 24, 2002
    #5
    When people speak of the "home" directory in OS X, are they referring to the top directory or the /Users/<user name>/ directory? Stupid but simple question. Thanks.
     
  6. stromie952 macrumors regular

    Joined:
    Apr 22, 2002
    Location:
    Rochester, NY
    #6
    The home directory is your /Users/<user name>/ directory.

    I believe your main directory "/" is called the root directory

    Hope this helps
     
  7. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #7
    Yes. They should really speak of a home directory or your home directory, not the home directory, since there is one for every Mac OS X user you define.
     
  8. Liamcow thread starter macrumors member

    Joined:
    Jun 16, 2002
    Location:
    Hyannis, MA
    #8
    Thanks!

    OK, cool, I'm definately ordering that book before we start C++ in school....
    I figured out a more specific code question, I've gotten so far as to know basic ssh-ing, and I know it would be useful to retrieve files from my computer while working on my webpages.... I don't really want to do anything tricky because I hear you can really fudge up the computer you're going into...If anyone could tell me some things to do AFTER the getting-into-computer part of ssh?

    Basically, I just need to know what'll f**k up my computer, and what will be of use.... I probably don't make any sense at all... :confused:
     
  9. Over Achiever macrumors 68000

    Over Achiever

    Joined:
    Jul 22, 2002
    Location:
    Toledo, OH, formerly Twin Cities, MN
    #9
    Re: Thanks!

    Just remember, when you think you f**ked up your computer, run fsck -y :D
     
  10. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #10
    fsck ("file system check") is for repairing structural damage to a file system, which might result from a crash. (Unless you use the new journaling feature!)

    The more likely trouble you'd get into playing with the CLI (command-line interface) wouldn't be repaired by fsck. For example, if you delete or move a file that is critical to the operating system, you might not be able to boot or run your applications and fsck wouldn't help. You might need to restore from a backup or reinstall Mac OS X.

    The command-line power of all Unix variants, including Mac OS X, comes from the ability to combine dozens of powerful commands in any way you can think of. That power is the beauty and also the danger. You can, for example, use a single command to scan a directory and its subdirectories for files with extension .txt that were created in the last two days and contain the word "poiuyt", sort the list by filename, create a tape archive (tar file) out of them, compress the tar file, and store it somewhere. On the other hand, you can just as easily wipe out all the files in the /System/Library folder, trashing Mac OS X in the process.

    You are more likely to stay out of trouble when you confine your activities to files in directories (folders) that you create yourself or when you play with applications and files that you can reinstall or recreate if necessary.

    The same goes with using shell scripts, AppleScripts, C++ programs, etc. You'll gradually learn to use your superpowers for good instead of evil!
     
  11. cb911 macrumors 601

    cb911

    Joined:
    Mar 12, 2002
    Location:
    BrisVegas, Australia
    #11
    what's this new journaling feature? i've never heard of it. how new is it? 10.2, 10.2.2?

    also wouldn't it be a good idea to partition your HD before you try any stuff like that? then you could have a seperate system folder on another partition and it would be very easy to recover from a completey disastrous situation.

    a website that has some UNIX, Terminal stuff is http://www.osxfaq.com/

    :)
     
  12. edesignuk Moderator emeritus

    edesignuk

    Joined:
    Mar 25, 2002
    Location:
    London, England
    #12
    Yup, it's part of 10.2.2, you can read more about it in this thread where it was discussed quite a lot.
     
  13. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #13
    Unix In A Nutshell

    A really good Unix stariting point. Will teach you how to use the shell and some of the more funky stuff you can do with it. Indespensible where I work (using Unix all the time on Solaris).
     

Share This Page