7 Replies Latest reply: Mar 27, 2011 10:13 AM by BobHarris
kali90 Level 1 Level 1 (0 points)
hi,

I'm trying to install ant, a tool for building jsp apps... following set up instr's here,
http://sakibulhasan.wordpress.com/2010/07/30/install-apache-ant-on-mac-os-x/

now to move dir 'ant' to destination he indicated, I got permission denied, I had to do in the Finder, where was prompted for pswd, so np... but for next comamnd, " ln -s ant ant ", I also get permission denied.. why doesn't terminal prompt you for pswd like the Finder does???? (and how can I execute this command (& others that require pswd) in the terminal w/the password?

thank you..

iMac
  • Tony T1 Level 6 Level 6 (8,805 points)
    ... but for next comamnd, " ln -s ant ant ", I also get permission denied.. why doesn't terminal prompt you for pswd like the Finder does????

    try:

    sudo ln -s ant ant
  • kali90 Level 1 Level 1 (0 points)
    worked!! thank you..

    so any time I get "permission denied" I guess if I try command again with 'sudo' it should work..

    just learned something new.. thank you very much..

    (PS: remembering that to connect to mysql I have to do "mysql -u root –p" I tried stuff like " ln -s ant ant -p" but got "illegal command"..)
  • BobHarris Level 6 Level 6 (15,575 points)
    so any time I get "permission denied" I guess if I try command again with 'sudo' it should work..

    Yes, but just make sure you know what you are aiming at, as sudo is perfectly capable of allowing you to totally destroy your system.

    Unless you know what you are doing with sudo, you should make sure you have a current backup.
  • Frank Caggiano Level 7 Level 7 (25,720 points)
    kali90 wrote:
    worked!! thank you..

    so any time I get "permission denied" I guess if I try command again with 'sudo' it should work..

    just learned something new.. thank you very much..


    Sometimes a little knowledge can be a dangerous thing

    Remember when you use sudo you are executing the command as root, as the systems supreme being. There are no do overs. There is no *system trash* to retrive things from. If you remove a file (or directory or even the root directory) it is gone, no changing your mind. As quick as it took to hit the CR is as quick as the system is gone.

    I don't want to sound overly melodramatic (well maybe I do) but

    so any time I get "permission denied" I guess if I try command again with 'sudo' it should work..


    is a bad way to think. Before using sudo know why you're using it and if you expected a command to work as a regular user and it doesn't take a moment to think about why it didn't work. Maybe the system is trying to keep you from doing something really bad.

    Get a room full of unix system administrators and ask how many ever wipe out a system by executing something as root. The ones who don't raise their hands are lying.
  • Linc Davis Level 10 Level 10 (164,105 points)
    The latest Java update includes ant 1.8.2, so unless you need a newer version, you don't need to install it.
  • Tony T1 Level 6 Level 6 (8,805 points)
    BobHarris wrote:
    sudo is perfectly capable of allowing you to totally destroy your system.


    True, and the same applies to providing a password when a GUI installer requests it.
    And you can hose all your data with an errant rm command without sudo (which is why I have rm aliased to rm -i).

    Unless you know what you are doing with sudo, you should make sure you have a current backup.


    ...and even if you know what you're doing
  • BobHarris Level 6 Level 6 (15,575 points)
    Unless you know what you are doing with sudo, you should make sure you have a current backup.


    ...and even if you know what you're doing

    My MacBook is backup to my work iMac every workday.

    My iMac is backup via TimeMachine (hourly) and SuperDuper (daily), with some key files replicated to other systems nightly (for example the group web site hosted on my iMac). And various system at work, have critical files backed up to my iMac nightly (as I have about 7 terabytes of storage hanging off my iMac; most of it for backups and backups of backups).

    If you play in the Unix command space it is just a matter of "When", not "If" you are going to fumble finger a command and destroy something you instantly hope you have backed up. Just last week, someone overwrote someone else's files by running script in the wrong terminal session window (this was a very good and very experienced command line user). Luckily I had taken a snapshot of the other user's files about 2 hour before, and nothing was lost. Sometimes Dumb Luck is all you have