New answers tagged

0

I have completed the same with below string : compName=${loc::9}; which actually removes 9th character of the stored variable .


1

To enable passwordless sudo for all admin users on the machine: Run sudo visudo Change the line reading %admin ALL=(ALL) ALL to %admin ALL=(ALL) NOPASSWD ALL Save changes (press Escape, type :wq! at the command prompt and hit enter).


2

Was brave enough to do it myself. For future readers, add: yourusername ALL=(ALL) NOPASSWD: /usr/sbin/systemsetup after ## User privilege specification ## root ALL=(ALL) ALL %admin ALL=(ALL) ALL


0

The linked how-to works almost perfectly with some exceptions and modifications because of newer Python and OpenCV packages. Probably your PATH variable got corrupted by accident or an unwanted command. You may always check the current PATH variable with /bin/echo $PATH. It should yield: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin before installing ...


1

You can find Moom app preferences on the following file: ~/Library/Preferences/com.manytricks.Moom.plist That file is not in clear text. But you can use plutil to convert and read it in the following way: plutil -convert xml1 -o - com.manytricks.Moom.plist


0

The unix command to search for files is find. You can use the command man find to get more information. The usual form is the following. find <starting folder> -name <file name> -print For example, if you are looking for all mp3 files in the current folder and all nested folders, use the following command. find . -name "*.mp3" -print ...


0

The locate database in built by the script /usr/libexec/locate.updatedb. The script is run by the user nobody in this line tmpdb=`su -fm nobody -c "$0"` || rc=1 unless the user nobody has access to a directory then the content of that directory is not recorded in the database. A simple solution would be to use mdfind. mdfind -name connections.xml


0

You need to make sure the daemon is running on your machine: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist Alternatively you can also run the following command and build the database: sudo /usr/libexec/locate.updatedb Note, that indexing of files from the filesystem would take a while, so locate will not show you all the ...


0

Nothing is wrong with locate. By default, it doesn't search for/in hidden files/directories. The directories /.metadata and /.plugins are both hidden by the fact they are prefixed with a period "." which means that locate is not going to index the files within those directories. I prefer to use the find command: sudo find / -name connections.xml


1

I had to do the following steps in order to make it work. # Change working directory cd ~/.ssh # Remove the old public key rm id_rsa.pub # Create a new public key ssh-keygen -y -f id_rsa > id_rsa.pub # Change permission chmod 600 id_rsa* # Add the key to ssh ssh-add id_rsa # Then finally test it (I used github) ssh -i id_rsa.pub git@github.com The ...


0

As mentioned in @bdesham’s answer, Zsh 5.1 introduced the use of the terminal's “Bracketed Paste Mode,” which allows terminal-based programs to differentiate pasted/dragged text from the user typing individual characters. Terminal (at least as of OS X El Capitan 10.11.x) doesn't perform shell-quoting of pasted/dragged file pathnames when Bracketed Paste ...


0

In El Capitan, you can set the formatting in Terminal app. Simply select Edit -> Copy Special and select Plain Text for no formatting or you can create a profile that looks good when pasted in a document.


0

the login command is used to login to the unix system of OSX. to learn more about it type man login As an example if you have a terminal window open and you are also logged into the GUI desktop you are logged in 2 times. you can see how many sessions you have open by typing uptime example: 7:52 up 23:49, 2 users, load averages: 1.43 1.53 1.50 the ...


2

When you wake a Mac from hibernation, RAM got written to disk and power removed from memory. Then, at wake, it gets read back into RAM. This takes longer than normal, or standby sleep (depending on the delay set) and is visible at wake time by showing an Apple symbol and progress bar underneath (white time markers filling up). Also running the following ...


0

No need for command line... Add all the images to be renamed into a folder. Select all files, right click mouse and select "Rename x items" Select "Add text" from first drop down menu Select "Before name" from the second drop down menu Enter "Vacation_" into the text box (without the quotation marks) Press Enter.


-1

Open a command line and type uptime. It will tell you how long since you last rebooted, which doesn't count sleep or hibernating.


1

