Rename a locked folder with Terminal

Hi,
I have a folder /usr/local/php5/ and I want to rename it /usr/local/php5Apache1.3/ to install a new package.
How do I do that since I don't have write access to /local/ ?
Thank you much

Hi Dimitryous,
   If you don't have permissions to do it, use "sudo" to do it as a user that does have permissions. The command would be:
sudo mv /usr/local/php5 /usr/local/php5Apache1.3
Of course you have to be logged in as an admin user for this to work. When prompted for a password, you provide the password of that admin user.
   On the other hand, combining the source code of two packages in the same directory shouldn't work because they share a number of files. It is traditional to have a directory like /usr/local/src inside of which you put each package in its own directory. If the packages are not source code then it might not matter but it is still probably a good idea to save packages in their own directories.
Gary
~~~~
   Time is a great teacher, but unfortunately
   it kills all its pupils.
         -- Hector Berlioz

Similar Messages

  • I renamed my iMovie folder with my projects in it, and now iMovie  won't open them

    I renamed my iMovie folder with my projects in it and now iMovie  won't open them.

    Can you rename it back & try it?

  • Make a carbon copy of your drive/folder with Terminal!

    I always see people throwing carbon copy disk programs around like no tomorrow. I've wondered to myself "why?". The termainl in Mac OSX can do it out of the box and do it for free and, for more advanced users, you can start getting rather fancy with the commands for fine tuning. Type man cp in the terminal for more info.
    Say I want to make a carbon copy of my Home folder to my external disk called "Backup USB" so I can restore it later to a new drive.
    Firstly, open Terminal.app found in Applications > Utilities. Make sure the External Disk is plugged in first before continuing.
    Now I simply type in the following command:
    cp -pvR /Users/benanderson "/Volumes/Backup USB/benanderson"
    Once typed, press the return key and let the computer do its job.
    I'll run through the command so people know what each section does
    cp: this is the command for "copy"
    -pvR: these are "flags" and tell the computer how to perform the action.
    p: this flag stands for "preserve" and keeps all the file attributes intact. A file or folders owner, group, permissions and time stamp will remain the same. Say I have a file in the finder with a "created" and "modified" date of 8th September 2011 (you can see these by single clicking a file an pressing cmd+i) - if I was to copy this with the finder, the created and modified date of the copy would change to 17th December 2011 (today). By specifying the -p flag, the copy will keep the 8th of September creation and modify date. This is very important for system files that MacOSX has to keep track of.
    v: verbose, it basically tells you what file is currently copying so you're not copying blind wondering what its doing and when it will finish. Its a progress bar, basically.
    R: it will mimic the directory structure of the folder you are copying. without the -R flag, if you ask cp to copy a folder, it will skip the folder because the folder is not a file. With -R, it will copy the folder, the files in the folder and any folders within the folder and so on.
    /Users/benanderson: this is my home folder. Your name will vary, obviously.
    "/Volumes/Backup USB/benanderson": The destination of the copy on the disk "Backup USB". I need double quotes around the destination because "Backup USB" as a space in it. Without the quotes, the computer would read it as "/Volumes/Backup" and stop there, which is invalid and would cause an error, stopping the copy from working.
    To restore from backup, just do it again in reverse order.
    cp -pvR "/Volumes/Backup USB/benanderson" /Volumes/benanderson
    Hit return and set it on its way!
    If you're feeling sassy, make a carbon copy of your Macintosh HD onto another HDD, a carbon copy of your home folder from your desktop computer onto your laptop computer over the network (I do this with my iTunes folder every few months), carbon copy your HDD onto a Disk Image so you can "flash" other HDDs from disk utility. Carbon copy of your time machine or time capsule if moving to a larger disk. The cp command is increadibly useful, free, easy and powerful - its most likely what the Carbon Copy programs are doing under the hood, so why not cut out the middle man?
    Just a nice tip for everyone interested!

    Carbon Copy Cloner is free; its tasks are editable and restrictable; it works via a simple user interface; and it works without error. There is next to no learning curve involved, no need to learn Terminal's syntax, and none of the dangers that an error in syntax can cause when using Terminal.
    Did I mention CCC is free?

  • Creating a smart folder with Terminal?

    What I'm trying to do might not be possible, which wouldn't surprise me at all. What I'd like to do is one of the following:
    1. Create a smart folder that contains everything in the "/" folder.
    2. Create a smart folder that is populated with every volume currently mounted on my Mac.
    Essentially what I'm hoping to do is create a smart folder I can then use as a stack that would contain all the volumes currently located on my Mac. The only solution I've found so far for this is to use the /Volumes/ folder but this doesn't suit my needs as occasionally I get double icons for drives (1 being the alias the second being a private folder). Also it fails aesthetically which is part of the reason I'm doing this in the first place.
    If anyone could recommend a solution that'd be great. I figured Terminal was my best bet, unfortunately my knowledge of this form of coding is non-existent and no amount of Google searches could help me.

    I don't see how either item on your wish list can be satisfied by any of this "smart" stuff. The smart searches/folders are based on queries against the same metadata used by Spotlight - and that doesn't even look at / or /Volumes. Even if the info were available, is it up-to-the-minute enough to really be usable?
    If you want to examine the built-in searches as a guide, you'll find them in:
    /System/Library/CoreServices/Finder.app/Contents/Resources/CannedSearches
    Note that each of the items therein is a package, so you'll have to drill a bit deeper to get to the query file. I found that Property List Editor from XTools was a good way to get a structured view of them.

  • Locked folder with virus - delete

    I have a folder on a USB stick that picked up a virus when connected to a PC.
    It appears as a zip folder and is locked. I cannot unlock it and cannot trash it.
    Is there a way to force delete such a folder? I wish to continue using the stick and do not want to transfer the virus to other PC users.
    Thanks

    use searchlight to find terminal (or click on /Application/Utilities/Terminal.app )
    WARNING: NEVER EVER TYPE sudo rm -rf / and press enter unless you know what you are doing
    (instructions and comments are written after // the rest are commands).
    //hit enter after each command typed.
    //commands are case sensitive.
    //go to the path were your pendrive is mounted by doing this
    cd /Volumes
    ls
    //a list of folders will appear, verify the name of your pendrive is listed there (usually the partition name, if you pendrive is mounted as Frenchchrispen, type the following)
    cd Frenchchrispen
    ls
    //a list of files and folders from that pendrive's mounted partition will be displayed, noticed the name //of the folder your want to delete then do
    //ABSOLUTE CAUTION HERE KNOW WHAT YOU ARE TYPING, MAKE SURE IT IS THE FOLDER NAME YOU WISH TO DELETE THAT IS TYPED THERE
    //NOTE: if you folder name contains special characters or space, type the name between double quotes " "
    sudo rm -rf foldername_i_wish_todelete
    //that should do the trick, if ever it is complaining about sudo not found, try just rm -rf or
    su
    cd /Volumes/Frenchchrispen
    rm -rf foldername_i_wish_todelete
    +selven

  • Inadvertently deleted user folder with terminal command - HELP!

    Hi
    I was using terminal to delete my hosts file using the following command:
    sudo rm -rf /Users/xxx/.ssh/known_hosts
    Unfortunalely, I misplaced a space after the username, and deleted most of my user files. I thought something weird was happening when all the desktop icons dissappeared, and restarted immediately.
    Now I am missing all of my docs, and desktop files. Some things are preserved, like itunes library and iPhoto library. My backup is over 6 months old.
    I took out the hdd, put in an external enclosure, and hooked it up to another SL machine. I ran stellar phoenix overnight, but the recovered files all seem to be weird system files, mostly .plist files, nothing recent.
    Any suggestions?
    Thanks

    ro-76 wrote:
    Thanks for the reply.
    My main backup is over 6 months old.
    then I suggest you start backing up regularly. there is no excuse not to do it.
    I use dropbox to backup the stuff I'm working on at the moment, but not the older stuff.
    I found it strange that I could not recover anything with Stellar Phoenix. Is there something special about deleting using terminal? Does it completely erase the file?
    not unless you use srm which you didn't. but NOT data recover software as you tried is perfect nor can it be expected to be. when you delete a file either from finder or from terminal it's unlinked from the directory but the actual space it's stored on the drive is not immediately overwritten by new data. that's what makes data recovery even possible. however, from that moment on it's treated as free space and can be overwritten at any instant. as soon as this happens data recovery becomes impossible. the only true way to protect your data is to *back up*.
    I'll try Data Rescue 3.

  • I hid a folder with terminal and now I can't get it back.

    Hey guys,
    I used this
    chflags hidden /Users//craigsequeira/Desktop/School Work
    in terminal to hide my "School Work" folder and now I don't know how to get it back!
    Could you guys help me out cause there is a lot of data in there!

    This will bring it back:
    chflags nohidden /Users/craigsequeira/Desktop/School\ Work
    To enable hidden folders/files visibility
    defaults write com.apple.finder AppleShowAllFiles -bool true ; killall Finder
    To reverse:
    defaults write com.apple.finder AppleShowAllFiles -bool false ; killall Finder

  • Locked folder I can't get rid of.

    I was burning a data-DVD of some photos when I hit a snag navigating in Finder, and so I control-clicked on Finder and told it to relaunch. But by doing that, it interrupted the DVD burn. Now, I have a folder on my desktop that is called Untitled DVD that is locked, and I can't get rid of it. I can't unlock it either. When I try, Tiger tells me I don't have permission to do that. I tried to move it so it wouldn't be on my desktop, and instead, it just copied it to another folder. So now I have two of these stupid, useless folders.
    So, any ideas on how I can get rid of these folders? They're not taking up that much room, but they are annoying.

    Delete the locked folder with Terminal (in Applications > Utilities):
    1. Open Terminal window
    2. Type 'sudo rm -rf ' (Not the ' marks, just what is between them. Yes, that is a space on the end. _Do not press enter yet_.)
    3. Drag the offending folder into the terminal window. Its path should be entered after the text you have typed. Click in the Terminal window to switch back into Terminal (from Finder).
    4. Press enter/return.
    5. Type your admin password.
    6. Wait until the prompt appears again (may take some time).
    7. Quit Terminal.
    Follow the above instructions *carefully and exactly* (rm -rf is capable of deleting anything).
    Hope this helps...

  • How do I Rename Mac Hard Drive with Home Folder Only?

    Hello,
    I have a Macbook Pro with an SSD which has OSX Snow Leopard and my Applications, and the other hard drive has my Home Folder. I replaced the optical drive with the SSD.
    The other hard drive has the standard name of 'Macintosh HD'. I need to change it to something without spaces in order to get some developer software to work (i.e., it can't have spaces in the workspace name, and now that my Home folder is on a drive that doesn't have OSX, it refers to it as '/Volumes/Macintosh HD/.../...'
    I ran into a disaster by simply changing the 'Macintosh HD' name to 'MacintoshHD' - It prevented me from logging in and I had to use the OSX Install disk to use the command line to rename the hard drive back to 'Macintosh HD'. My guess is because my account was referencing a home folder location that no longer existed.
    My question is how can I rename my hard drive with my Home Folder? Can I change the hard drive name, and then immediately change my Account to reference the new hard drive name (and thus the new location of my home folder), and then reboot? Will this work if I do this in this order? Or is there another way to handle this entirely?
    I'm very hesitant to try this again as I don't want to have to go back and use the OSX install disk - my SSD took the place of the optical drive and I have to go and take it out, put it back in...etc.
    Any help is appreciated.
    Regards
    Chicago29

    I don't have a setup to test this, but you might try the following:
    Create a second "normal" admin account with its home folder on the boot drive, then log out of your regular account and log into the new one. From there you could rename the large hard drive, then go to System Preferences>Accounts, select the first account, then right-click>Advanced options to change its home directory path to match the new HD name. That way you're not changing the home folder path "in mid-air."
    It's probably a good idea to keep a tiny "self-contained" admin account on the boot drive anyway, so you don't get locked out in the event of future trouble accessing the large disk.

  • Rename a folder with the house symbol

    I would like to know how to rename the folder with the house symbol. I had to recover the hard drive due to a problem. Data were recovered ok, but the name of this folder change and I have several applications working bad due to the do not find the correct path

    Use this with great caution. If you get it wrong you'll need to re-install from scratch.
    Backup all your data first.
    How to enable the root user
    Mac OS X v10.6 and later
        1.    From the Apple menu choose System Preferences....
        2.    From the View menu choose Accounts.
        3.    Click on the lock and authenticate with an administrator account.
        4.    Click Login Options....
        5.    Click the "Edit..." or "Join..." button at the bottom right.
        6.    Click the "Open Directory Utility..." button.
        7.    Click the lock in the Directory Utility window.
        8.    Enter an administrator account name and password, then click OK.
        9.    Choose Enable Root User from the Edit menu. (in the menu bar at the top of the screen)
        10.    Enter the root password you wish to use in both the Password and Verify fields, then click OK.
    To change home folder short name
          1.    Enable the root user. (see above)
        2.    Log in as root. (at the login screen, choose "Other". Username is "root", password as you chose in step 1)
        3.    Navigate to the /Users folder.
        4.    Select the Home folder with the short name you want to change, and rename it just like you would rename any folder. Keep in mind that the shortname must be all lowercase, with no spaces, and only contain letters.
        5.    Use the Accounts pane in System Preferences to create a new user with the short name that you used in the previous step.
        6.    Click OK when "A folder in the Users folder already has the name 'short name'. Would you like to use that folder as the Home folder for this user account?" Note: This will correct the ownership of all files in the Home folder, and avoid permissions issues with the contents.
        7.    Choose Log Out from the Apple menu.
        8.    Log in as the newly created user. You should be able to access all of your original files (on the desktop, in Documents, and in the other folders of this Home).
        9.    After verifying that your data is as expected, you can delete the original user account via the Accounts pane of System Preferences.
        10.    Disable the root user.
    How to disable the root user
    Mac OS X v10.6 and later
        1.    From the Apple menu choose System Preferences....
        2.    From the View menu choose Accounts.
        3.    Click on the lock and authenticate with an administrator account.
        4.    Click Login Options....
        5.    Click the "Edit..." or "Join..." button at the bottom right
        6.    Click the "Open Directory Utility..." button.
        7.    Click the lock in the Directory Utility window.
        8.    Enter an administrator account name and password, then click OK.
        9.    Choose Disable Root User from the Edit menu.
    Make a note of the root password for future reference.

  • My older ibook g4 is locked up with an icon flashing. looks like a file folder flashing a blue and white face/question mark. what is this?

    my older ibook g4 is locked up with an icon flashing. looks like a file folder flashing a blue and white face/question mark. what is this?

    Apple's suggestions for dealing with the flashing question mark folder:
    http://support.apple.com/kb/TS1440?viewlocale=en_US
    Niel has summed it up pretty nicely.

  • Opening a folder with an application in one click, and automating Terminal

    A forum member kindly recommended I move a question from 'Mac OS X Leopard' to this sub-forum as it was more appropriate to Unix:
    Firstly, is it possible to create a desktop/dock icon (or perhaps a Safari or FireFox bookmark) that opens a folder with a certain application? I'm doing a lot of web development and hoping to create handy buttons for opening up entire folders (Ruby on Rails projects) with only one click. At the moment, I have to find the folder and drag it to the textmate icon; if I had a 'open in textmate' button, that would make my work so much quicker, as I'm often changing between projects. It would be even better if I could have the button as a bookmark in my browser (where I spend most of my time).
    Secondly (probably related to the first question), is it possible to automate a process I follow every time I open up a Ruby on Rails project in Terminal (?);
    1. Load Terminal by clicking on the icon in the dock
    2. 'cd sites/rubyonrailsapp' (where 'rubyonrailsapp' is the rails application I want to load)
    3. 'mate .' (opens the entire /rubyonrails/ folder in TextMate)
    4. 'CMD + T' (to open up a new Terminal tab)
    5. 'gitk --all &' (to open up the Wish version control interface for the rails application)
    6. 'autotest' (to runs the tests in the rails application)
    7. 'CMD + T' (to open up another new Terminal tab, ready for me to use)
    If I could follow those steps with only one click, that would be amazing, so any suggestions are much appreciated (I just realised how many times-per-day I'm typing these commands).
    Cheers

    you can try this applescript. just copy it into the Script Editor and save it (1) as a script application that you can double-click, or (2) as a script that you can run from the script menu or quickkeys or etc. may need some tweaking...
    <pre class="jive-pre">tell application "Terminal"
    set cmd to "cd sites/rubyonrailsapp; mate ."
    do script cmd
    activate
    end tell
    tell application "System Events"
    keystroke "t" using command down
    end tell
    tell application "Terminal"
    set cmd to "gitk --all & autotest;"
    do script cmd
    activate
    end tell
    tell application "System Events"
    keystroke "t" using command down
    end tell</pre>
    to solve your other question, you'll probably need to script textmate. something like:
    <pre class="jive-pre">tell application "TextMate"
    open alias "path:to:folder"
    end tell</pre>
    I don't have textmate to test it on, however.
    sorry it's not a unix solution, but the task you're trying to accomplish fits better with applescript.
    Message was edited by: twtwtw - sorry, wrong quote style...

  • File sharing problem with a PC . locked Folder Icons and funny things

    Help was running Tiger fine then upgraded to leopard now my Macbook pro wont shut down properly unless i disconnect all the external USB devices that are attached.
    I also used to be able to write to my shared folder on my Windows PC, this comes up on my mac Book pro now with a locked disk icon on it and i cant save to it. the folders inside it also start changing there icon appearance at will. and some times when i try to save a file to it it keeps telling me the file name is too long even if i change it to only one or two characters .
    would not mind too much but this is my business thats being effected by this . I have tried it on 2 Imac
    Dual core flat panel machine's which still run in tiger and everything is fine with both of these so i know its Leopard that has caused these faults. anyone with any help please let me know .
    ian

    *Same problem* here: MacBook on Tiger was fine, after installing Leo, unable to write on shared pc-folders (lock-icon).
    There are 2 work-arounds I found:
    1. uncheck the "protected" box in the info-panel (Mac) of a locked folder,
    2. if the pc-folder had a custom icon, resetting to standard will unlock the write protection as well. In both cases, the folders on the pc will change their icons... I have to agree that this is a Leopard issue.
    As I use the Mac for work and often have to exchange docs from and to pc's this "bug" is annoying me.
    casp.

  • How to lock a folder with password ?

    Please tell me how to lock a folder with password (to keep personal files)

    Keep looking it can be done. I have a folder on my hard drive that requires a password everytime I try to open it. I found how to do this in an old "Mac OS - The missing manual" but don't remember off the top of my head how I did it. I remember you have to partition a portion of the hard drive, I think I did like 10 Gig of my 1 Teribite external drive and then you give it a name and make up a password. The password is NOT changeable and if you lose it you can't get back in that folder. It appears as a standard folder but needs a password to open it.
    Email me direct if you can't find any info and I will try to look it up - [email protected]

  • Macbook pro folder with question mark blinking appear whent I turn on, When I press the Option key Grey lock screen appear asking for a password, can anyone help me please?

    Macbook pro folder with question mark blinking appear whent I turn on, When I press the Option key Grey lock screen appear asking for a password, can anyone help me please?

    Provide the computer's firmware password. If you don't know what it is, contact the person you got the computer from or Apple.
    (91589)

Maybe you are looking for

  • Output Put Issue - ME9A RFQ

    Hi , I have created on requeset for quotation document with standard document type : AN. I am trying to create the printout from ME9A t.code. it is throughing the following.. error details: No schedules eixst for the scheduling document 600000175. wh

  • Global Container in Java Class of Interface Mapping

    I have written a Java Class that implements the StreamTransformation interface for use in an Interface Mapping. I would like to cache information read from a file between message processing calls of this mapping. It appears that maybe the GlobalConta

  • Adding More TTF Fonts

    I have a fairly large (1000 +) collection of fonts that I finally got around to (trying to) install today. I've done this with several other distros and it's always worked before. cp /mnt/windows/[blah]/fonts/* /usr/X11R[blah]/fonts/myne cd /usr/X11[

  • Easier and better ways to solve current problems with Acrobat?

    Is there no better and easier way to solve the problems (installation, re-installing and crashing) with Acrobat? I really think that the ball is in Acrobat's corner right now, because I should not (for example) need to deactivate and re-activate my s

  • Bose companion 2 speakers with airport express?

    Will these speakers work with airport express? Do I need any additional wires? http://store.apple.com/uk/product/H0832B/A?fnode=MTY1NDA0MA&mco=MTkzMTk5NzE