• 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!

Mac Terminal help

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    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.

    Comment


      #12
      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!)

      Comment


        #13
        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?)

        Comment


          #14
          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!

          Comment


            #15
            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.
            Behold the warranty -- the bold print giveth and the fine print taketh away.

            Comment


              #16
              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.
              Behold the warranty -- the bold print giveth and the fine print taketh away.

              Comment


                #17
                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

                Comment


                  #18
                  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.
                  Behold the warranty -- the bold print giveth and the fine print taketh away.

                  Comment


                    #19
                    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.
                    <Insert idea here> will never be adopted because the politicians are in the pockets of the banks!

                    Comment

                    Working...
                    X