Terminal/Unix:Gentle quit

I know about the "killall" command, but I would like to know the command to quit more gently. For example if I force quit the finder with killall or "Force Quit" in Activity Monitor, I lose all currently open windows when the finder restarts. If I hit "Quit Process" in Activity Monitor, the finder quits but all currently open windows come back when the finder restarts. I would like to know the terminal command equivalent to this.
-Scott
PS Is there a more appropriate space for unix questions like this?

Hello!
Perhaps this can help you. Although I don't really know what you mean by quitting gently.
First, find the PID of Finder.app:
$ ps -A | grep Finder <enter>
There should only be 2 lines, the first is the one you want, the second is the last command to run. The number on the far left is the process ID number.
Then kill it:
$kill -6 <PID NUMBER> <enter> (for me, it was 129, so it was kill -6 129)
These are the various flags for the kill command:
1 HUP (hang up)
2 INT (interrupt)
3 QUIT (quit)
6 ABRT (abort)
9 KILL (non-catchable, non-ignorable kill)
14 ALRM (alarm clock)
15 TERM (software termination signal)
$ kill -9 <PID NUMBER> (if all else fails)

Similar Messages

  • Is it possible to add a new note on stickies.app by terminal/unix shell scripts ?

    is it possible to add a new note on stickies.app by terminal/unix shell scripts ?

    1. If i uninstall GNU Classpath, Does it cause system not to work properly? Not in my experience. I have encountered dozens of cases where it cured problems like this immediately. Alternatively adjust your PATH so that it finds the JDK before it finds GNU CLASSPATH.
    (Now i am using that java on my server with a certificate , I dont want to risk the system. )GNU CLASSPATH is the risk here.
    2. I have searched about your advice, this link tells classpath causes: "certificate insert problems"
    http://builder.classpath.org/japi/jdk15-classpath.html is this what you mean ?
    I can't find that statement on that page, but it does show compliance problems of up to 20% in the security area (and *40%* in LDAP, the area I'm working in at the moment).
    Basically GNU CLASSPATH is not Java and cannot be expected to behave like it. In this case it doesn't even understand the format of a Java keystore. QED.
    Note that they don't call it 'Java', because it isn't. I quote:
    GNU Classpath 1.0 will be fully compatible with the 1.1 and 1.2 API specifications, in addition to having significant (>95%) compatability with the 1.3, 1.4, 1.5 and 1.6 APIs.In other words they haven't even finished JDK 1.1 yet, let alone all the other stuff. At the present rate of progress they never will. That statement is the latest, it is dated 7 July 2009, and the latest actual software is dated 5 February 2009. And there is clearly no intention of ever submitting it to the Java Compatibility Tests as real Java implementors do.
    3. How can i uninstall GNU Class Path without causing any problems to my working server?No idea, can't help you. Ask a Liinux expert.
    4. Is there any way to add the certificate without removing GNU CLASSPATH ?Yes, see above, but I still strongly recommend removal.

  • Terminal/UNIX/ and telnet

    I have been using the e-mail program Pine for 15 years. I find that is the the easiest and best e-mail program available. On my beige G3 I have no problem telnetting to the server and accessing Pine and deleting and moving e-mails.
    I recently purchased an iMac with Leopard and have gone through the upgrades and software installs. The one last operation was to open terminal (under utilities) and at the UNIX prompt type:
    telnet mail.site.org (site bring the name of the server).
    It worked once flawlessly. I logged out and now I only get that the connection has timed out. ping works to the remote site.
    I called the tech support for my server and was told to re-install the OS.
    I have zapped the Pram and now have re-installed the upgrade to OS X 5.8
    None of the above helped. What do I do to get this function working again?
    Thanks for any assistance.

    Thos Myers wrote:
    I recently purchased an iMac with Leopard and have gone through the upgrades and software installs. The one last operation was to open terminal (under utilities) and at the UNIX prompt type:
    telnet mail.site.org (site bring the name of the server).
    It worked once flawlessly. I logged out and now I only get that the connection has timed out. ping works to the remote site.
    I called the tech support for my server and was told to re-install the OS.
    That's a typical suggestion of clueless support people who are working from a support script and/or have nothing more useful to suggest. I'd ask to be referred to the next level of support.
    This is just a wild guess, but when you were done with your telnet session, did you issue a telnet "quit" command before you closed your Terminal session? I wonder if this could have left a phantom connection on that server.

  • Help! Starting up in terminal/Unix

    When I start up my G5, instead of starting the OSX GUI, it seems to be starting up in Unix - ie I get a black screen with BSD/Darwin, asking me to log on. When I do, I get 'Welcome to Darwin', but I don't know how to start up OSX!
    I have not chosen any different startup options or anything and am at a loss to know how to actually get it to start up in a way I can use. I don't know enough about the Unix side of things to work like this or even start up the GUI. Could someone let me know how to get it working??

    Update: Sorry if I posted this in the wrong forum. As it was asking me to log in when I normally log in automatically, I thought it was something to do with my account.
    Anyway, from reading what I could find about this, I thought that maybe it was starting up in Single User mode. However, this does not appear to be the case. I have tried Single User mode, and this gives quite a lot of text on the screen at startup giving system information. The other times I just get the text 'Darwin/BSD (Macintosh.local) (console)
    Also, I am unable to reboot. (If I try the reboot command, it says 'operation not permitted') and the only way I can restart is by holding down the power button.
    I have tried resetting the PRAM, starting up from the install CD to repair disk permissions etc and also starting in safe mode, and none of these has made a difference. Any more ideas?

  • 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

  • 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

  • Terminal [ UNIX ] "mouse click" command question

    Can I emulate a left mouse click using a command in terminal? Or any freeware solutions available that would help?
    So what I wanna do is
    +open -a blabla filename+
    and then click on a specific area (like If I can tell the x,y co-ordinates to the command it would emulate the action and my application being on top would make the click)

    Let's say that myApp is the reference to your application and myItem is the item in which you want to click. Then you can do something like this
    osascript -e 'tell application "System Events" to tell myApp to click myItem at {x, y}'
    The 'at' part is optional and of course replace 'x' and 'y' with the numbers representing the x and y coordinates. For more information look at this [thread|http://forums.macosxhints.com/archive/index.php/t-36121.html]

  • Terminal/Unix question

    when I open terminal it appears to open in the account I am using. I tried a cd to go up a level with no luck.
    My objective is to get to the Users folder and make temporary permission changes.
    I tried booting with the system disk but could only access the contents of that disc.
    aluminum PB G4   Mac OS X (10.4.8)  

    From the terminal help thing:
    to change permissions for an item, use the chmod command. The syntax of the command is as follows:
    chmod securitygroup [changetype] [permission] [file or directory]
    The options for each item in the command are described below.
    Securitygroup (The person or group whose permission you are changing.)
    u - user
    g - group
    o - other
    all - all
    Changetype (Whether you are adding or subtracting the permission.)
    "+" add permission
    "-" subtract permission
    Permission (The permission you are changing.)
    r - read
    w - write
    x - execute
    File or directory: The name of the file or directory to change.
    ex: chmod ugo +rwx /users
    That should add the ability to read, write, and execute to anyone (I tried the 'all' option and it didn't work for me). I'm not positive this is correct but it worked for me.
    macbook   Mac OS X (10.4.8)  

  • Terminal/UNIX commands reference

    Hi there, I'm a beginner in using Terminal. I've searched all over the place but couldn't find a complete reference for the commands. Does one exist? Any ideas on the best reference(s)?
    -Brett

    Hi there, I'm a beginner in using Terminal. I've searched all over the place but couldn't find a complete reference for the commands. Does one exist? Any ideas on the best reference(s)?
    Most likely not a complete reference.
    Most commands are covered by 'man' pages (but not all).
    man -k subject
    can be used search available man pages.
    I suppose
    man -k " "
    should give a list of all the commands.
    And knowing the commands is not the same as knowing how to use them. You will need to find information on using the 'bash' shell, otherwise you are going to miss a lot.
    'bash' is covered by "man bash", but again that does not tell you how to combine the commands to do useful work. In some ways, no book or web page can tell you that. Only using the commands in scripts while attempting to do real tasks will teach you those skills.

  • Can I log out from my Mac using Terminal.app?

    Is there a command I can issue in Terminal.app to log myself out? I'm just looking for a command-line equivalent of Apple >> Log Out. I would like to script this action so I can add it to my dock. Thanks.

    Hi--
    I wasn't able to find a way to completely log out via the Terminal (i.e., quit all apps and go back to the login window), though I did find a way to suspend the current login session (your apps are still running when you come back, much like with fast user switching):
    <pre class="command">/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession -suspend</pre>
    You can also log out via AppleScript:
    <pre class="command">tell application "System Events" to log out</pre>
    Just save it as an application and put it on your Dock. I didn't do much testing, though, so I don't know if it'll quit your apps for you cleanly. Basically, I just got to the point where the dialog came up and left it at that.
    charlie

  • Terminal Script - almost there!

    Greetings All,
    I have written the following script in order to have my clients change the Softare Update server from Apple's to the internal mirrored one I setup on OSX.
    The 2 portions that I need help with are:
    1. Removing the QUIT or RUN option (I have saved it as an application and wish to have it just run, with no choice)
    2. I'd like the terminal application to quit completely (window and all)
    The script runs correctly, but I'd like it to run automatically (like 1) and with quitting Terminal (like 2)
    Thanks in advance,
    -andy-

    >1. Removing the QUIT or RUN option (I have saved it as an application and wish to have it just run, with no choice)
    When you save the application, turn off the 'Startup Screen' option. That's what is displaying the Quit/Run dialog.
    >2. I'd like the terminal application to quit completely (window and all)
    Why are you using terminal.app at all? From the description, everything can be done with basic 'do shell script' commands, eliminating the need for terminal.app.
    Just be aware that if you do opt to use the terminal, blindly quitting it when you're done (which, BTW is done via 'tell application "Terminal" to quit') could be a very bad thing. How do you know the user didn't already have the terminal open, running a dozen different processes and logged into half a dozen other machines. Quitting the terminal just because you are done with it doesn't seem like a good idea.
    You should check the terminal.app state before you start issuing commands. Only if it wasn't running, or if it had no windows open should you consider quitting it when you're done. It might be acceptable to run your commands, close your window and quit if there are no other windows, but like I said before, you shouldn't need to use Terminal.app at all.

  • How is possible change an administrator user to standar via terminal?

    HI to all!
    How is possible change an administrator user to standar via terminal (unix command)?
    thanks a lot
    Simone

    Thank you Mr Hoffman!
    i have found this command:
    dscl . -append /Groups/admin GroupMembership shortname
    it's working, what do you think about it?

  • Manipulating directory path in terminal

    Hi all,
    I'm looking for a simple terminal (unix) command that can take a long path resulted by the pwd command and remove some of the hierarchies from it.
    For example if the input is: /Network/Servers/XXX/Volumes/YYY/home
    The output should be: YYY/home
    And if the input is: /Network/Servers/XXX/Volumes/YYY/home/docs
    The output should be: YYY/home/docs
    thanks,
    Ziv

    For example if the input is: >/Network/Servers/XXX/Volumes/YYY/home
    The output should be: YYY/home
    And if the input is: /Network/Servers/XXX/Volumes/YYY/home/docs
    The output should be: YYY/home/docs
    If you know that the prefix is always going to be a fixed value, or at least one that is fixed for this moment in time, then you could do the following:
    prefix=/Network/Servers/XXX/Volumes/
    while read file
    do
    suffix=${file#$prefix}
    echo $suffix
    done <<EOD
    /Network/Servers/XXX/Volumes/YYY/home
    /Network/Servers/XXX/Volumes/YYY/home/docs
    EOD
    If you only know that specific directories in the middle of the path will be the same, then you could try this:
    anchor=YYY/home
    while read file
    do
    suffix=${anchor}${file//*$(anchor}}
    echo $suffix
    done <<EOD
    /Network/Servers/XXX/Volumes/YYY/home
    /Network/Servers/XXX/Volumes/YYY/home/docs
    EOD
    HOWEVER, you want to be careful about false positives.

  • Terminal isn't working?

    When I open terminal, it says Terminal-login-80x24 in the bar at the top. The window is empty and what ever I type into it doesn't work. It looks more like Text Edit than Terminal. Thanks for any help!

    Not  talking about looking in terminal here. Quit terminal.application.  You are looking for a plist in your user account.  Finder>Go>Home
    In your ( username ) Folder/ Library Folder/Preferences Folder /   >>com.apple.Terminal.plist.
    Drag to the desktop the com.apple.Terminal.plist .  Then relaunch your Terminal.app and see if it works.
    If all is well trash the plist.

  • How to reset Terminal to initial settings?

    Hi all,
    I lately have been trying to learn programming through online sources (particularly YouTube). I managed to fiddle around with the terminal application successfully but I am afraid I have done some damage. Since my knowledge of computers is so small, I don't know what I have done. I just know that it is not behaving the way tutorials expect it to.
    I would like to reset the Terminal to how it was without me touching it. Is there away to delete my progress and start fresh?
    Thanks.

    I suggest:
    -- making a complete backup of you machine.
    -- create another userid for messing with terminal/unix.
    A book on Bash would be helpful.
    Practical Guide to Linux Commands, Editors, and Shell Programming, A (2nd Edition) [Paperback] the book Don't be fooled by the name, the second addition includes Mac OS X.  
    Advanced Bash Script. premise: Examples for everything. I have revision 6.2.
    tldp.org/LDP/abs/abs-guide.pdf
    BASH Programming - Introduction HOW-TO
    http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html#toc14
    Apple administrative commands
    http://manuals.info.apple.com/en_US/IntroCommandLine_v10.6.pdf
    Apple Shell Scripting Primer
    https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual/Shel lScripting/ShellScripting.pdf
    Check you local library. Any book on Bash syntax will do. There will be minor differences but they will not be great.
    Sometimes you can get a good deal on used books in Amazon.
    <p><span style="font-size: 12pt;"><strong>Create new Account</strong></span></p>
    <p> </p>
    <p>blue apple &gt; system preferences </p>
    <p> clicks on accounts icon</p>
    <p> </p>
    <p>click on lock icon if locked.  </p>
    <p>enter logon password   </p>
    <p><img alt="Picture 9.png" class="jive-image-thumbnail jive-image" src="https://discussions.apple.com/servlet/JiveServlet/downloadImage/2-21015941-20777 6/Picture+9.png" width="450" __jive_id="207776" /></p>
    <p> </p>
    <p>click on + icon ( left side of screen just above the lock icon )</p>
    <p> </p>
    <p><img alt="Picture 10.png" class="jive-image-thumbnail jive-image" src="https://discussions.apple.com/servlet/JiveServlet/downloadImage/2-21015941-20777 7/Picture+10.png" width="450" __jive_id="207777" /></p>
    <p> </p>
    <p>after creating new account, you need to logout of your current account.</p>
    <p> </p>
    <p>blue apple &gt; log out ... current count name ...</p>
    <p> </p>
    <p>log on to new account. see if problem goes away.</p>
    <p><img alt="Picture 11.png" class="jive-image" src="https://discussions.apple.com/servlet/JiveServlet/downloadImage/2-21015941-20785 9/Picture+11.png" __jive_id="207859" /></p>
    <p> </p>
    <p>if it has gone  away, some preference file got messed up on your account. Rename the appropriate  Preference file. You will have to figure out the name.   They are .plist files.  Look for these files in Preferences folder which is in your Library folder [ more formally ~/Library/Preferences ].  ... reboot.</p>
    <p>Post back for more help. </p>
    <p> </p>
    <p> More tips on creating a new account</p>
    <p> http://pondini.org/OSX/Transfer.html </p>

Maybe you are looking for