The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

38

That ls/ directory is not standard on Mac, so its something you or another user on the Mac have created (either directly, or indirectly by being created by some third party program). It hasn't got anything to do with the ls command. However, it could reasonably have been made by someone in the middle of a mkdir command thinking that they should just list ...


15

The tee command prints the piped stdout to the file path given as well as displaying it in the terminal. This is commonly used for recording the output of commands to file which would otherwise only be ephemerally printed to the terminal. Without tee and using simple redirection of brew install > install.log would prevent stdout being printed to the ...


8

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


6

I suggest to use networksetup which works persistent and also in separate network locations. First, open your terminal of choice i.e. iTerm2.app or Terminal.app list your network locations: networksetup -listlocations choose your desired network location: sudo networksetup -switchtolocation <locationofchoice> list "devices" called ...


5

You may find Kinto to be useful. It's a project I recently created, after a few years of tackling this problem a few different ways and I just now feel like it's solid enough to share. The Kinto installer simply uses python to do the initial install, after that it's just a systemd service, bash, xprop, setxkbmap and xkbcomp. As far as I am concerned it is ...


5

You have to enter the command du -sh * instead of ls to get the actual size of the folders in your current directory (the sum of the files size they contain). The command ls shows file size, but it has a different meaning for folders. It actually shows the size allocated for the directory to store metadata (mainly the index) of the files it contains.


5

It appears you want to send some number (586?) lines from FTIG_dldStruct.txt to the ./STP command? If so, assuming ./STP reads from standard input as is typical, that may look like: head -n 586 FTIG_dldStruct.txt | ./STP As pointed out in the comments to pass the entire contents of the file that would be: ./STP < FTIG_dldStruct.txt Various pipelines ...


5

2>&1 means "send any error messages (aka 'stderr') to the same output as any informational messages (aka 'stdout")." And | tee install.log means "whatever output there is should also be sent to the file install.log.


4

Since your Mac is from 2001, It most certainly won't run anything past Leopard (10.5) and may not even run Leopard (If it doesn't, then it would run Tiger (10.4). Regardless, you will need an installation disc for this appropriate version. Follow the instructions that come with the installer to install from the disc. Recovery mode is persistent on newer ...


4

You can't launch the Linux version of Firefox on macOS, because it is a binary for Linux calling libraries from Linux and calling system calls of Linux. You have to build a macOS version of Firefox on macOS from the source tree you download from here: https://archive.mozilla.org/pub/firefox/releases/ through the traditionnal steps: ./configure make /usr/...


3

Building on Maghin's post. # Use echo -n to leave out the line end. # Use -C option with hexdump to avoid big endian/little # endian confusion. mac $ echo -n 😀 | hexdump -C 00000000 f0 9f 98 80 |....| 00000004 mac $ echo -n 😱 | hexdump -C 00000000 f0 9f 98 b1 |....| ...


3

You can use the hexadecimal form of the icon. Here is my method : Copy an emoji from a graphical source : https://getemoji.com/ Then paste it in your terminal in the following command : $ echo 😀 | hexdump 0000000 9ff0 8098 000a 0000005 Then take every octal and put \x before each : $ echo -e '\xf0\x9f\x98\x80\x0a\x00' 😀


3

From testing I can see that it is possible for a desktop macOS users to bind() TCP port numbers below 1024 (the so-called well-known ports). It works on both IPv4 and IPv6, and on the localhost/unspecified addresses. The Darwin kernel source code is freely available - from there I can see that it has the functionality built-in to check for processes trying ...


3

#!/bin/bash USERNAME=per1 FULLNAME="Period 1" PASSWORD="test" SECONDARY_GROUPS="staff" # ==== if [[ $UID -ne 0 ]]; then echo "Please run $0 as root." && exit 1; fi # Find out the next available user ID MAXID=$(dscl . -list /Users UniqueID | awk '{print $2}' | sort -ug | tail -1) USERID=$((MAXID+1)) # Create the user account dscl . -create /...


3

