Questions about the command line and other Unix-like aspects of Mac OS X, including the Mach/BSD-based kernel and FreeBSD-based userland. You may want to consider using Ask Different instead.

learn more… | top users | synonyms (1)

2
votes
1answer
60 views

Why can Macs mount certain hardware that my Linux Mint can't?

I am running Linux Mint Rafaela 17.2 on my PC. I had to manually edit a file on my microSD card which contained the Raspbian OS for my Raspberry Pi. When I plugged it into my PC, using a MicroSD to ...
1
vote
0answers
55 views

OS/X: can't execute shell scripts - spawns a new window which exits immediately

Issue: When I try to open any shell scripts a new window is spawned, which exits immediately. Files .bash_profile, .bashrc and a helloworld.sh are tested examples. Interestingly, running open ...
4
votes
2answers
265 views

How can I tell if a directory is mounted with noatime or nodirtime?

I work with an NFS partition on a mac. Commands like du take a very long time, and I was considering unmounting the NFS and remounting it with noatime and nodirtime. The partitions have been mounted ...
0
votes
1answer
31 views

Make new line above last line and add something there

Like a reverse of awk 'NR==2 {print ""} 1 which adds a new line under the first and prints whatever there. I can't replace the number after NR== with a fixed value because I want to be able to do this ...
1
vote
1answer
26 views

Use both a variable and newline in BSD sed?

I can do this for example sed 's/\>\</\>\ </g' To replace >< with > < However, say I want a variable, like this: sed 's/\>\</\>\ <$1/g' It will interpret ...
6
votes
2answers
241 views

What is causing `diff` to run `git diff`?

I'd like to use diff as described here and in the documentation I see when I type man diff. However, when I type diff, what I get is this: ~ ❯❯❯ diff usage: git diff --no-index <path> ...
1
vote
1answer
56 views

Why doesn't this work when I add it to the current sed being run?

I have a text file that looks like this: (empty) str int int If I add this s/^/\</g to my current sed (making it 's/\&/\</g;s/\</\ /g;s/^/\</g') this is the output. < ##only ...
2
votes
1answer
118 views

Why do I have 9 bash processes, why does one of them take up so much CPU and how do I stop them?

I have 9 different bash processes running at all times (I sometimes get more, for example, I have 37 bash processes now.). I found this question, where OP had a similar issue. But I don't see this as ...
0
votes
2answers
42 views

Unix equivalent of `du -sb` to get summarized size in bytes

On Linux using GNU du to calculate the size of directory recursively in bytes I can run: du -sb /etc What is equivalent syntax for BSD du based on the fact that -b parameter is not available?
0
votes
0answers
8 views

Fedora OSX Partition

I am wanting to dual boot fedora workstation with OSX. 2015 Macbook. However, when I get to the partition scheme screen on the fedora installer it shows my OSX SSD 250GB but with only 6KB free. But if ...
0
votes
1answer
23 views

How to start multiple graphic sessions?

I need to test my application on a friend's mac. Not to disturb him, I thought I could connect me to his PC through SSH (with -X option), but to avoid opening the app in his session, a new session has ...
0
votes
0answers
29 views

Fedora/OSX Dual boot

I have been getting my mac ready to dual boot with Fedora. But when I get to the fedora set up, it only lists my Mac hard drive, not the partition I have created. My Partition: ...
2
votes
1answer
58 views

How can I get at to work on OSX?

My at on Mac OS X 10.11 seems to be incapable of launching jobs. I tried: echo "date > foo" | at now Running atq afterwards shows the job queued and no file foo was created. To make sure the ...
1
vote
2answers
174 views

Invalid command code with sed

This is the command I am using: system_profiler | sed -n -e '/SATA/SATA Express:/,/Software:/ p' It gives me this error sed: 1: "/SATA/SATA Express:/,/S ...": invalid command code S I don't see ...
3
votes
2answers
61 views

How to remove certain characters (but not all) before one or more character(s)?

If I wanted to remove everything before a character (say "("), I would just do something like this 's/.*(//g'. Now I want to remove only certain things before a character/some characters, in my case - ...
2
votes
3answers
25 views

Managing packages, directories and PATH in Unix (OSX)

I'm a PhD in bioinformatics, mostly self-taught, and I'm coming to a point where I want to clean up my various directory structures (i.e. my data), but I'm also thinking about how I'm storing the ...
1
vote
3answers
76 views

