Hot answers tagged

15

For files hidden by prepended . To show: defaults write com.apple.finder AppleShowAllFiles YES; killall Finder To hide: defaults write com.apple.finder AppleShowAllFiles NO; killall Finder edit: as per RikerW's advice, to shorten these long strings into some shorter strings, add the following line to ~/.bash_profile from your favorite text editor: ...


5

dd itself doesn't provide a progress bar. You may estimate the progress of the dd copy process by adding a pkill -INFO command though. Example: dd if=/dev/zero of=/dev/null bs=64m count=1000 & while pkill -INFO -x dd; do sleep 1; done Result: [1] 37691 0+0 records in 0+0 records out 0 bytes transferred in 0.028923 secs (0 bytes/sec) 275+0 records in ...


5

pbpaste pastes exactly what you copy. In your case you have copied the line not including the CR/LF at the end. To get the return you need to copy from the start of the line to the beginning of the next line From @patrix comment Most commands do end with a CR/LF. e.g. echo "Hello" will put out a newline, however for echo this can be changed echo -n ...


4

The same information, displayed every second by in klanomath's answer, can displayed using your command. You just need to enter a controlT character from the keyboard while the dd command is executing. By pressing the controlT character, you are sending the same SIGINFO signal to the dd command that the command pkill -INFO -x dd sends.


3

You can use sntp as standard query tool for either NTP or SNTP servers. You may get, set or adjust the time on your host with it. E.g. sntp time.euro.apple.com shows the time sntp -d time.euro.apple.com shows a more verbose response including the current time. Check man sntp for more options.


3

The great thing about UNIX commands is that you can combine them together. iconv doesn't know how to recurse into directories, but find does. It can call iconv on every file it sees. (These commands will convert all files in the current directory and all directories within. Make sure you are in the directory you want to convert all files in recursively.) ...


3

The standard package format is the "pkg" format. It's not often used for applications, but it's fine for a terminal-only utility. My go-to tool for creating packages is called Packages. I haven't used it myself, but it looks like CMake supports PackageMaker, which is a third party tool for creating OS X packages. There's also the built-in pkgbuild utility. ...


3

You aren't releasing the Alt key (aka Option) quickly enough after typing the "|", so you're getting Option-Space, which is a non-breaking space. This looks like a normal space but gets treated as part of the command name rather than as a separator. See this SuperUser question for some options to disable the Option-Space key combo.


2

Open Terminal, type in sh /path/to/file and press enter. Faster is to type sh and a space and then drag the file to the window and release the icon anywhere on the window.


2

To not get that error, you need to make myShellScript.sh executable. In a Terminal, use the following command: chmod u+x /path/to/file/myShellScript.sh Also, you should add a shebang to the top of the script. Example: #!/bin/bash Note: Use the appropriate shebang for the shell you want to process your script. If you do not want to make the script ...


2

I asked the Twitter user @launchderp: @launchderp Arelaunchctl load and unload still safe to use, at least until 10.12 or whatever comes next? c.f How do I use non-"legacy" launchctl commands to load and unload plists? And @launchderp replied @tjluoma Yeah they're still safe. Too many years of dependencies to break them. While ...


1

You can embed your shell script within AppleScript calling bash with a heredoc. do shell script "/bin/bash -s <<'EOF' cd /Users/myusername/Git/myproject/ /usr/bin/git remote remove orig EOF"


1

The command: mdutil -a -s will help you locate on which particular filesystem mds_store is looping on error. For example: /Volumes/flamme 1 250 Go/Backups.backupdb: Error: unexpected indexing state. kMDConfigSearchLevelTransitioning


1

Nevermind, found it: brew install gnu-time the command is gtime


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. ...


1

You have at least two options: Install MacPorts. Install thttpd with this command: sudo port install thttpd I am not using MacPorts and this is untested. Download config.sub.diff and config.guess.diff and put them into thttpd source directory. Execute these commands to patch the config files: patch -R < config.sub.diff patch -R < ...


1

You can place a link to the contents/macos/app in a location that is in the users path. You don't need to have a separate binary with this approach but your app does need to handle command line arguments. That is not hard to do, but the details of that are beyond the scope of this site.


1

Basically you can use do shell script "cd my-directory && git init" do shell script "cd my-directory && git add README.md" ...


1

Folder actions are fine for triggering when a file is added or modified. However, if your definition of changed includes deleting a file, OSX Folder actions does not detect if a file has been removed. To answer the question: Download the FileWatcher dependencies from here: https://github.com/eonist/swift-utils Familiarize your self with running swift in ...


1

To output only IPv6 info, use the -f address_family option. Example: netstat -nr -f inet6 From the netstat man page: −f address_family Limit statistics or address control block reports to those of the specified address family. The following address families are recognized: inet, for AF_INET, inet6, for AF_INET6 and unix, for AF_UNIX.



Only top voted, non community-wiki answers of a minimum length are eligible