New answers tagged

0

I had the same problem with my Macbook Pro mid 2010. I tried everything, but Sierra installation allways crashed with AMD-Action:downloadProduct:SP error. Then I created install USB with OSX Mountain Lion and it worked flawlessly. I upgraded to Sierra later via App Store.


0

I believe the odd behavior is due to the fact that Terminal.app does not support True Color (16 million colors), while iTerm2 3.2.9 does. Here the result of a test code from here: the top panel is from Terminal while the bottom one is from iTerm.


2

The output of both brew info vim and type -a vim clearly states that Homebrew provided version of vim is not installed on your system. It appears that you have both ex-vi and mac-vim installed which are conflicting formula for vim. Trying to install vim by running brew install vim while ex-vi and mac-vim are installed results in the following error: $ brew ...


2

The final line of your script is using curved quoted instead of straight quotes. “ and ” have been used in place of ". Replace the line send “ssh-add etlbi-master” with send "ssh-add etlbi-master" Look at the syntax highlighting of your script in your question — the ‘string’ is not red but black.


2

I assume you are talking about the .vscode folder in your Home folder, as I have one there too from the Visual Studio Code.app install. If you do not want to permanently show hidden files or use the ⌘⇧. keyboard shortcut, then this is what I'd do. Open Terminal to the directory containing the .vscode folder and use the following command to create a symlink:...


0

This may help you out: Showing hidden files in specific directories? I think it provides a good workaround. Not sure that there is anyway directly to make that one .someFile type not hidden.


2

It is not possible to stop the decryption of the drive while also using the drive. You can unmount and possibly unplug the external drive, and the decryption will obviously stop. However, as soon as you plug the drive in again and mount the file system, the decryption process will continue. You cannot ask the system to stop that. Your options are either ...


0

This is because you updated homebrew, but did not update zsh, use the automator to switch csh, and then manually update zsh. open Finder and search the Automator, then open it. select application and find 'run shell script' in Utilities, then open it. switch to '/bin/csh'. type /usr/local/bin/brew upgrade zsh into the textarea.


-1

Every terminal window you have opened counts as a login. Open more terminals and type the command again and you will see how the number changes.


-1

For me, on OSX, [fn] + [enter] works.


2

Placing alias commands in your bash profile will gain you partial overwrite protection. As others mentioned in your comments, you will need to write a script add the diff function. I placed the commands below in my ~/.bash_profile. Bash on macOS determines what file is your bash profile in this order: ~/.bash_profile ~/.bash_login ~/.profile These ...


1

