Q: Can you save a terminal command or must it be entered every time the computer restarts? I have missing share options with El Capit ... Can you save a terminal command or must it be entered every time the computer restarts? I have missing share options with El Capitan. more
-
All replies
-
Helpful answers
-
Oct 16, 2015 7:10 AM in response to ah_millarby Niel,Choose Utilities from the Finder's Go menu, open the Script Editor, enter the following:
do shell script "command goes here"
Save it as an application, open the Users & Groups pane of System Preferences, and set it to run upon login. If the command requires sudo, remove that and append ' with administrator privileges' to the line.
(135006)
-
Oct 16, 2015 7:49 AM in response to ah_millarby Luis Sequeira1,ah_millar wrote:
I have missing share options since installing EL CAPITAN. The advice is to use terminal command. However it needs to be entered every time the computer restarts. Is there a way of saving the command in Terminal or some other option?
If I understand correctly, you were given advice to run some Terminal command every time you start your mac, in order to fix some problem.
This is NOT a good advice.
1) Maybe you should describe exactly what the problem is, so we can try to help
2) If a certain command should be executed every time, it should be placed appropriate so the system knows it must be run. It is absurd to tell a user he must enter and reenter a command every time the machine is started.
-
Oct 16, 2015 9:26 AM in response to Luis Sequeira1by ah_millar,After installing El Capitan, the share menu in PHOTOS and Safari have several items missing including share by email. Apple Support (If Share options or Markup is missing after upgrading to OS X Yosemite or El Capitan - Apple Support) says to go to Terminal and paste . . .
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -seed ... However every time the computer starts it needs to be input once again. Thanks
-
Oct 16, 2015 9:49 AM in response to ah_millarby FatMac>MacPro,ah_millar wrote:
...Is there a way of saving the command in Terminal or some other option?
Try opening Terminal and, at the prompt, hit the up-arrow key. The most recent command used should appear (at least it does for me). If you've used other commands since, keep hitting the up arrow to get to the one you want.
Alternatively, type the command in TextEdit and save it, then each day open the file, copy the command and paste it into Terminal. That command certainly is a lot to type each time.
-
Oct 16, 2015 10:22 AM in response to ah_millarby Linc Davis,Problems such as yours are sometimes caused by files that should belong to you but are locked or have wrong permissions. This procedure will check for such files. It makes no changes and therefore is not, in itself, a solution.
First, empty the Trash, if possible.
Triple-click anywhere in the line below on this page to select it, then copy the selected text to the Clipboard by pressing the key combination command-C:
find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 \) 2>&- | wc -l | pbcopy
Launch the built-in Terminal application.
Paste into the Terminal window by pressing command-V. The command may take a noticeable amount of time to run.
Wait for a new line ending in a dollar sign ($) to appear.
The output of the command will be a number. It's automatically copied to the Clipboard. Please paste it into a reply.
The Terminal window doesn't show the output. Please don't copy anything from there.
-
Oct 17, 2015 2:35 AM in response to ah_millarby Luis Sequeira1,ah_millar wrote:
After installing El Capitan, the share menu in PHOTOS and Safari have several items missing including share by email. Apple Support (If Share options or Markup is missing after upgrading to OS X Yosemite or El Capitan - Apple Support) says to go to Terminal and paste . . .
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -seed ... However every time the computer starts it needs to be input once again. Thanks
If this does not stick through a computer restart, then there are other issues involved. You may create a little application that calls this command, and put it in your login items, so it is run automatically, but it shouldn't have to.
-
Oct 17, 2015 5:37 AM in response to Linc Davisby ah_millar,Thanks!
I followed your instructions but when command had completed no number appeared.
-
Oct 17, 2015 6:33 AM in response to ah_millarby Linc Davis,As I wrote earlier, the output is not in the Terminal window; it's copied to the Clipboard. Please review the instructions and try again.
-
Oct 17, 2015 7:33 AM in response to Linc Davisby ah_millar,Sorry . . .
The number in the clipboard is: 3579
Many thanks
Alan
-
Oct 17, 2015 9:05 AM in response to ah_millarby Linc Davis,Some of your user files (not system files) have incorrect permissions or are locked. This procedure will unlock those files and reset their ownership, permissions, and access controls to the default. If you've intentionally 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, but you do need to follow the instructions below.
Back up all data before proceeding.
Step 1
If you have more than one user, and the one in question is not an administrator, then go to Step 2.
Enter the following command in the Terminal window in the same way as before (triple-click, copy, and paste):
sudo find ~ $TMPDIR.. -exec chflags -h nouchg,nouappnd,noschg,nosappnd {} + -exec chown -h $UID {} + -exec chmod +rw {} + -exec chmod -h -N {} + -type d -exec chmod -h +x {} + 2>&-You'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. 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.
Start up in Recovery mode. When the OS X Utilities screen appears, select
Utilities ▹ Terminal
from the menu bar. A Terminal window will open. In that window, type this:
resetp
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.