Tag Info

New answers tagged

1

I would suggest installing the GNU Core Utilities via Homebrew, which will give you the "Linux" version of ls (instead of the FreeBSD version that ships with OS X), as well as other powerful tools brew update brew install coreutils You should then be able to show colors with: gls --color Additionally, read the caveats to configure your PATH so you can ...


0

If the path includes spaces, you're going to need to quote it. Your line export PATH=/Users/ps1/Documents/PS 1/whatever-else/:$PATH causes Bash to interpret the PATH=/Users/ps1/Documents/PS part as the full first argument to your PATH—telling export to set the PATH to only the section before the space. If you use export "PATH=/Users/ps1/Documents/PS ...


1

The ; and && are interpreted by bash on the local machine. You can see this by running ssh 127.0.0.1 -t env && env: the second time, there will be no SSH_CONNECTION variable. You can quote the entire command to get it to work properly: ssh -t $host 'sudo softwareupdate -ia && sudo shutdown -r now' In my opinion, -t should only ...


0

I am not sure about the reboot issue, but setting up a script to run sudo commands without inputting the password is fairly easy. Take a look at Step 4 of this answer I previously wrote (it was for something else entirely, but the steps to enable running sudo without a password are universal). Note that actual command to run your script will change to sudo ...


0

I have been trying to find a solution for this problem. What I am doing right now, is resizing the window to it's max without maximizing :(


1

find expects a pattern not just a name, so you might get better results with find /Volumes/AUDIO\ DRIVE/Music\ Database -name '*(1).mp3' -print


1

In essence, all commands you had in your Brewfile can be used in a bash script. If you want to have a single file for your packages listing, one per line, and read it from your bash script, you can do brew install $(cat my-file-with-dependencies). Suppose you have in brewfile-basic: hub git-extras bash-completion Now create brewbundle.sh: brew install ...


0

The first prompt you show a picture of looks like a customized version of a powerline oh-my-zsh theme. It requires oh-my-zsh. There is also a version that supports bash, zsh, and fish. To use those, you need a Powerline-patched font. Your second screenshot comes from dracula-theme, a color scheme and prompt for lots of different editors plus oh-my-zsh. ...


1

You can do so by checking for the existence of the launchd files in /etc: [[ -f /etc/RemoteManagement.launchd ]] && echo 'enabled' || echo 'disabled' or for screen sharing: [[ -f /etc/com.apple.screensharing.agent.launchd ]] && echo 'enabled' || echo 'disabled'


0

You can check if rfb port is opened (5900) with: netstat -atp tcp | grep rfb


1

You can try something like this: launchctl setenv VARIABLE VALUE open -a IntelliJ\ IDEA\ 11 launchctl unsetenv VARIABLE This will pass environment variable VARIABLE into the launched app and later it will be cleaned, but will remain in the app.


0

I also had an alias messing up with -f, call cp directly from /bin and all is fine, having an alias that prevents accidental overwrites/removals by default is pretty good, so best not remove it. .# alias alias cp='cp -i' like already stated, the -i flag superceedes -f, which wouldn't allow below command to perform as intended. .# /bin/cp -fauv ...


0

oh-my-zsh is an open source, community-driven framework for managing your Zsh configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout… Github Project Themes


0

I just realised you need to restart the device for it to take effect...


0

I guess there might be easier way, but it works for me: #!/bin/bash TRESHOLD=10 while $(true); do time=$(ping -c 1 google.com | grep time | cut -d ' ' -f 7 | cut -d '=' -f 2 | cut -d '.' -f 1) if [ $time -lt $TRESHOLD ]; then echo "Less than $TRESHOLD ($time), continue" sleep 1 else echo "More than $TRESHOLD ...


3

You should remove the line: source .bash_profile from your .bash_profile. This line is causing the infinite loop by continuously loading the file. As you have discovered, repairing permissions will not solve this issue. Since you can't access terminal, you can edit your .bash _profile in TextEdit. Here's how to do so: Open TextEdit Application and ...


0

Simply use Spotlight in Finder to search for files with *(1).mp3 etc. Begin a new Spotlight search, add a Raw Query rule and use the following, then select all and delete. kMDItemDisplayName=='*(1).mp3'


1

You have to modify the menu title to enter the exact name of the menu command you want to add.


0

OS X, like other UNIX-iod systems, implements two systems of pseudo-terminals: the pty system and the ptmx system (links are to the kernel source used in 10.9.5). They both ultimately offer the same functionality: they let one program (e.g. a terminal emulator) open (the master side of) a pseudo-terminal and subsequently start other programs (e.g. a shell) ...


0

Time Machine handles its own space requirements; it should never need manual intervention. Maybe try something like Disk Drill or Data Rescue


0

output=$(hdiutil verify "$f") echo "$output"


0

