Questions tagged [darwin]

Darwin is the name of the UNIX layer underlying macOS and iOS. It contains elements from FreeBSD, NetBSD and if you install the optional Developer Tools, GNU user-land tools.

Filter by
Sorted by
Tagged with
8 votes
1 answer
2k views

cgroups analogue in Darwin

Is there an analogue to cgroups in Darwin for preventing processes from escaping from the control / monitoring of its parent process by means of fork()? If yes, what is it? For some background, ...
1 vote
3 answers
143 views

Detect leaf directories in Perl

For a Perl script I'm working on, I'm looking for a fast and reliable way to find all subdirectories (transitively) of a given directory which are leaves, i.e. those not having any subdirectories of ...
0 votes
2 answers
130 views

How to get 'man gfind' when I enter 'man find'?

On my new-ish mac os/Darwin system, my find tool is an 11-year-old BSD version. I have used MacPorts to install a more current version: GNU's find, which MacPorts has named gfind, and placed in /opt/...
1 vote
1 answer
104 views

Is running MacOS software on Linux better than running Windows software on the latter? [closed]

MacOS's kernel is based on FreeBSD, Darwin, and a few other forgotten ones, all of which are monolithic, I believe. However, the current MacOS kernel, XNU, is hybrid, which is one of the things that ...
0 votes
0 answers
801 views

cp fails with 'Resource busy'

I store RAW images (DNG) and my Apple Photos library on an external SSD (Rarely used, 1 year old). Some files (approx. 2-5%) are corrupted. I face the following behavior: Copy via Finder: Error 'File ...
4 votes
3 answers
1k views

How do you rewind a file descriptor in bash without using a second file descriptor to read from the beginning in bash for Mac?

Environment: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20) Try 0: exec 3<> "$(mktemp)" # open file descriptor 3 to a temp file for read/write echo 'foo' >&3 ...
0 votes
0 answers
97 views

Is there a darwin (arm64) equivalent of `O_PATH` for open?

I want to get the file descriptor without opening the file which can be attained by using the O_PATH flag on linux. (ref) This flag doesn't seem to be there on darwin. Context I'm trying to use open ...
0 votes
1 answer
33 views

Is there any convention for where one stores installed software?

I'm installing some software by cloning a git repo onto my local machine. I plan on creating a soft link to the binary made from the source in the repo to /usr/local/bin. Where should I put the git ...
3 votes
1 answer
235 views

"locate" returns relative instead of absolute paths

One advised me to post here since this would be more appropriate (I am going to remove the previous one). On my MacBook, I have the following entry in root's crontab: 0 */4 * * * cd /private/var/root &...
2 votes
1 answer
301 views

Is there a way to detect a process called exec?

I'm interested in programmatically monitoring the state of a process (that isn't my own, and isn't a child of my own process). Is there a counter that increments, or an identifier that changes, etc. ...
3 votes
1 answer
272 views

What do I need to do to update my commands?

My man page for 'whatis' does not match others I have found online. Namely, no options are available to use with it. /home/User$ whatis -d ls whatis: -d: unknown option uname -srv Darwin 16.7.0 Darwin ...
1 vote
1 answer
971 views

Deleting / renaming a network hardware port in OS X / Darwin

There's a problem with a device being listed twice with the same hardware port name which is causing a lot of trouble since the OS X configuration utilities (both GUI System Preferences and command-...
-1 votes
1 answer
66 views

least astonishment transgressed by `nl` on Darwin

Transgression of least astonishment: bash-5.0$ (for i in {1..1000010}; do echo $i; done) | nl | tail -24 999987 999987 999988 999988 999989 999989 999990 999990 999991 999991 999992 999992 ...
0 votes
1 answer
445 views

What should be at /usr/local/bin on a new OSX

I want to remove all programs which I don't need from /usr/local/bin. What are the list of programs (folders / files), which should be on a new OSX. Currently, I have the following list: 2to3 ...
13 votes
2 answers
10k views

why is "timer_t" defined in "time.h" on Linux but not OS X

While I was reading a C source code files, I found this declarations. (This source code was written for linux system program. This is very important information) #include <time.h> #include <...
23 votes
8 answers
14k views

What features does Darwin have that other Unixes don't, or vice versa?

Does Darwin have any features that are specific to it? Do other Unixe(s) have features that Darwin lacks?
2 votes
0 answers
157 views

No free space on system & locked out of recovery mode because firmware password, Linux to rescue? [closed]

This is a bit of a tragedy of circumstances. I was deleting all free space on my latest install of OS X with diskutil secureErase freespace 4 "/Volumes/Macintosh HD" and unfortunately it failed. ...
0 votes
2 answers
337 views

mv raised error message but file was moved

I confess I am not an expert on unix commands but I moved a file to another directory and got an error message - yet the file was moved. Why is this message 'mv: rename to to /Users/billtubbs/Library/...
0 votes
1 answer
506 views

Compression size is bigger than actual directory size

I am on trying to archive a directory (a Time Machine backup) using: tar -czf /Volumes/My\ Drive/archive.tar.gz my_directory The archive process is going on at the moment. I am monitoring the ...
4 votes
1 answer
341 views

OSX/Darwin ACL Format