I had previously gotten the Error 43 on my Mac. So I searched the Internet and found this article: How to Fix Error 43 Mac. To fix, what you need to do is basically two steps Reset the PRAM. From a powered off state, hold ⌘ Cmd ⌥ Option P R until you hear the startup chimes 3 times, then release and allow your system to boot normally. (Optional) ...


0

Try to uncheck Store passphrases in OS X Keychain by default and press Delete stored passphrases button in GPGPreferences if you installed GPG Suite. Also try to comment this line from your ~/.gnupg/gpg.conf: use-agent


1

I don't think you can. The information that you can get is available via System Profiler: system_profiler SPUSBDataType, which on my Macbook returns: Apple Internal Keyboard / Trackpad: Product ID: 0x0259 Vendor ID: 0x05ac (Apple Inc.) Version: 2.24 Speed: Up to 12 Mb/sec Manufacturer: Apple Inc. Location ID: ...


2

@Feanux I was answering your question and then you deleted it but I see you reposted it, anyway I have made a Automator app that does this and will attach a screenshot (that was taken by Automator). As you can see it takes two screenshots, one for clipboard and one for preview/save UPDATE:


0

You can try the memory_pressure command. See the following output of my system (i5, 4 Gb RAM): The system has 2147483648 (524288 pages with a page size of 4096). Stats: Pages free: 90009 Pages purgeable: 139593 Pages purged: 7496548 Swap I/O: Swapins: 470466 Swapouts: 530913 Page Q counts: Pages active: 407739 Pages inactive: 148277 Pages ...


0

