Unix commands = Mac Terminal commands ?

Hi,
I am a newbie to the mac and just wondering whether the Mac & Unix terminal commands are same ?
$

Yes they are. Since MacOS X 10.5 Leopard, the operating system has had the full Single Unix Specification certification, meaning it complies with all we normally call "unix". Of course, as JoeyR points out, it still shows its roots from the FreeBSD and NeXTstep worlds.
If you want to compile programs in the traditional Unix fashion, by default MacOS X does not include a gcc compiler. But you can download and install the full XCode SDE for free thru the App Store, just seach for XCode. Beware it is big and will take awhile to download.
For help in specific MacOS X Unix stuff, there is the Mac OS & System Software / Mac OS X Technologies forum.

Similar Messages

  • Terminal - how to find my external hard drive using unix commands

    just discovered terminal and using cd and ls commands, which are the only commands i know, i realized that i can't find my external hard drive. i thought it would be listed on my desktop, as it is in the OSX interface, but it isn't there.
    not that im skilled enough to use terminal yet, but i thought the first step would be being able to navigate the computer's files.
    really curious as to where my external hard drive is and how i can find it using unix commands in terminal.
    i was trying to figure it out myself, then i thought surely someone knows this and could tell me in a sec.
    thanks.
    ibook   Mac OS X (10.4.4)  
    ibook   Mac OS X (10.4.4)  

    "ls /Volumes" will list all volumes, including internal and external hard drives and mounted disk images. I find "disktool -l" more useful in scripts, as it tells you which volume names correspond to which "mount points" under /Volumes. Usually they're the same, but if you have two volumes with the same name, or you try to remount a removable volume before it is fully unmounted, you'll end up with a mount point that consists of the volume name with a numerical suffix.

  • Terminal commands = UNIX commands?

    would I be right if I say terminal commands equal UNIX commands? I can use the same commands to write a simple rsync scripts to backup my data every night?

    As I recall rsync does not preserve the Mac resource fork. In fact, you can use it to strip resource forks, which is actually useful for sharing with Windows users or putting files on a Windows server, where the resource fork drives 'em nutty (it shows as a separate file with "._filename").
    Francine
    Francine
    Schwieder

  • Terminal - Unix commands

    Anybody knows of good tutorials or a manual for using the terminal to fire off unix commands, I have some unix experience, but I'm not sure what can be done with it on my MacBook - e.g. the yes test is a very good test and tool one can use to see how your system will react to a heavy load on the processor.
    MacBook 2GHz, 1GB RAM   Mac OS X (10.4.7)  

    You can also look at some books to help you out. Mac OS X Tiger in a Nutshell or Unix in a Nutshell from O'Reilly are good resources to use if you need to harness the power of the command line. I know because I use them daily, since I can't stand reading man pages off a computer screen....
    Hope this helps

  • Can anyone suggest me a handbook of mac terminal commands

    Guyz I am new user of mac and I like to use the terminal. Can anyone kindly suggest me any handbook or codebook for learning basic mac terminal commands?

    Spend some time in a book store that has a section of Unix/Linux oriented computer books.  Find a book that discusses the Bash Shell (Bourne Again Shell; in tribute to Bourne, who wrote one of the first shell's to be popular on Unix).  Bash is the default shell for Mac OS X.  Such a book will give you the basics of using the shell.  Most of the commands they will teach you about will work on Mac OS X, although you may run into a few commands that have slightly different options, the basics are still going to be the same.
    Or a book on shell programming.
    Anyway, browse the books and if you find one that "Speaks to You", then buy it.
    There are also some "Mac OS X for Unix Geeks" books available that might give some Mac OS X specific Unix usage, but they also may assume a lot of existing command line knowledge.
    The key think to keep in mind, is that 85% to 90% of the Mac OS X command line interface is just like every other Unix/Linux command line interface.  Of course that last 10 - 15% can trip you up, and relates to specific commands and command options that may vary between Unix/Linux implementations.  That being said, a lot of knowledge about another Unix/Linux platform is transferable to the Mac OS X command line.

  • UNIX command for terminal

    Here is what I want to do:
    I want to send the terminal command to 25 laptops all at once to direct them to our internal server for software update.
    I know how to log in to all of the machines at once.
    osascript -e 'tell application "System Events"' -e 'keystroke "username"' -e 'keystroke tab' \
    -e 'delay 0.5' -e 'keystroke "password"' -e 'delay 0.5' -e 'keystroke return' -e 'end tell'
    I know how to open terminal.
    open -a terminal
    Now what I want to know is how to have it type this in for me:
    sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURLhttp://SERVER.local:8088/index-mountainlion-lion-snowleopard-leopard.merged-1.su catalog
    Then have a pause and then type my password.
    Bonus points for then a script to force it to check for and do the update.

    You don't need to use send unix command to send osascript to login, and then open the terminal to then type in a termainl command.
    you can just do
    send unix command
    as user root
    defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURLhttp://SERVER.local:8088/index-mountainlion-lion-snowleopard-leopard.merged-1.su catalog

  • Unix Command to Wake Up a Mac

    Hi everyone,
    Is there a Unix command to wake up a Mac when its sleeping?
    I want to schedule some updates to run at night or during the weekend but I cant find the command to send to a group of machines if they are sleeping.
    Thanks for your help

    I don't know of any built-in UNIX commands, but there are some scripts that perhaps you could find a way to trigger. Look here for some discussion on the issue.
    Hope this helps.
    Message was edited by: Dave Sawyer

  • Terminal/Unix Command to Mount External USB Drive?

    I am having a probelm with the directory on an external HDD. The "device" is showing up in the utility software (DRIVE GENIUS/DISK UTILITY) but not the "volume," so it can't affect any repairs except INTIALIZE. So, I'm presuming the drive is physically okay - just the directory is fouled up. Is there some unix command to run that will repair the directory in some manner? Thanks!

    Hi Metroxing,
       What you presume is not a given but yes, the existence of the device file greatly decreases the relative probability of your having a hardware problem. However, I have a question. I'm not sure of what you mean by the term "directory".
       In "UNIX" jargon a directory is that which in "Mac" jargon would be a filesystem "folder". However, there is another data structure in the filesystem that I think is called a "directory". I assume that's simply an abstraction of the Catalog B-Tree and related files. I know about this use of the term "directory" from discussions and readings on Alsoft's DiskWarrior. That is supposed to do exactly what you want, "rebuild the directory structure", and is a relatively inexpensive "best-of-breed" solution.
    Gary
    ~~~~
       Imitation is the sincerest form of television.
             -- Fred Allen

  • Where can I get an aide memoir of unix commands for Terminal?

    Like the title, does anyone know where I could get an aide memoir of unix commands?

    Terminal Commands - 10
    Terminal Commands - 50
    Terminal Commands - 250
    Terminal Commands - Secrets

  • UNIX command required to elevate end user Admin privs on  mac

    Hi All,
    I thought this would be easy but we've drawn a blank.
    So much detail online and in the ARD manual seems to be about setting admin priveledges for end users of actual ARD.
    What we would like to do is to make the user an administrator of their computer temporarily.
    So rather than browse to their computer, take control, log them out, log in as administrator, go to accounts and then select eheir account and tick the "Allow user to admister this computer" box - I was looking for a UNIX command that coudl be sent.
    Any help greatfully recieved.
    thanks
    Gareth

    I believe this will work, but test it on a testbed system first. Send the following UNIX command to the target computers:
    dscl / -append /Groups/admin GroupMembership ARDusername
    where "ARDusername" is the user you want to add to the admin group. To remove the user's admin rights, substitute -delete for -append.
    Hope this does the job for you. If not, it should be close, so persual of the man page for dscl should help you to the correct syntax.
    Regards.

  • Learning Unix commands (and automator/applescript) for a dummy :-)

    Hi:
    I've been supporting macs for many years and have done mostly user end support with all the various GUI tools. I've never been a programmer, never had the mind for it, etc.
    However, I've now reached the point where I need to do some kind of scripting and I'm looking for some good learning/training tools. I was wondering if anyone might have suggestions about the best training / reference guides to go about doing this. Right now, it's as if I need to play a little Beethoven, haven't learned Chopsticks yet and I'm trying to find out how to play chopsticks while learning a little Beethoven at the same time. (how's that for a metaphor?)
    For example: For my first project, I have to set up a backup for some laptop users so that certain files will be backed up. The need is different for each user, so this is why setting up a script would be easiest. My goals in the setting up this project are:
    - Make the script run at logout (logout hook)
    - check to make sure the network volume I want to backup to is present; if not present, stop the script
    - Use either cp or rsync to copy the files/directories to the shared volume.
    I've tried to look around the internet for help, examples, etc, but I've been unable to put together exactly the commands I need to sue to accomplish my task.
    Any suggestions would be great.
    Thanks!

    If you already know something about unix commands, there is a scripting tutorial at http://www.tldp.org/LDP/abs/html/index.html
    If you need a tutorial on unix commands, http://osxfaq.com/Tutorials/LearningCenter/UnixTutorials/LoseTheMouse/index.ws had a pretty good tutorial, although at the moment, that link isn't loading for me now so I don't know if it is still up online or not.
    for creating logout hooks, http://www.bombich.com/mactips/loginhooks.html might help.
    Also, in Terminal, type man launchd.plist if you can think of a scenario where you could implement a "cron-like" solution. Then refer to Apple's own periodic daily/weekly/monthly launchd plists (com.apple.periodic-*ly.plist) at/System/Library/LaunchDaemons/. There are more triggers available than just day/date/time, such as "watchPaths" and "RunAtLoad." Home grown launchd plists ones should go in /Library/LaunchDaemons/ or Library/LaunchAgents, not /System/Library/LaunchDaemons/. Also man launchd (no ".plist").

  • Running a Unix command as "root" with NSTask

    Hi,
    I'm new to objective-C and Cocoa programming. I already know C and C++ (from classes I had in Uni.) but this one goes farther than what I've seen. Stricltly for learning purposes, I'd like to make a three button window where you click on a button and it launches /etc/daily and the two other cron tasks. But, in order to launch those commands, you need to use sudo. I guess wrapping a Unix command in a Cocoa application uses NSTask, but how do you get the app to run with root access?
    Any help will be appreciated
    iBook G4 (12)   Mac OS X (10.4.8)  

    How about launching Terminal with a script that calls
    sudo? sudo will query the controllying TTY
    (Terminal) for the user's (which had better be an
    admin user) password.
    There should be no way to do this without requiring
    admin authentication, preferably interactive. If
    there were, it would be a privilege escalation
    vulnerability in OS X...
    That is exactly what I am looking for: I'd like my application the ask for administrator privileges before running the Unix scripts.
    iBook G4 (12")   Mac OS X (10.4.8)  
    iBook G4 (12")   Mac OS X (10.4.8)  

  • Is there a way to change the VNC password thru unix command in ARD2?

    In a local network, I get access denied errors from macs that have the vnc password different than the Administrative login user password. I needed to change the Admistrator password which I did thru the Unix command in ARD2.
    Now.
    Is there a way to change the VNC password thru unix command in ARD2?
    Example:
    remote computer setup
    Panther 10.3.9
    vnc password - gopher
    user ID - testARD with admin rights
    user password - backdoor
    ARD2 Computer setup
    10.4.10
    login ID - testARD
    password - backdoor
    I get the blue icon but get an 'access denied' error.
    I change the password from backdoor to gopher.
    I get the red with dash icon but, can get access to the computer.
    What is going on? Is ARD2 using the VNC resource instead of ARDs resources?

    A quick search of Google finds this <http://www.macgeekery.com/tips/cli/settingremote_desktops_vnc_password_interminal>. I have not tested this myself.
    bill

  • Unix command in ARD to remove DNS Servers from Network prefs?

    I need to know how to send a unix command to remove DNS Servers in Network preferences. I need the DNS Servers field to be blank. Can this be done?

    Our network administrator is getting ready to change the IP address of our DNS server. This means I have over 30 Macs that will be needing changes to their DNS settings. Since each machine is setup with limited access to the system prefs, that means I have to go to each machine and log in as the admin user to make this change. In the interest of saving time, is this something I can do with Remote Desktop and how? Would I use the same commands in this post and replace dns1 with our DNS' new IP address? Will this distrupt the users access to the network when I do so?
    Thanks for any help.
    Beth

  • Execute Unix command on login

    Hello, is it possible to execute a unix command on user login?
    I want that every time a user login on a mac at my company, a unix command be executed.
    Is this case, this is the command: defaults write com.apple.mail NSPreferredMailCharset "UTF-8"
    thks in advance

    {quote}Loginwindow Scripts
    Another way to run applications at login time is to launch them using a custom shell script. Mac OS X provides two options for launching scripts when the user logs in. When creating your script file, keep the following in mind:
    * The permissions for your script file should include execute privileges for the appropriate users.
    * Scripts launched by loginwindow are run as root. Therefore, you should thoroughly test your scripts before deploying them to make sure they do not adversely affect the user's system.
    *In your script, the variable $1 returns the short name of the user who is logging in.
    * Other login actions wait until your hook finishes executing. Therefore, have your script do what it needs to do quickly and then exit. {quote}
    I want the script to be run as the current user that does the login, and not as the root. I think that if its run as root, it changes nothing in the user. Does this root issue apllies to the Zerwas method?
    It depends on how Zerwas was thinking you'd implement it. If you added it to each user's login items, it should run as the user. If you create a startup item to run it, it will run as root. I'm assuming Zerwas was suggesting the former because there would be no point in wrapping the shell script in an AppleScript if you are going to turn it into a startup item.
    What you might be able to do - at least with the loginwindow script - would be to explicitly run the command as the user by making use of the fact that the user name is passed to the loginwindow script as $1. I've never used loginwindow scripts but it seems as though it should work.
    Another possibility would be to use a LaunchAgent. These are really intended to manage background processes, though, and it seems an unnecessary use of resources to load one which will only ever be run at startup.
    Can I ask why you wish to run the script every time a user logs in? Is the concern that the default will get set to something else and needs to be reset regularly?
    - cfr

  • Using Unix Command Line to force logoff of other users

    Hello - I am the administrator for my family's Mac (OS X - 10.4.8). Four of us in the family share the system. Frequently, my family members forget to logoff. I would like to be able to force them off via the Unix command line. Can't I sign on as root and execute a "forced logoff" type of command?

    Thanks to Mihalis and Jarik for the additional info.
    I'm back now with a question. I have a user named "visitor" logged on. I issued a killall command which killed all the users processes except one. Using /Applications/Activity Monitor.app, I can see the process is "loginwindow" and it is owned by visitor.
    However,
    ps -u visitor
    reveals no running processes. Assuming I only had command-line access (no GUI to use Activity Monitor.app) and had multiple users logged in, how can I discover which loginwindow PID belongs to visitor?
    msq
    EDIT: I went ahead and sudo kill PID the loginwindow process owned by visitor and realized that
    ps -axj | grep visitor
    worked to reveal the loginwindow process owned by visitor. But when I logged visitor in (Fast User Switching) and ran sudo killall the Activity Monitor.app identifies the loginwindow as being owned by root but ps -axj | grep visitor shows the process belonging to visitor.
    Something weird in the depths of Leopard's UNIX land, but I think I can find my way around now.
    Thanks, everyone.
    Message was edited by: mistersquid

Maybe you are looking for