New answers tagged

0

Use the key code 19 command, because the keystroke "2" command simulate the key code 84 (numeric keypad) instead of key code 19. tell application "System Events" to key code 19 using command down To know the key code of some key, download this application --> https://itunes.apple.com/us/app/key-codes/id414568915?mt=12 But, you do not need GUI Scripting ...


0

There is autossh doing exactly what you need: autossh -M 12345 -N -R 2000:localhost:22 root@my_server_ip But you should certainly reconsider running the tunnel using root account, when it is password-less (unless you have the key limited using authorized_commands).


1

It's System Events that handles the keystrokes. In normal AppleScript the code would look like: tell application "Safari" activate delay 0.5 tell application "System Events" keystroke "2" using command down end tell end tell As an osascript command line, it would be: osascript -e 'tell application "Safari" to activate' -e 'delay ...


0

Way too late, but there's an installer for this as well: https://github.com/martinpaljak/osx-ccid-installer


1

Yes, you could just copy it back, but it may not be bootable. That can be fixed by installing OS X over the top of your files. It should preserve what is there and make it bootable.


1

Don't know if still works on current versions of OS X, but somebody wrote a command line tool to get and set resolutions a few years ago: https://github.com/jhford/screenresolution


1

I know this is old...but I had the same problem, and couldn't find any information to fix this issue, so I decided to share the solution here too. Hopefully it helps someone else. :) After upgrading a Mac from OS X 10.6.8 (Snow Leopard) to 10.11.4 (El Capitan), it would no longer open a shell in Terminal. It would open a Terminal Window with only [Process ...


0

Expanding beroe's answer.. That badge indicates a "beep" that happened while the terminal was not in the foreground. It is a badge per tab, or per window. If you have multiple tabs/windows open you have to click each one to make the number disappear. There should a little bell icon on tabs that have notifications.


5

You can stop the ssh service by typing the following: $ sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist To start it again, use this: $ sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist


8

You can do this without having to install any additional apps or software. Just use the command curl and the free geo ip website http://freegeoip.net Execute the following command in Terminal (I am using Apple's IP for this example): curl freegeoip.net/xml/17.178.96.59 You will get your results in an XML format: <Response> ...


0

This red circle in any application isn't limited to signal a new message. It means that the application had to signal you a new event when no window was active. For some applications this might mean: an update is necessary, an error occured, a new message arrived, an important refresh of the window content occured. In the case of Terminal this might ...


2

That badge indicates a "beep" that happened while the terminal was not in the foreground. To see it, you can send a beep command to your terminal. Type this command, hit return, then click to another window that is not a terminal window: sleep 5 && tput bel Are you saying that it went away (as it should) if you view all open Terminal windows or ...


0

As suggested by this answer, try setting the date to one earlier than the current date. The timezone should not matter at the time of installation.


2