The system default $PATH variable is set in the file /etc/paths. That file has a one directory per line structure. There are also multiple others files that can set or modify the path variable - user specific configuration files, and shell specific ones, that only apply if you use that specific shell. I suggest not editing the system default file (/etc/...


36

That ls/ directory is not standard on Mac, so its something you or another user on the Mac have created (either directly, or indirectly by being created by some third party program). It hasn't got anything to do with the ls command. However, it could reasonably have been made by someone in the middle of a mkdir command thinking that they should just list ...


2

Save whatever script you wish to a file and when you change the extension to .command Finder will robustly make a command line window that’s new to run that command / script. This works for whatever #!/bin/whatever shell or script you start the text file. AppleScript can open documents just like when Finder clicks on them to open, this should be a fairly ...


2

SOLUTION : uncomment in /etc/ssh/sshd_config : # Allow client to pass locale environment variables #AcceptEnv LANG LC_* (made community wiki; credit to OP)


1

In this particular case, I found that the history had gotten into a strange state. Nothing was present in the .bash_history file, however, there were plenty of saved sessions in the .bash_sessions folder of the user root (e.g. ~). Once inside the .bash_sessions folder, I found there was a file with a GUID and a .historynew extension. Ex: ~/....


1

I'd look into what can be done with applescript using the scripting dictionary. script editor > file > open scripting dictionary I do not know the details of what you are doing but here are some coloring options.


1

Thanks to fd0, I was able to resolve the problem. The output $ type -a du du is aliased to 'du -sh' du is /usr/bin/du makes clear that the command du was aliased to du -sh. By removing this line from my .bash_profile, everything works as it should. The solution e.g. by PeterVP works perfectly fine: $ du -h -d 1


1

You can use the following command (replace PATH_TO_YOUR_APP): defaults write com.apple.dock persistent-apps -array-add "<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>PATH_TO_YOUR_APP</string><key>_CFURLStringType</key><integer>0</...


2

The following script works but it needs to open (and close) a Finder window. Save this to maccopy: #!/usr/bin/osascript on run args set theFile to (POSIX file (first item of args)) as alias tell application "Finder" reopen activate set selection to {} reveal theFile end tell delay 1 tell app "System Events" keystroke ...


0

By default, in zsh, if a wildcard pattern doesn't match anything, zsh signals an error and doesn't run the command. Note that the error comes from zsh, not from rm. This is usually a useful feature, since in many cases, if you use a wildcard pattern, you intend for it to match something. However, in scripts (and more generally in automated processes such as ...


0

I ran (rm -rf ~/.Trash/*) on my MacBook Pro (mid 2012) running 10.13.6 and it hung. I opened up Trash, right-clicked on XCode and opened up Package Contents, then clicked "delete immediately" while the 'rm' command was still running. I saw "deleting 0 items". I terminated the 'rm' command and 'x'd out of the "deleting 0 items" window. Now comes the strange ...


2

du -h -d 1 seems to work on my Mac


1

Do you have several apps that launch during login? This could cause the delay you are experiencing. Go to system Preferences and click on Users and Groups. Once this opens click on the tab "Login Items" and you see a panel that looks like the following: The app names that show up in the window are apps that are set o launch at login. The can prevent these ...


0

Can you delay calling pyenv as that can be slow to run? https://github.com/pyenv/pyenv-virtualenv/issues/132 If you set -x time pyenv init - You can get a feeling for it. Or you could just comment out / delete that one line starting with eval "$(pyenv init -)"


3

With the zsh, the (very sane) default is to error on globs that can't be expanded to existing files. In other shells, the usual default is to leave the glob untouched (which may or may not be the right thing to do depending on the command - and it may very well be a very wrong thing to do). I suspect your Linux configuration has this overridden somewhere to ...


1

Found that I needed xcode to install all dependencies (prompted me when I opened xcode). It seems to be working now..


1

If the only issue you have is that is that Shift-3 should be # then a solution is to change the input source to Australian rather than British. This is a duplicate of my answer on Stack Overflow I assume that you have a Mac UK keyboard so Shift-3 is £. On most other keyboards Shift-3 is # as others have said. The way I get round it is to change the ...


47

First, some important things: Bash isn't going away. If you're already using bash, nothing will change for you. All that changes is that zsh will be the default login shell for new accounts, and even then, you can select bash instead. Scripts are not affected. What changes is the shell for interactive use, i.e. the shell in terminals (and also a few other ...


0

That is the real pound symbol ;) The hashtag one # is opt/3 on a British keyboard layout. If you want the US layout, you'll have to swap to US English.


-3

Shutdown immediately: **sudo shutdown -h now** If you do feel like putting a delay on the shutdown, you can use the following command syntax instead: **sudo shutdown -h +30** (-h parameter set time to shut down, where (+)30 minutes to stop the system)


0

i was facing the same issue, added the root cause of my problem was system overload due to an application launching with every boot - for me the issue resolved with having to wait for about 30 minutes after black screen appears and letting the CPU takes it's time to load - then exiting the application.


5

My shell scripts are really not that complicated Do your shell scripts have shebang lines (begin with #! /bin/bash or similar)? If not, you might have unintentionally been using a bash feature, where it runs scripts without a shebang using bash. Other shells, like dash or zsh, leave it up to the OS, which would usually use /bin/sh instead. /bin/sh on macOS ...


13

Change your shell now and test - no need to wait. chsh -s /bin/zsh All the scripts that depend on bash syntax will still find and call bash. the same bash from Mojave is shipping on Catalina and migrated users keep their old shell. Also, I would estimate 95% of macOS users don't use a command line and of those that do, another 95% won't have to change ...


1

Typical users shouldn't do this, but you're not typical are you? Two issues: You can't stop root. If you insist on using root, then root can overwrite brew.sh no matter what. You can't stop brew, after all, you're talking about running brew. So we'll work with that. Let's setup an alias to copy over brew.sh then run brew. alias brew='cp /<modified>/...


-1

If you just need to copy modification date to creation date on same files you can use my modified script: #!/bin/bash for f in *; do cDate="$(GetFileInfo -d "$f")" mDate="$(GetFileInfo -m "$f")" SetFile -d "$mDate" "$f" done


0

Copy and paste the following command into the Terminal window: defaults write com.apple.finder AppleShowAllFiles -bool true killall Finder This command will restart the Finder and then you will see hidden files and folders on your Mac.


1

I've had the same issue. I don't know if it's encouraged, but you can use the "-w" flag to "allow destructive actions." This seems to have fixed the issue for me. However I have no idea what the consequences are. I'm running a very simple script though, so I'm reasonably confident that I'm not doing anything that is very "destructive." This was hard to find,...


1

Setting the default profile does not mean that it will launch with the new window on startup. You need to set that in the General preference on startup, open: New window with profile: [YourProfile] is there a config file where I can change the theme manually? Yes, you can edit the ~/Library/Preferences/com.apple.Terminal.plist in XCode (it's a binary ...


0

I using this for file in *; do echo mv \""$file"\" \"`echo $file | tr -cd 'A-Za-z0-9_-.[] '`\" ; done removing the echo in front of mv "$file" executes the command.


0

there is not have Accessability menu in System properties. Look closer. Accessibility should be at the end of the fourth row of icons in System Preferences. If you don't have any third-party preference panes installed, this will be the bottom row. The icon looks like this:


1

You can schedule shutdown's and restarts directly from within ARD, no scripting needed.


0

Your command ping -c 3 www.google.com should have produced 3 internet response packets of the type ICMP ECHO REPLY. The ping command sends ECHO packets using the ICMP protocol, and the responses (if any) are ECHO REPLY packets. The curl command on the other hand, sends HTTP packets using the TCP protocol. Since the latter works and the former doesn't, there ...


2

A directory can become a "Package", if the bundle bit has been set for some reason by either another program, or the user. "Kind: Package" will then be visible in the "Get Info" window and it can be opened by the application set in the same window. Some applications prefer (or create) a package instead of a directory, which can be double clicked to open a ...


1

If you want to run sudo command with ARD select run command as User and written root. Edit : It doesn't have to go through the osascript to turn it off. A shutdown -h now with root user is enough You can also shutdown the station via the Manage menu


1

Open bash_profile using command: open ~/.bash_profile and add the following lines: export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " export CLICOLOR=1 export LSCOLORS=ExFxBxDxCxegedabagacad alias ls='ls -GFh' then source bash_profile using: source ~/.bash_profile


3

I managed to eventually find the settings to stop this behavior. In Terminal, it was Preferences -> Profiles -> Keyboard and check the box for "scroll alternate screen" In iTerm2, it was Preferences -> Advanced -> set "Scroll wheel sends arrow keys when in alternate screen mode" to Yes.


5

I prefer to use the system configuration utility tool to test for reachability instead of using ping / host / nslookup or another proxy for determining if a network entity is or is not reachable. scutil -r google.com Reachable The benefits of this are that if you have VPN connections, dial up, modem, or a routing conflict, this will actually test that you ...


1

No, it is not usual to experience "really slow performance" on MacOS Extended (Journaled, Encrypted) file systems (also known as HFS+ encrypted). That configuration is extremely widely used, so any intrinsic problems here would have been reported in huge numbers. I have been using Git-LFS on such a file system for a very long time, and never experience any ...


4

Your problem is that you're using invalid options for the ping command. It seems likely that you have copied a command line intended for use on Linux, and tried to use it unmodified on macOS. The specific problem here is that Linux uses "-w" to specify timeouts, whereas macOS uses "-t". This means that your command line should instead be this: ping -q -t1 -...


Top 50 recent answers are included