Can't create .bash_profile, help pls
I have macbook pro late 2013 and when I type 'touch ~/.bash_profile' I see:
touch: /Users/dadetka/.bash_profile: Operation not permitted
MacBook Pro (Retina, 15-inch, Late 2013), OS X Mavericks (10.9.1)
I have macbook pro late 2013 and when I type 'touch ~/.bash_profile' I see:
touch: /Users/dadetka/.bash_profile: Operation not permitted
MacBook Pro (Retina, 15-inch, Late 2013), OS X Mavericks (10.9.1)
dadetka,
what does the following command show?
ls -ld@ /Users/dadetka /Users/dadetka/.bash_profile
chflags nouchg .bash*
MacBook-Pro-Ilya:~ dadetka$ ls -ld@ /Users/dadetka /Users/dadetka/.bash_profile
ls: /Users/dadetka/.bash_profile: No such file or directory
drwxr-xr-x+ 15 dadetka staff 510 31 янв 15:21 /Users/dadetka
MacBook-Pro-Ilya:~ dadetka$ chflags nouchg .bash*
MacBook-Pro-Ilya:~ dadetka$ touch .bash_profile
touch: .bash_profile: Operation not permitted
Some of your user files (not system files) have incorrect permissions or are locked. This procedure will unlock all your user files, reset their ownership, and remove their access-control lists. If you've set special values for those attributes, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
Back up all data.
Step 1
If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked
Allow user to administer this computer
Then reboot. You can demote the problem account back to standard status when this step has been completed.
Enter the following command in the Terminal window in the same way as before (triple-click, copy, and paste):
{ sudo chflags -R nouchg,nouappnd ~ $TMPDIR..; sudo chown -R $UID:staff ~ $_; sudo chmod -R u+rwX ~ $_; chmod -R -N ~ $_; } 2>&-
This time you'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
Step 2 (optional)
Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
Boot into Recovery. When the OS X Utilities screen appears, select
Utilities ▹ Terminal
from the menu bar. A Terminal window will open. In that window, type this:
res
Press the tab key. The partial command you typed will automatically be completed to this:
resetpassword
Press return. A Reset Password window will open. You’re not going to reset a password.
Select your startup volume ("Macintosh HD," unless you gave it a different name) if not already selected.
Select your username from the menu labeled Select the user account if not already selected.
Under Reset Home Directory Permissions and ACLs, click the Reset button.
Select
▹ Restart
from the menu bar.
dadetka,
what does the id command return?
Melophage, thank you, the problem solved.
Linc Davis,
thank you very much, the problem was solved with these commands:
{ sudo chflags -R nouchg,nouappnd ~ $TMPDIR..; sudo chown -R $UID:staff ~ $_; sudo chmod -R u+rwX ~ $_; chmod -R -N ~ $_; } 2>&-
But, can you briefly tell me about all of these commands, what do they do?
Waht do '~', '$TMPDIR', '$UID:staff', '$_', '2>&-' mean?
The commands do what I wrote above. I'm afraid I don't have time for a more detailed explanation.
Ok, thanks.
Can't create .bash_profile, help pls