The security command is working as expected, and is following the same keychain access policies that any other program would follow. Accessing a user's keychain is not an admin function -- the user's keychain belongs to them, so admin access is irrelevant. On the other hand, the System keychain (/Library/Keychains//System.keychain) is "owned by" the ...


0

Using tmux version 2.2 or later add the following to your tmux.conf file: bind-key -t emacs-copy MouseDragEnd1Pane copy-pipe "pbcopy" bind-key -t vi-copy MouseDragEnd1Pane copy-pipe "pbcopy"


1

Your PATH environment variable seems to have been changed somewhere. Type the following command at your Terminal prompt: echo 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/bin:$PATH' >> ~/.bash_profile Exit terminal and the shell by typing exit and closing the Terminal app. Relaunch. Everything should be working now.


1

Open Terminal and enter sudo visudo to modify the file /etc/sudoers. Change the part: ## User privilege specification ## root ALL=(ALL) ALL %admin ALL=(ALL) ALL to ## User privilege specification ## root ALL=(ALL) ALL %admin ALL=(ALL) ALL your_username ALL=(ALL) NOPASSWD: /usr/sbin/networksetup and save the file. If you don't know vi: after ...


0

You cannot change the permissions on /usr/sbin/networksetup on a Mac running El Capitan with default settings. In order to that you need to disable System Integrity Protection. Do this by rebooting the Mac, holding down Command + R to enter Recovery mode. In Recovery mode click the Utilities menu and select Terminal. In the Terminal run the following ...


4

on run {input, parameters} is AppleScript syntax, not a valid shell command. If you want to execute AppleScript in the service, use the Run AppleScript action instead of Run Shell Script.


-3

you can export the path as follows: export PATH=$PATH:/bin:/usr/local/bin


1

Another way would be to check which TTY your terminal is attached to and check which shell is running on that tty. Then you could look at the PID (Process ID) and PPID (Parent Process ID) in case your shell has spawned another shell as a child process: MacBook:~$ w 15:16 up 8 days, 16:11, 2 users, load averages: 1.26 1.22 1.24 USER TTY FROM ...


0

When you start a terminal session in OS X the login utility is called. From the man page: The login utility enters information into the environment (see environ(7)) specifying the user's home directory (HOME), command inter- preter (SHELL), search path (PATH), terminal type (TERM) and user name (both LOGNAME and USER). Some shells may provide a builtin ...


1

sudo allows you to run a command at an elevated permission level. You can edit the sudoers file by running sudo visudo One way to do this is to first add a line to your sudoers file which allows the listed commands to be run without a password. By adding the specific command to your sudoers file, you can allow the desired commands to be run without ...


3

Under csh family shells, you'll got your running shell with this command: % echo $shell If csh was run, directly or undirectly, from a Bourne family shell that had its SHELL variable exported, the latter being the common case, the SHELL variable would stay untouched so echo $SHELL will still show the its previous value which would be confusing. This is ...


3

It depends on the shell you are running in. If it is a POSIX confirming shell e.g. bash, ash,ash, sh, and some others e.g. csh, tcsh then echo $0 will return the shell's name e.g. ~ $ bash bash-3.2$ echo $0 bash or ~ $ ksh $ echo $0 ksh However not all shells are POSIX e.g. I used to use ipython shell profile and now fish


-1

It's just ln -s <source> <destination>.


0

I know this question is explicitly asking about the Terminal, but if you're in GUI Land and don't want to enter Terminal Land, you can use SymbolicLinker. This puts a "Make Symbolic Link" option in your Services menu in Finder.


0

Now you can also run a Terminal Command using Powerpack. Create a "Blank Workflow" On the top right corner, click on the plus sign and choose the trigger you want. Click the same plus sign and now choose Actions -> Terminal Command and type whatever command you would like to run


-1

found it. XMenu http://www.devontechnologies.com/products/freeware/ To expand on the functionality I needed: Quickly access a directory while in terminal Solution: create a text file or a clipping with the path of the desired location place that text file or clipping or an alias of either in the specific location /Users/username/Library/Application ...


1

You appear to be using git as a file system back-up. Have you considered git-annex? Learning git git can be tricky to learn and debug. Consider mastering the steps you want via Terminal.app – with the help of the Git Book. BitBucket support provides a wealth of examples and workflows to try and to learn from. Once you trust that process, automating via ...


1

My goal was to copy files to the external hard drive. They are stored in Macintosh HD (I originally thought I will find Macintosh HD in a subfolder of OS X Base System - wrong assumption). There was no Macintosh HD in Volumes folder, because I first needed to unlock it (I use FileVault). First you need to find the lvUUID of your Macintosh HD. Use this ...


1

There's an option called resume I think - check out this post. https://discussions.apple.com/thread/4140495?tstart=0. To quote the answer, you can do System Preferences > General > Uncheck 'Close windows when quitting an application' Not exactly what you want, but it's a possible alternative maybe?


4

Your main volume is encrypted with FileVault and still locked – consequently it doesn't show up in /Volumes. Before being able to mount it you'd have to unlock it: diskutil cs unlockVolume lvUUID #replace lvUUID by the one shown in the diskutil listing You will then be asked to enter the passphrase/password. You have to enter a passphrase or a password of ...


2

When booted to OS X Recovery the root of the Macintosh HD is not /, it's: /Volumes/Macintosh HD/ To get to your Home directory in Terminal, use: cd "/Volumes/Macintosh HD/Users/User_Name" Where User_Name is the name of your User Account. From there you can access your directories such as Documents, Desktop, Pictures, etc. When booting into the ...


5

You may find "Karabiner" app to fit your needs. I have used this app for similar reasons as to swap keys with modifiers. You won't find a per app setting in the preferences. You will, however, find a setting where you can switch the left 'command' key with the left 'control' key ONLY in certain apps (ie. Terminal, Chrome, Emacs, etc.) You can do a filtered ...


14

iTerm2 will let you remap your modifier keys. This has the effect of just remapping them for terminals. Bonus: it's also a better terminal program for OS X than the built-in Terminal.app that ships with OS X. You can alter the modifier keys on a per-profile basis as well. That lets you switch profiles for terminals depending on what you're doing with the ...


2

Shouldn't there be a window showing available files both local and remote server? Shouldn't I be able to drag and drop from local to specific folder on server? I think what you are looking for is an SCP or SFTP (secure copy or secure FTP) with a GUI. SSH (secure shell) is a Terminal or command line interface to your system - it's not a file ...


5

secure shell, ssh, is a command line based method of talking to another computer. By default, there is no graphical interface associated with ssh. Speed The speed of your upload is probably limited by your Internet connection. The protocol used to transfer the files will make a difference but it may not be significant. Domestic quality Internet ...


0

From the iTerm2 web site: iTerm2 has a lot of features. Every conceivable desire a terminal user might have has been foreseen and solved. And these are just the main attractions! iTerm2's feature page highlights the following: Split Panes Hotkey Window Search Highlighted Autocomplete Mouseless Copy Paste History Instant Replay Configurability ...


0

At first: umount -f "/Volumes/Recovery HD" Then: sudo asr adjust --target /dev/disk0s3 -settype "Apple_Boot"


0

14-1/2is interpreted as a date, and tries to help you out. (2016-01-14) There's no way to change this behavior in Reminders.app.


0

I am a computer repair technician of many years, working on macs, windows systems, linux systems. I personally have great success in cloning mac disks using the following technique: Download and boot off of a Ubuntu liveCD. (Same as their install disk, use the 'try ubuntu' option.) open terminal. sudo bash (you're now at a root-level prompt) ...


0

Use sips (scriptable image processing system) to remove an ICC color profile from an image file in El Capitan. sips does a ton of other stuff as well. To remove the ColorSync ICC profile from an image: sips -d profile --deleteColorManagementProperties <imagefile> Example: MyFILE="${HOME}/Pictures/RemoveMyColorSyncProfile.jpg"; sips -d profile ...


1

I can't help with the Google Drive question. I can help with a better backup script. I do backups from local disk to local disk using a tool called rsync that comes installed on every Mac and can be accessed in Terminal or using a script like the one you have. rsync --verbose --ignore-errors --archive --exclude '.*' --itemize-changes --delete --progress ...


1

Here is a bash script that when run, without an argument, schedules the system to wake in 20 minutes and then puts it to sleep immediately. Or you can supply, as an argument, the number of minutes you want it to sleep before it wakes the system. Unfortunately the OS X command line utility pmset, which does the wake scheduling and sleeping, requires elevated ...


2

It is using postfix. At a high-level, when you execute the mail command, the following is happening: Invoking mail drops your message as a file in the postfix maildrop directory, i.e., /var/spool/postfix/maildrop. This happens because mail calls sendmail which calls postdrop which puts the file in the maildrop. The postfix main daemon, master is ...


0

If you hold the function key down you can select and copy to clipboard with apple+c as well.


1

You may first try to find the credentials (or better the blob): security find-internet-password -l "github.com" /Users/user_name/Library/Keychains/login.keychain Then delete them with: security delete-internet-password -l "github.com" /Users/user_name/Library/Keychains/login.keychain If you have several github.com items you have to repeat this. ...



Top 50 recent answers are included