If your shell is bash or zsh, open your ${HOME}/.profile (not your .bashrc since you don't have to do this setting on any subshell you will run) with gedit or vim. Insert the following line: EDITOR=/Applications/gedit.app/Contents/MacOS/gedit export EDITOR ( You don't have to change your PATH for this and moreover this might cause other side effects ...


1

You can pipe the output from vmc to the xargs command line tool. This will look like: vbm list vms | grep Fred | vmc | xargs -I {} vbm control {} poweroff You'll avoid assigning the output to the variable.


2

One way is to accomplish what you're asking is: After you've executed vbm list vms | grep Fred | vmc, and you want to immediately set the output of that commend to a variable, just type, e.g.: vm=`!!` Then press enter. To remove the $vm variable, use: unset vm


2

What if you used a function defined in one of your bash startup file? getvmid () { /Applications/VirtualBox.app/Contents/MacOS/VBoxManage list vms | grep $1 | cut -f 2 -d { | cut -f 1 -d } } The $1 is the first parameter of the function. It also limits the scope of the variable. getvmid Fred Setting the variable: vm=$(getvmid Fred) Untested but this ...


0

I think it has something to do with whether the terminal echo option is disabled. I tried running stty -echo; cat; stty echo in my terminal and then typing something, and the key symbol showed. I then pressed Ctrl+D and it went away.


2

What you're seeing here is some fancy behind-the-scenes scriptery that Apple added in OS X 10.11 to set the Terminal window title based on the current working directory. Since set -x shows what commands are being executed by bash, it also winds up showing all this normally-behind-the-scenes stuff (in painful detail). It's fairly easy to disable it, though: ...


0

The place to look is the bash manual This includes Using ‘+’ rather than ‘-’ causes these options to be turned off. So try set +x


2

If the output is from a command you are running, you can pipe the output to the head command. $ ls -l | head -n 10


2

The command you want is head so for a command x and the first 20 lines you enter x | head -n 20 This runs x and pipes the input into the head command.


1

Here's a fish shell script I wrote: function netinfo -d "get network information" # Get public ip address set public (curl -s http://ipecho.net/plain) # Let's account for possible lag in reply from ipecho.net sleep .3 if test -z "$public" # No Internet connection set public "No Internet connection available" end echo " " echo " Public IP: ...


2

No. You're downloading a chunk of data from a server, and other activity on the device will not affect the content of that data. It's the same as downloading something on your laptop. The system sounds that your laptop plays do not affect your download of the Google Chrome installer or whatever. As a imperfect analogy: If I wanted to communicate a story ...


-1

You can use the following command $ sudo find / -type f -size +1G In case you want to avoid traversing mounted drives, your command should be: $ sudo find -x / -type f -size +1G


2

I found this way more beautiful: edit ~/.bash_profile file and add alias chrome="open -a 'Google Chrome'" Now save the file and restart the terminal. You can now use commands like chrome file.html


0

Say you are looking for big files in your home directory, use this command: find ~ -size +1G Replace ~ with the directory of interest. Update My original response was wrong, but I'll keep it to remind myself. If you are trying to get the size of a file, try this: stat -f '%z' filename # Normal file stat -L -f '%z' filename # symbolic link file I ...


0

Finally I found a solution using bash-preexec. That utility have the following function: precmd Executed just before each prompt. Equivalent to PROMPT_COMMAND, but more flexible and resilient. To install bash-preexec: brew install bash-preexec Then I have to add the following to my .bash_profile: if [ -f $(brew --prefix)/etc/profile.d/bash-preexec.sh ...


0

There are more utilities of this kind available. E.g. Go2Shell is also a possibility.


0

Add the following line to your .bash_profile: export PATH=/usr/local/bin:$PATH To be sure that will work, restart the terminal and then: echo $PATH This will output your PATH variable. The order of directories in PATH variable matters. So, in order to work as you mention, the result should start with /usr/local/bin:


1

You can permanently assign an app to a Space by right-clicking the app in the dock > Options > Assign to... This Desktop. A faster way to move it to any given Space is to grab the window's title bar, then use your regular shortcut to switch to the desired Space. By default that would be Ctrl ⌃ [number] See System Prefs > Keyboard > Shortcuts > Mission ...


2

Another option is to install wget (e.g. with Homebrew), which has more user-friendly defaults than curl, including displaying an ASCII-art progress bar. For example: > brew install wget > wget google.com Saving to: 'index.html' ... index.html [ <=> ] 10.32K --.-KB/s in 0.001s 2016-05-17 12:55:06 (8.08 MB/s) ...


0

Open Terminal on your Mac and enter the following command: curl -O <URL for download> That is a capital "O" not a zero. Here a nice site with some terminal commands you might like to use.


1

The temporary workaround to this It is possible to remap keys on any program in System Preferences > Keyboard > Shortcuts > App Shortcuts. Click the plus icon, and select terminal in the application drop down. Then type the name of the function (Copy in this case), and then highlight the shortcut box, and press a desired combination. The window should ...


0

Check the stty setting and make sure 'e' didn't accidentally get set as the backspace or similar. Been there, done that. Stty something \e Would do it The recommendation to disable/comment out .bash* would also probably uncover it.


-1

There is a windows tool called GooPs http://goopstechnologies.com/?page_id=12 which handles some similar tasks. You can also make a placemark that reads coordinates from a file and refreshes every second. https://stackoverflow.com/questions/7249565/how-to-properly-update-google-earth-kml-using-networklinkcontrol-and-the-java-ap


-1

It worked for me. sudo chgrp -R admin /usr/local sudo chmod -R g+w /usr/local


0

I have faced similar problem on one of the Macs in my office. I couldn't solve it directly, so I chose to delete the account, by backing up of all the important folders/files into another partition. Alternatively, you may move it out of the home folder to another folder (e.g. /Users/Shared/) temporarily. I deleted the user account and created a new one, ...


0

Looks like one of bash's session files got corrupted. rm /Users/admin/.bash_sessions/* should fix this.


5

I'm going to post this as an answer, even though it's not the one you probably wanted... Your issue is that you have one app spread to two Spaces. There is no fix for this at present, short of duplicating the app & re-defining it at OS-level to be recognised by the System as an independent app [which, as I understand, must be done at compile. I'm not ...


0

Old question, but I'll answer it anyway: This message is from JAMF's Casper Suite. You can remove all the JAMF nonsense with either sudo /usr/sbin/jamf removeFramework or sudo /usr/local/bin/jamf removeFramework (depending on the version installed).


1

I was able to do it two different ways: First, drag and drop the folder directly into the window you want the path copied to by clicking and dragging the folder, using Cmd+Tab to open the Terminal window you were working in, then dropping it on the Terminal window. Second, drag and drop the folder onto the Terminal icon in the Dock like you were before, ...



Top 50 recent answers are included