• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Reply to: Mac Terminal help

Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Mac Terminal help"

Collapse

  • petergriffin
    replied
    Originally posted by scooby View Post
    Not sure what you mean mate? it's a manually typed command, not a script. (sorry, new to the Mac terminal...)
    If you want to know if a particular command is a shell script or a proper binary you can use 'which' and 'file':
    Code:
    bash-4.2$ which firefox
    /usr/local/bin/firefox
    bash-4.2$ file /usr/local/bin/firefox 
    /usr/local/bin/firefox: symbolic link to `/opt/firefox/firefox'
    bash-4.2$ file /opt/firefox/firefox
    /opt/firefox/firefox: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped
    Code:
    root@local:~# which slackpkg
    /usr/sbin/slackpkg
    root@local:~# file /usr/sbin/slackpkg 
    /usr/sbin/slackpkg: POSIX shell script, ASCII text executable
    EDIT: the above was done on Slackware, on the Mac you'll have different results of course.

    Leave a comment:


  • Sysman
    replied
    I've got the O'Reilly Sed and Awk which is quite comprehensive (Second Edition which came out in 1997 - don't suppose much has changed; it was the equivalent of 25 quid then).

    The BBEdit folks reckon that Chapter 8 of their User Manual is good for learning regular expressions. PDF available from the BBEdit Support Page. BBEdit is the paid version of TextWrangler, with a pile of extra goodies that folks obviously find worth the price.

    Leave a comment:


  • Platypus
    replied
    Originally posted by Sysman View Post
    I'd still get a grounding in Sed and Awk though in case you come across them in existing scripts and examples
    Man pages for sed and awk are indecipherable IMO. But this book is excellent:
    http://www.amazon.co.uk/sed-Nutshell...6576757&sr=8-1

    I'm not sure that awk is used very much these days, perl seems to be prevalent now.

    I'm surprised it's £20 though

    Leave a comment:


  • Sysman
    replied
    Originally posted by bobspud View Post
    the other cool way to learn unix commands is to cd into the directories /usr/bin and /usr/sbin and run the ls command

    now look at all the commands and pick several per day and read the man page for them

    for instance for a starter i would look at
    man ls
    man ifconfig
    man grep & zgrep
    man awk
    man sed

    Although Sed and Awk are redundant because you have perl installed and it has far better pattern and string manipulation

    (stands back and waits for a holy war to start!)
    I'd still get a grounding in Sed and Awk though in case you come across them in existing scripts and examples.

    Man reading tip: If you find it hard work scrolling back and forth in the man utility , look for their web equivalents:
    Mac OS X Manual Pages
    Yet another way to read beautifully formatted man pages
    Last edited by Sysman; 9 May 2012, 13:52.

    Leave a comment:


  • Sysman
    replied
    Originally posted by SupremeSpod View Post
    If you're interested in learning more about the MAC command line, I recommend you get a copy of Mac OS X Unix 101 Byte-Sized Projects - Adrian Mayo - Google Books

    A mate of mine wrote it.

    Mac OS X Unix 101 Byte-Sized Projects

    Peachpit Press, Dec 15, 2005 - 614 pages
    Unix is no longer someone else's OS. With Mac OS X built on top of it, Unix is becoming a household name, and more and more Mac users are ready to take it on. This book is for them! Based on a popular series of Unix tips, this book promises to deliver what most other Unix guides fail to: comprehensive tutorials and instruction on specific Unix subjects, commands, and projects, not just a handy reference guide. Arranged into 101 mini tutorials in 11 key technology areas, this book provides all the tricks, techniques, and training that you need to understand how the system works and start using it immediately. You will quickly learn the basics to working with the Unix command line as well as work on specific tutorials/exercises, including: browsing and searching the directory file-system; viewing, searching, and processing file content; using text editors; shell scripting; cool commands; and more.
    Using Mac OS X is indeed a good way to learn Unix, because you can do it at your own pace.

    That book looks excellent. I wish I'd come across it when it was first published.

    Leave a comment:


  • bobspud
    replied
    Originally posted by SupremeSpod View Post
    Not a bad suggestion.

    (There, that surprised the sh!t out of you, didn't it?)
    Yes! I just fell off my chair!

    Leave a comment:


  • SupremeSpod
    replied
    Originally posted by bobspud View Post
    the other cool way to learn unix commands is to cd into the directories /usr/bin and /usr/sbin and run the ls command

    now look at all the commands and pick several per day and read the man page for them

    for instance for a starter i would look at
    man ls
    man ifconfig
    man grep & zgrep
    man awk
    man sed

    Although Sed and Awk are redundant because you have perl installed and it has far better pattern and string manipulation


    (stands back and waits for a holy war to start!)
    Not a bad suggestion.

    (There, that surprised the sh!t out of you, didn't it?)

    Leave a comment:


  • bobspud
    replied
    the other cool way to learn unix commands is to cd into the directories /usr/bin and /usr/sbin and run the ls command

    now look at all the commands and pick several per day and read the man page for them

    for instance for a starter i would look at
    man ls
    man ifconfig
    man grep & zgrep
    man awk
    man sed

    Although Sed and Awk are redundant because you have perl installed and it has far better pattern and string manipulation


    (stands back and waits for a holy war to start!)

    Leave a comment:


  • SupremeSpod
    replied
    If you're interested in learning more about the MAC command line, I recommend you get a copy of Mac OS X Unix 101 Byte-Sized Projects - Adrian Mayo - Google Books

    A mate of mine wrote it.

    Leave a comment:


  • scooby
    replied
    Originally posted by Sysman View Post
    In terminal:

    Code:
    ./adb
    (that's dot - slash - adb)

    This is because your current directory isn't in your path, and that's probably how you want to keep it for development work.
    Legend!!!

    Originally posted by chef View Post
    I think he means you should manually type

    ./abd


    and not just type

    abd

    as you seem to say you have done in your post
    Am being a little thick!! Thanks both.

    Leave a comment:


  • Sysman
    replied
    Yes, The "./" bit means "look in the current directory".

    Leave a comment:


  • Pondlife
    replied
    Guys, what am i doing wrong? am at step 6, terminal open, but when i enter the commands, it says

    Scoobys-MacBook-Prolatform-tools Scooby$ abd
    -bash: abd: command not found
    But i can see the file:

    Scooby$ ls
    NOTICE.txt hboot-eng.img
    aapt lib
    adb
    Walkthrough and guide here (all steps done and installed etc): HTC Desire Z: Rooting - CyanogenMod Wiki Firmware

    Am i being stupid??
    Maybe

    Leave a comment:


  • Sysman
    replied
    And the first time around you were typing abd instead of adb.

    Leave a comment:


  • chef
    replied
    I think he means you should manually type

    ./abd


    and not just type

    abd

    as you seem to say you have done in your post

    Leave a comment:


  • scooby
    replied
    Originally posted by Sysman View Post
    In terminal:

    Code:
    ./adb
    (that's dot - slash - adb)

    This is because your current directory isn't in your path, and that's probably how you want to keep it for development work.
    Not sure what you mean mate? it's a manually typed command, not a script. (sorry, new to the Mac terminal...)

    corrected link: HTC Desire Z: Rooting - CyanogenMod Wiki

    Leave a comment:

Working...
X