In OS X, if you want to view the ACL information on a file, you can do so with the -e option of `ls. $ ls -lde app/cache drwxrwxr-x+ 7 alanstorm staff 238 Apr 1 10:02 app/cache 0: user:alanstorm ...
6 votes
1 answer
9k views

-bash: lstat: command not found

I'm using a Macbook Pro running El Capitan v 10.11.6. I am learning about symlinks, and in the man ln page, I found the following: A stat(2) on a symbolic link will return the linked-to file; an ...
17 votes
2 answers
20k views

How do I increase the maximum swap space on Mac OS X?

On Mac OS X Yosemite 10.10.5, when I try to run a calculation that needs to allocate and use 128 GB of memory (it is a command line program written in C), the kernel kills my process with extreme ...
3 votes
1 answer
1k views

Different behavior in shell script vs in shell?

UPDATE: I have changed the grep $1 part to grep '$1' (while I was trying to mean grep "$1") in the script and this time I got the kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ....
2 votes
1 answer
5k views

Installing Aqua interface on Darwin

Is is possible to install the Aqua GUI on top of Darwin? I was researching this about a year and a half ago and I don't remember much about what I found out. I also was not the main person in charge ...
1 vote
2 answers
115 views

What versions of Darwin's libacl have the acl_get_file bug?

In some versions of Darwin's libacl, there's a bug in the acl_get_file function in which in spuriously returns null and sets errno to ENOENT when passed paths to valid files. There are a decent number ...
3 votes
1 answer
481 views

Installation date and virtual status of the machine( For Darwin, FreeBSD and NetBSD)

How do I determine installation date (when the system was first booted) for Linux,Darwin, FreeBSD and NetBSD? Also, Is there any way to get the virtual status of the these machines (whether the ...
1 vote
1 answer
169 views

Ubuntu K/FreeBSD

I was wondering if it is possible to alter Debian K/FreeBSD so it becomes Ubuntu? I know there are builds of Debian 7 running on FreeBSD, so would it be possible to get a working Ubuntu system with ...
3 votes
1 answer
862 views

Unix command equivalent for OS X Finder's Duplicate Exactly

What command can reproduce this function in bash? In Finder select File then press ⇧⌥ to make the command visible (⇧⌥⌘D). In AppleScript it's available as tell application "Finder" to duplicate ...
4 votes
2 answers
395 views

How to find a file with partially specified path?

I am trying to find all my .txt and .csv files in my backup (Apple's time machine). The structure of the backup directories is like this: /machine name/date/Macintosh HD/ The above contains all ...
1 vote
3 answers
2k views

GCC: set architecture to pass to linker

GNU C compiler passes the wrong architecture name to the linker. For example gcc helloworld.i throws the error ld: unknown/unsupported architecture name: -arch arm. After some experimenting with LD, ...
2 votes
2 answers
267 views

In OS X Darwin, why can I interfere with text input across user sessions using cat?

OS X Darwin: Disrupting Terminal Sessions Across User Identities How, in Brief: with cat < /dev/ttys_, in Terminal. My Question This OS X 10.9.2 Darwin behaviour seems odd to me, and I would ...
14 votes
1 answer
6k views

cat /dev/null > file.log does not truncate large file in Darwin

In the past, on linux systems, I've been able to truncate large, open log files (that is, a file that is being actively written to by a process) using cat /dev/null > file.log. However, on 10.9 (...
2 votes
0 answers
530 views

Shorter timeout on I/O errors MacOS X

How do you set a shorter timeout value for read/write I/O errors on MacOSX? We tend to get a few semicrashed disks and want to rsync the contents to a secure location, but when the file subsystem ...
2 votes
2 answers
170 views

Why does "User Contributed Perl Documentation" show up when I look for 'man' pages

When I man -f <some string> in addition to the expected Unix man pages, I get a bunch of odd looking entries that all have the header "User Contributed Perl Documentation". For example man -f ...
1 vote
0 answers
302 views

How do the various configuration files determine MANPATH on Darwin?

On Darwin (12.2.0, OS X 10.8.2, bash 3.2.48(1)) my MANPATH appears to be determined by my PATH rather than by the various configuration files associated with man and the man path, /etc/manpaths, /etc/...
8 votes
1 answer
2k views

What is Darwin's 'private' directory for?

Darwin has a private directory that I don't see in the Unix documentation I've found. Is that a Mac-specific directory? What is it for? Is it preserved between system upgrades?
7 votes
4 answers
23k views

Where can I find a download of Darwin from Apple?

Where can I find a ISO download of Darwin? I downloaded Darwin at one time (even after they stopped releasing the ISOs) off of Apple's website. Unfortunately, I have no idea where the link went. I had ...
1 vote
1 answer
767 views

lpstat and localization under Mac OS X

How to force "lpstat" utility to show output messages in English under localized Mac OS X (version 10.6)? Example: lpstat -v Shows in Dutch: apparaat voor Samsung_SCX_4300_Series: usb://..... I ...
1 vote
0 answers
129 views

Why does cd // work? [duplicate]

Possible Duplicate: unix, difference between path starting with '/' and '//' On my Mac OS X Lion box, with Bash: $ cd // $ pwd // $ ls Applications System cores ...