Sed entire word with when replacing single letters, with BSD sed?

I think I found some GNU solutions but I need BSD sed solutions. What I want to do is replace the entire word at once. If the word is "clayii", and my code is sed ...
3
votes
2answers
221 views

Loop through file and make every word a variable?

I have a text file that looks like this: 1923.12.312. Nikl 12391.123.123 Jo 12398123.123912 Ad I am trying to loop through this file, and make 1923.12.312. variable1, and Nikl variable2 then use ...
0
votes
3answers
252 views

Crontab on Mac OSX

I have created an /etc/crontab file on a Mac OS X that runs a few simple commands. I would like to use the crontab to echo a statement in my terminal, logout from the OS (as if I was to point my mouse ...
2
votes
0answers
46 views

readline - use of modifiers other than control and meta

I'm trying to use Apple's ⌘ command and ⌥ option keys to map some functions in readline to no avail. As per the man page I used octal values but that doesn't seem to work \xHH the eight-bit ...
1
vote
0answers
20 views

What does UniqueID do on Mac OS X?

Scripts to create a new user on OSX typically use the command dscl to set a user attribute UniqueID. What does UniqueID do and how should I determine what to set it to?
1
vote
1answer
356 views

Error when exporting the result of a valid command as a bash variable

I'm trying to export the result of a command line as en environment variable. Here is how I'm doing it: group_id=$(aws ec2 describe-security-groups --filters Name=group-name,Values=${group_name} \ ...
1
vote
1answer
74 views

Checking Macbook Pro Retina SSD life

I am trying to assess the health of my SSD drive (of a MBPr 15" mid-2014). I tried to do smartctl -a disk0, which gave the following output: SMART Attributes Data Structure revision number: 40 Vendor ...
1
vote
0answers
19 views

Can I specify partition in “reboot” or any similar commands?

I like to make scripts for everything that takes a bit of time, and when I have to reboot to another partition, I press the reboot button and then hold alt (⌥) and then I have to choose partition. I'd ...
0
votes
0answers
109 views

Linux Mint partition doesn't appear in Disk Util (El Capitan).

i have two problems here! I'm pretty new to dual booting on OS X, I'm trying to dual boot with Linux Mint. I've gone through all the recommended route of dual booting. I started with mounting the ...
0
votes
1answer
53 views

Can't boot Mac OSX 10.9 Virtual Machine (Virtual Box)

Whenever I try to run the virtual machine this error comes up: Failed to open a session for the virtual machine Mavericks. UUID {d2b7e883-8f73-41fc-9fde-11bc09a1a548} of the medium ...
0
votes
0answers
18 views

Bash previous command refresh is messed up [duplicate]

I'm running on a mac with el Capitan. I'm at the command prompt, running bash. When I hit the up-arrow, sometimes it's as if it thinks that my prompt is much longer than it is? The first part of the ...
0
votes
0answers
20 views

Brew Cleanup keeps appearing in my Terminal history

When ever I open Terminal and/or open a new windows in OSX then press the up key, brew cleanup keeps appearing. I tried adding history -c to my bash profile but that did not work. I ran brew update, ...
0
votes
1answer
24 views

set up pfctl to forbid local applications accessing a specific hostname

I am an OSX user, and I want to ban some hostnames, with which some local applications may do nasty things. pfctl is the default firewall on OSX 10.11 El captain. So, how to block the specific ...
1
vote
2answers
249 views

Can't mount shared folder on Linux VM

Host machine: OS X El Capitan Virtual machine: Linux Red Hat(64-bit) through Virtual Box Goal: share folder on Mac, so when I change files on host machine, they will be changed on the virtual ...
1
vote
1answer
112 views

How can I replace a literal \n with a newline character? (on OS X) [duplicate]

I have a script which pulls something out of my shell history and saves it to a file, but if there is a newline in the history entry it gets returned to me with a literal \n instead of the newline ...
0
votes
0answers
29 views

Cannot use pcilib

I want to use lspci in command line, but it outputs pcilib: Cannot open AppleACPIPlatformExpert (add boot arg debug=0x144 & run as root) lspci: Cannot find any working access method. Then I ...
1
vote
1answer
46 views

copying and working on OSX .app files (folders) in linux

tldr; I want to run a script over an external hard drive and tar.gz every folder that ends with .app into their own archive. That is, I don't want them all in one tar.gz file, I want to create one ...
2
votes
5answers
210 views

How can I list the names of directories that contain file names matching a regex?

Given a directory X that contains several subdirectories and files, I would like to list the names of the immediate child directories of X that (directly or indirectly) contain file names matching the ...
0
votes
0answers
33 views

How can I remove Ubuntu from reFind on my Mac?

I used to have Ubuntu installed dual boot on my Mac but have removed it since. The hard disk has been repartitioned into a single Mac OS X partition. However, reFind still shows Ubuntu as one of the ...
2
votes
1answer
229 views

Cross compiling ARM static lib with GCC for Mac iOS xCode projects

I'm cross compiling ARM targeted toy example static lib for the usage in Mac iOS xCode projects. In the lib there are only 2 files atoy.c and atoy.h with simple function taking 2 int arguments and ...
3
votes
1answer
440 views

Why can wine run 64bit programs on Linux but not on Mac?

I read about a developer saying it doesn't work, "and probably never will". Why is this? The two OSes aren't that radically different, I think.
1
vote
2answers
76 views

Script usually works, but not with cron

I have a script that looks like this: #!/bin/bash D=~/brew\ update num=$(ls "$D" | cut -d ' ' -f 2 | sort -nr | head -1) num=$(( num + 1 )) script -q "$D/brew_update $num" brew update This ...
0
votes
0answers
55 views

OS X admin cannot access user directories or unlock file

This problem is occurring in OS X 10.11.1, but I think the issues pertain to *nix generally. I d/l and installed an app as a limited user (authenticating as an admin when asked). It's not doing what ...
-1
votes
2answers
65 views

“Command not found” for no reason, even when it doesn't try to run a command

This is the errors I get when I try to run my script ~bin/killp: line 7: [[ menubar: command not found ~bin/killp: line 11: [[ menubar: command not found ~bin/killp: line 11:  [[: command not found ...
0
votes
1answer
49 views

cron doesn't do anything

I tried making some crontabs, I created a file called brewupdater in my user folder, containing 0 */5 * * * ~/bin/brewupdate2. I then tried to run cron ~/brewupdater but it told me: cron: can't open ...
1
vote
1answer
110 views

Why mac os x does not set uid bit for /usr/bin/passwd

A lot of books state that examples of setuid bit usages include passwd, at etc. But in mac os x el capitan, the /usr/bin/passwd does not have the bit set. How could it change the /etc/passwd file?
1
vote
0answers
42 views

Revisiting and learning UNIX [closed]

To get back up to speed on best practices, which UNIX learning resources does the community recommend (slide decks, good videos series, interactive serious games, online virtual learning environments) ...
0
votes
1answer
845 views

Trying to connect to an SSH server on one machine and it works fine. Not on the other [closed]

~$ ssh -v raina@45.79.8.241 OpenSSH_6.9p1, LibreSSL 2.1.7 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: Applying options for * debug1: /etc/ssh/ssh_config ...
1
vote
0answers
11 views

How do I make changes in winetricks permanent?

I downloaded a game powered by wineskin X11, it requires videomemory of at least 1GB winetricks works great, but each time I will have to open the dialog, modify it and run the game. Any ideas? I ...
1
vote
1answer
36 views

Scripting Question

I'm trying to write a simple shell script for OS X 10.10, to install a list of applications for new Macs we're getting in. I just want to fire off each installer one at a time to install each ...
0
votes
3answers
87 views

Ignore certain characters when comparing variables?

For example, If this is my script: if [[ $yesno == "What's going on" ]]; then Then how do I make it Ignore ', ?, , and . for example? So basically Whats going on, What's going on, What's going on? ...
0
votes
1answer
284 views

Formatting USB stick with fdisk - negative used space?

I formatted a USB drive using fdisk, and created three partitions. Everything seems to work fine, but Disk Utility is showing a negative amount of used space for all partitions: Partition | Capacity ...
0
votes
2answers
45 views

seq -w equivalent in os-x bash

I have sub-folders named 00 01 02, ... n with each foldername containing at least 2 digits. I need to access these sub-folders in os-x terminal. The command for i in $(seq -w 00 06); do echo $i; done ...
3
votes
1answer
44 views

ssh port forwarding through pseudo terminal

Here's a situation: I do all my work on a Mac. There's a certain linux server 'server01' that provides access to another linux server 'server02' via a pseudo terminal So, to ssh into ...