New answers tagged

1

Take a look at iCloud Photos Downloader it is a command line interface for iCloud Photos based on Python. To install, you can type pip install icloudpd should the requirement of Python 2.7.x or 3.6.x be met. If you use Python 2.6.x will fail. If you require Python, I reccomend using Homebrew Package Manager, which is known for being easy to install ...


1

This should work on most versions #!/bin/bash PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin "/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession" -suspend sleep 5 pmset sleepnow osascript -e 'tell application "System Events" to sleep' exit 0 The -suspend line will switch to the login screen (which takes a few seconds, ...


2

Bob’s user can send a Kill signal to all their processes. sudo su - bob kill -9 -1 This leaves all non Bob processes running and sends the non maskable SIGKILL to all processes by that UID. On newer os, some processes will respawn as uses Bob, but you’ll have cleaned them up momentarily and the old session will be gone.


2

I'm one of the creators behind CommandPost. CommandPost is a free and open source Mac application that allows you to seriously speed up your creative editing process through powerful and customisable automation tools. Think Apple’s Automator, with a little bit of BetterTouchTool and Keyboard Maestro thrown in, but specifically designed for creative ...


4

The path you gave rm to delete was /./*. Let’s break this down: / The root mount point, such as Macintosh HD. This is the root of the disk, therefore an absolute path was given rather than a relative path operating on the current directory. ./ The current directory, which is now / by the path given so far. /. is equivalent to /, so // is the path so far, ...


3

I know this is late, but the solution here may work for others with similar roommates. I am thinking that your hostname is properly set, but that your prompt definition may have been pranked. First check is to run 'echo $PROMPT && echo $PS1' and see if they match. If they don't, then we are looking for a prompt re-definition for sure but it is ...


1

You might want to check out CommandPost which has a Watch Folders function. I've never used this software, so I'm not sure of its full capabilities. It may be a good place to start. Disclaimer: I have no financial or personal ties to CommandPost.io.


0

Your symbolic link is actually working just fine. The problem is that you seem to have accidentally overwritten the source file (~/.dotfiles/.bashrc) with an “alias” (a “shortcut” or “bookmark” type binary file created by Finder). You’ll need to create a new source file with the contents you want in your bashrc.


0

TLDR; use .bash_profile for your aliases. The way the different initialisation files work together is a bit more complicated, and there are some important special cases in OSX. Here are the highlights: Bash, on any platform, executes one of several different files depending on how it is invoked. The details are here. OSX's Terminal App does something non-...


1

Another option is htop, which has an option to display in tree format. You can either press F5 interactively, or use htop -t when launching it. To install: brew install htop Source: ServerFault


-2

or just launch disk utility - it will list the "Type" also


2

You can use the following AppleScript: tell application "System Preferences" reveal pane "Security\n& Privacy" end tell In the shell, you'll need to wrap this inside an osascript command. The best solution will depend on what your exact workflow is, e.g. whether you want to do this as part of a script.


3

You have to know where the actual PreferencePane resides. Just supply the full path to the section you want. For Apple supplied PreferencePanes it's easy: open /System/Library/PreferencePanes/Security.prefPane opens your desired System Preferences > Security and Privacy. Other preferencePanes might be found at /Library/PreferencePanes or ~/Library/...


1

I'll claim there are three relevant concepts you are (/may be) running into trouble with here: In a unix-style shell, when you use a command name that doesn't include a "/", it's looked for in the directories in the PATH environment variable (places like /bin, /usr/bin, etc), not anyplace relative to where you are (or some current script is). On the other ...


1

There are two concepts relevant to understand what's going on here: when running binaries or shell scripts as name-of-executable, the shell looks into $PATH for the list of directories the binary/shell script could be stored it. The first match found is then used to run the binary/script, if no match is found you get an error message. If instead you run it ...


2

This is unfortunately not possible with Terminal.app. This can be done with iTerm2, but you are obviously aware of that.


0

sudo killall coreaudiod should work to kill your audio drivers. It should reload itself within a fraction of a second. (verified on my mbp running 10.14 but used this on a couple of previous versions)


0

I successfully installed mkpasswd on my macOS 10.14.5 using gem install mkpasswd. gem install mkpasswd Fetching mkpasswd-0.1.0.gem Fetching unix-crypt-1.3.0.gem Successfully installed unix-crypt-1.3.0 Successfully installed mkpasswd-0.1.0 Parsing documentation for unix-crypt-1.3.0 Installing ri documentation for unix-crypt-1.3.0 Parsing documentation for ...


6

You can accomplish this by just running cd directory/containing/the/files mv *[sS]02* /path/to/target/ For more complex operations there is also the option to use find to find all relevant files. The example from your question could also be written as cd directory/containing/the/files find . -type f -maxdepth 1 -iname '*s02*' -exec mv {} /path/to/target/...


1

Thank you, this was just what I needed for some user scripts. I made a slight modification to add a subtitle and sound. If a value is not provided, it is ignored. function _sys_notify() { local notification_command="display notification \"$2\" with title \"$1\" subtitle \"$3\" sound name \"$4\"" osascript -e "$notification_command" } alias sys-notify="...


1

For example with bash. Given the files below $ ls -1 test1 test2 test3 1) To avoid surprises let's take a look at the commands first $ for i in test*; do echo mv $i $i.ext; done mv test1 test1.ext mv test2 test2.ext mv test3 test3.ext and execute the commands if this is what we want $ for i in test*; do mv $i $i.ext; done $ ls -1 test1.ext test2.ext ...


2

A more refined search brought up: http://xahlee.info/UnixResource_dir/macosx.html https://norman.walsh.name/2008/02/22/tar using export COPYFILE_DISABLE=true before extracting the archive prevents the dotfile processing: $ rm -r test_dir $ export COPYFILE_DISABLE=true $ tar xzf test_dir.tar.gz $ ll test_dir total 8 drwxr-xr-x 3 xxxx xxxx 96B Jul 31 ...


2

https://github.com/Homebrew/homebrew-cask/issues/50413 The solution was described as going to: /usr/local/Caskroom/CASKNAME/.metadata/CASKVERSION/WEIRDIDENTIFIER/Casks/CASKNAME.rb And then from there I can remove the line that attempts to remove the login item. Then it uninstalls successfully and I can manually remove the login item.


0

It appears that this app is running on startup. In order to remove that (or install it) you have to be an admin. Before uninstalling anything in a multiuser environment, it's a good idea to check with the other users and make sure someone is not using the program. And asking the admin is a great place to ask for help/permission to remove the program.


0

You can use the built-in osascript command to run an Apple Script that shows a notification, e.g. osascript -e 'display notification "Command done" with title "Your title here"' You can string it together with a simple semicolon, e.g. your-command ; osascript -e '....'


1

Showing a status bar is currently not supported on iTerm2. A version of the status bar is coming to iTerm2 3.3. But I am not sure if it will pick up the powerline-status bar instead of its own during tmux sessions.


9

The switch -p allows deep folder creation along a path mkdir -p i/like/icecream/too You don’t need python for this, unless it reminds you of “p” instead of the pattern passed in to create the full path prefix.


1

If you are talking about not having the message box, shown below, popping up again when pressing the e.g., Fn key twice, then use the following defaults command in Terminal: defaults write com.apple.HIToolbox AppleDictationAutoEnable -int 1 This changes the Shortcut: setting from e.g. Press Fn (Function) Key Twice to Off in System Preferences > Keyboard > ...


0

I found the free Coherent PDF Command Line Tool to be the best option. It is very fast, lossless, and does not mess up orientation or hyperlinks as some other solutions did. Format is: cpdf file1.pdf file2.pdf -o output.pdf


6

As you are already using awk and are looking for a simple solution: awk -F/ '{n=split($3, a, "."); printf("%s.%s", a[n-1], a[n])}' <<< 'http://www.example.com/index.php' ^ ^ ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | | | | | | | last two ...


4

Parsing URLs with Bash The following questions should provide a good starting point: Parse URL in shell script Parse below URL in bash @pjz's answer breaks apart a URL into more manageable parts: #!/bin/sh INPUT_URL="https://www.amazon.com/gp/product/B007B60SCG/ref=ox_sc_act_title_1?smid=ATVPDKIKX0DER&psc=1" # extract the protocol proto="`echo $...


Top 50 recent answers are included