I used this procedure to change uid's on macOS Tiger and Ubuntu. The info on passwords has changed. Ok, so how can I check my UID? I've heard that it's dangerous to change the UID, so how should I do if I want the permissions to work in both OSes? You can change the permissions of files and directories in either OS. I suggest that you make a ...


3

I’ve found confirmation in the commit history: it’s a bug, which was fixed in r338375 in August 2018.


3

TTYs exist and operate in Mac OS X and macOS just as they do in any other UNIX or UNIX-like operating system. When macOS boots, the TTY that inits to subsequently load the GUI is always console. Subsequent TTYs opened from Terminal.app or other emulators are listed from ttys000 and the digits increment one at a time. You can open Terminal and check your TTY ...


2

The open port is for internal (localhost) services only. It should not be visible to a remote host, e.g. via the 'nmap' utility.


2

Rene Larsen's answer holds the secret but it was not called out. What you want to do is to install MacPorts, which provides the daemondo program (installed to /opt/local/bin/daemondo on my system). From the help screen: "daemondo is a wrapper program that runs daemons." It appears to provide arguments and functionality similar to start-stop-daemon.


2

I recently solved a very similar problem by removing my ARP cache. I have a MacBook Pro 2014 and Ubuntu 18.04 desktop which runs the SSH daemon, and every client works fine except my MacBook. I ran Wireshark and observed that pinging my desktop is only resulting in ARP requests to be broadcasted — I couldn't see response packets. At first I thought it's a ...


2

In 10.14 (and possibly earlier), the dictionaries have moved to /System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/ There is one .asset directory for each downloaded dictionary; for example, my American English dictionary is located at: /System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/...


2

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

For me on Ubuntu 18 all I had to do was install libimobiledevice-utils with sudo apt-get install libimobiledevice-utils and then reconnected the iPad, I can now browse my dam file and grab em just like normal folders thats just wonderful!!!


2

The Minshall+French format is what macOS uses to store Unix symlinks on FAT and CIFS volumes. More details on the Minshall+French format can be found here: https://wiki.samba.org/index.php/UNIX_Extensions The Linux CIFS implementation provides a 'mfsymlinks' mount option (which is off by default) that supports the Minshall+French format. I believe Docker ...


2

Your approach would mostly work, although you'd end up with column A in the output file, which may not be what you want. Here's another approach that doesn't put column A in the output file: awk -F, '{outfile=($1 ".csv") ; print substr($0,index($0,$2)) >>outfile ; close(outfile)}' <name_of_input_file You said "CSV", so use a comma as the field ...


2

The time spec for "10 minutes from now" is now +10 minutes. For example, echo 'open ~' | at now +10 minutes However, the at system is disabled by default in macOS, as mentioned in the at man page: IMPLEMENTATION NOTES Note that at is implemented through the launchd(8) daemon periodically invoking atrun(8), which is disabled by default. See ...


2

On macOS whatis is just a shell script. $ type whatis whatis is hashed (/usr/bin/whatis) $ file /usr/bin/whatis /usr/bin/whatis: POSIX shell script text executable, ASCII text If you look inside, the relevant part reads while [ "$1" != "" ] do found=0 for d in /var/cache/man $manpath /usr/lib do if [ -f $d/whatis ] then ...


2

Found the problem myself: The single-dash option -I does not accept =. The convention is that double-dash options -- require =. I fixed by using -I ./subfolder instead.


2

macOS has implementations of the X11 protocol as you're used to on Linux. This is called XQuartz, it is based on the same Xorg as you'll find on Linux. You can use many of the same desktop environments on top of macOS and XQuartz as you can on Linux. It is the exact same programs, just recompiled on macOS. The terms for these things on macOS are the same ...


2

A circa 2001 iMac can run OS X Tiger 10.4.11 at the latest. You'll need installation media to boot the system. As well, the Linux installation will have partitioned and formatted the HDD in a fashion that OS X will not be able to use. As such, the very first step after booting to the installation media will be to run Disk Utility to remove and re-create the ...


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