RVM controls which Ruby your current shell points to, but it doesn't install a user-controlled Ruby for you by default. If you haven't installed any specific Ruby versions via RVM, the only Ruby you have is the one OS X installed and that requires sudo permissions to write to. You can see available Rubies with: > rvm list rvm rubies =* ruby-2.1.2 [ ...


0

While I don't know what exactly happened, turns out if you won't launch this from tmux -- you'll be just fine. // thanks https://github.com/atom/atom/issues/3093


0

That command is trying to install the gem in the global directory (available to every user on the computer), if that's what you want then execute the command with sudo. But if you just want to install rspec you can do gem install rspec. You can check if you are using the gem executable from rvm by doing which gem if it shows a function then it's from rvm. ...


0

The command should be: $sudo mv /Users/oldname/Library/Containers/com.apple.BKAgentService/Data/Documents/ibooks/books /Users/newname/Library/Containers/com.apple.BKAgentService/Data/Documents/ibooks/books This is assuming that there was not an existing user "newname" with it's own uid. Then you may run into permissions problems. Hope this helps!


1

tell application "System Events" to picture of desktop 1 View all properties: tell application "System Events" to get properties of every desktop


0

Personally, I'm using Oh My Zsh for adding color and other tricks to my Terminal. I think that is the easiest way. oh-my-zsh is an open source, community-driven framework for managing your Zsh configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout…


1

I've been looking for a way to bookmark SSH commands and eventually I developed a Mac app for our team, called TaskTips (https://task.tips/). Basically it can save you time by indexing your SSH commands, and autocomplete when you search SSH tasks, executing tasks automatically. If it is also helpful for someone else, I would be really happy about it.


1

The issue is that your PATH is messed up. The reason why echo works is because it is a builtin command in the shell so the shell does not use your path to find the executable. You need to see what script file had an export PATH in it which set it to “users/ZILLURRAHMAN/desktop/bioinformatics/bow-tie/bowtie2-2.2.3/BT2_HOME:?? which has many error in it. The ...


1

You may need to run the command as root : sudo hdiutil compact <sparseimage>


2

That is called the visual bell, and by default it’s enabled when your sound is muted. To change that setting, go into Terminal > Preferences > Profiles > <your profile> > Advanced. You can also run echo $'\nset bell-style off' >> ~/.inputrc to disable Readline's use of the bell (deleting on an empty line, tab-complete, etc.). You will need to ...


1

The contents of my /usr/local/bin folder are pictured below. Excluding wireshark and noip2, those are the files that you should have. FYI, I'm running OS X Mavericks 10.9.5 (Build 13F34)


0

Most GUI Applications don't touch /usr/local/bin, so the Applications in your /Applications folder should still be in working condition. Some do install command line tools, but usually there is a menu item in the help or program menu to reinstall that command line item. Bottom line: If you don't use the command line much, you should be fine. If you use it ...


6

You can use screen. This allows you to set up new screens in your shell which you can switch between. Quick reference guide: ctrl-C creates a new screen ctrl-N switches screens ctrl-D ends screen


5

The easiest way to run a command in the background is to put an & at the end of the command. It will start, and return you to the prompt immediately. Another way would be to suspend the current process with CTRLz, and type bg, the corollary to the fg command you already looked up.


1

I was under the impression that .bundle files are actually folders - in your terminal application, try typing the following: cd archive_name.bundle ls For example, on my end: $float:Plug-ins string$ cd IMDB.bundle/ $float:IMDB.bundle string$ ls $Contents README.md


0

Here's a cool one that I use in a ruby script on OS X (so that I can start a script and get an update even after toggling away from the window): cmd = %Q|osascript -e 'display notification "Server was reset" with title "Posted Update"'| system ( cmd )


2

services was a "hidden" command in Homebrew. There were a bunch of them that weren't present in the brew help output. It has, as undocumented commands are wont to do, gone away in the official repository and has become an "external command" maintained in another add-on repository (in this case a gist as it is so simple). You can install it in your Homebrew ...


10

Open Keychain Access from /Applications/Utilities and search for AirPort. All the network passwords are listed as 'AirPort network password' entries. Double-click an entry, then select Show Password and enter your login password to view it.


0

To execute inside the Install OS X Mavericks.app/Contents/MacOS folder use "./Install OS X Mavericks" (with quotes because has spaces in it) but it looks like the installer thinks it's reinstall that will not read the installation files in the drive. It will simply redownload the components required (5GB again) The SD Card/Flash Drive/'whatever that you ...


0

osascript -e 'tell application "iTerm" to activate' -e 'tell application "System Events" to tell process "iTerm" to keystroke "t" using command down' -e 'tell application "System Events" to tell process "iTerm" to keystroke "ls"' -e 'tell application "System Events" to tell process "iTerm" to key code 52'


0

Mark, you are 100% right! I have no idea how those characters got into my /.bash_profile, but they did! So I just went in there and removed them and now all is working correctly. Thanks again!


1

What the terminal prompt is showing you is not the home folder name, but the user name. The folder is displayed after the machine name, in the ~ highlighted below: name-mbp:~ old-home-folder-name$ Folder ^ ^ User name You can type the command pwd ("print working directory") to see which folder it is currently in. Or you can type the command echo $HOME ...


0

Messages supports AppleScript. You can view the Messages's AppleScript dictionary using the AppleScript Editor: Applications > Utilities > AppleScript Editor.app The AppleScript command log in suggests you can sign in programmatically: log in v : Log in to the specified service, or all services if none is specified. If the account password is ...


0

"Command not found" indicates that the brew binary isn't on one of the directories listed in your PATH environment variable. To check what your path is currently, run echo $PATH. By default, brew installs to /usr/local/bin. To set the path permanently, you should edit your ~/.bashrc file to contain the line export PATH="/usr/local/bin:$PATH".


0

Thanks to @MateusvSzlosek, The following one-liner works: echo `date`@`system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}'` >> output.txt


1

There are a variety of ways to hide things in Mac OS X. Note: if you do any of these you most likely do not need to use the .noindex extensions since files hidden from the finder will not be typically be shown in Finder Spotlight searches. chflags hidden fileToHide (as already mentioned) does this by setting OS X file attributes. use the Unix style period ...


1

In the command line use: chflags hidden fileToHide To show files again chflags nohidden ...


1

I think what you're really looking for is context-aware tab completion for Bash commands. For example, .DS_Store is a regular file, not a directory, so it should not show up as a possible completion to cd. The package that solves this problem is called bash-completion. I use Fink's version (fink install bash-completion), and it's also available from ...


2

⌘ + ⇧ + arrow keys is also a valid option. Enjoy!



Top 50 recent answers are included