How do I start a program from the command line?

2»

Comments

  • Reply 21 of 35
    Quote:

    Originally posted by Vox Barbara

    sudo periodic weekly monthly



    Yeah I forgot I do this too.



    I use the sudo periodic daily



    Sudo periodic weekly



    and sudo periodic monthly
  • Reply 22 of 35
    Can you close applications via terminal?
  • Reply 23 of 35
    gongon Posts: 2,437member
    Quote:

    Originally posted by ibook911

    Can you close applications via terminal?



    You certainly can if you lookup their process ID's with "ps" and kill them with "kill".



    I'm curious though - what command would match the apps' regular Quit menu item? "kill" with some specific parameters?
  • Reply 24 of 35
    fahlmanfahlman Posts: 740member
    Quote:

    Originally posted by ibook911

    Can you close applications via terminal?



    type top, then find the application's PID (Process ID), type Control-C, then type kill PID, PID being the number from the last step.
  • Reply 25 of 35
    fahlmanfahlman Posts: 740member
    Quote:

    Originally posted by Gon

    I'm curious though - what command would match the apps' regular Quit menu item? "kill" with some specific parameters?



    From a quick look at the man pages of kill I think you type kill -3 PID.
  • Reply 26 of 35
    Quote:

    Originally posted by fahlman

    type top, then find the application's PID (Process ID), type Control-C,

    ...




    Why so? Just open a new terminal window.

    Leave top alone running in the background.

    Hence, i've got that habit.



    Btw,-

    If you want to force quit an app, you'd

    type in "sudo kill-9 (PID)"



    Btw2,-

    If you want to force quit Finder.app

    --> killall Finder

    If you want to force quit Dock.app

    --> killall Dock
  • Reply 27 of 35
    krispiekrispie Posts: 260member
    Quote:

    Originally posted by aplnub

    One more question, how do I change directories?



    Eric




    If you don't know this, you're probably better off not using the shell(s).



    What are you actually trying to do?
  • Reply 28 of 35
    aplnubaplnub Posts: 2,605member
    Quote:

    Originally posted by krispie

    If you don't know this, you're probably better off not using the shell(s).



    What are you actually trying to do?




    Is that what you say to all the people that have made the swap to the Apple platform from Windows? I hope not.



    How else am I supposed to learn? I have used DOS since I was a kid and the first time I used it I didn't know how to do anything without my father showing me one or two things. Since then I have been an avid windows user and ran Mandrake for a while. My experience with shells has been very little. I am trying to learn a few basic functions so I can start the learning over again.



    I appreciate everyone's help in the thread so far as it has been invaluable.



    I want to start Entourage from the command line, and then shut it down (it would be great to know when it was finished downloading emails but that is probably a pipe dream at this point). I want to accomplish this via SSH from my iBook (I have the SSH part down).



    Regards,



    Eric
  • Reply 29 of 35
    aslan^aslan^ Posts: 599member
    Quote:

    Originally posted by krispie

    If you don't know this, you're probably better off not using the shell(s).



    What are you actually trying to do?




    Dude, you couldn't be more wrong... computers are for exporation and learning. If everyone thought like you, no one would learn anything.



    To the orignal poster, most of your basic unix commands are stored in the /bin folder. You can access a manual page for each command by typing man and then the command. The manual page will explain what the command does and how to use it.



    Examples:



    man ls

    man cd

    man pwd

    man rm

    man mv

    man top



    You get the picture. The command line is a great tool, and especially useful when using remote access programs like ssh.



    Other great places to look for commands are /usr/bin and /usr/sbin.

  • Reply 30 of 35
    You might be interested to know that OS X also has the fetchmail command which can download mail from all your mail accounts (regardless of whether they're POP, IMAP, whatever). You could run it as part of a script or cron job.



    Homepage is here.
  • Reply 31 of 35
    Quick shortcut for changing directory in the terminal.



    Type cd -spacebar- like usual and then simply drag a folder from the finder and drop it into the terminal window. This will automatically complete the path.
  • Reply 32 of 35
    aplnubaplnub Posts: 2,605member
    Thanks for the heads up on fetchmail and definitely on that cool drag and finish tip.



    I am working on trying these out. I wish my iBook would hurry up and get here.



    What is a "cron" job?



    Anyone used fetchmail?



    Eric
  • Reply 33 of 35
    Quote:

    Originally posted by aplnub

    ...

    What is a "cron" job?

    ...




    open terminal

    type in:

    man cron
  • Reply 34 of 35
    relicrelic Posts: 4,735member
    Quote:

    Originally posted by aplnub

    What is a "cron" job?





    In your terminal type "crontab -e" this will launch a VI session with your crontab on edit.



    VI is my favorite UNIX command line editor, press [ESC] (command) then i (insert) to enter in edit mode. Insert the below text to startup Entourage every morning at 8:00am, Monday through Friday. Now press [ESC] (command) then "w" (write) then "q" (quit) and finaly [RETURN].



    #minute hour mday month wday command

    0 8 * * 1-5 open /Applications/Office/Microsoft\\ Entourage
  • Reply 35 of 35
    Quote:

    Originally posted by Relic

    In your terminal type "crontab -e" this will launch a VI session with your crontab on edit.



    VI is my favorite UNIX command line editor, press [ESC] (command) then i (insert) to enter in edit mode. Insert the below text to startup Entourage every morning at 8:00am, Monday through Friday. Now press [ESC] (command) then "w" (write) then "q" (quit) and finaly [RETURN].



    #minute hour mday month wday command

    0 8 * * 1-5 open /Applications/Office/Microsoft\\ Entourage




    nice. how would you edit the times,

    in which the "periodic" scripts are

    going to be executed?

    Example: i want "periodic daily" to

    be executed at 12:00 AM. Possible?
Sign In or Register to comment.