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)

0
votes
1answer
15 views

Virtualizing OSX partition on MacBook running Linux

I have a Macbook Pro with a partitioned drive that hosts Arch linux and OSX. Linux is my main development environment but occasionally a need arises to test some code on OSX. This doesn't happen often....
3
votes
1answer
60 views

How to I convert month name to number in BSD date?

I have found solutions for GNU date, but not for BSD date. I would rather not make an if, etc. before I know if there's a built in way.
1
vote
0answers
31 views

Is there a GNU/Linux equivalent to the Mac OS X open command? [duplicate]

In Mac OS X there is a handy open command that opens the target file or directory in the default GUI application meant for it: open /usr/local/share will bring up a Finder window with the /usr/...
1
vote
0answers
49 views

Certain squid functions don't work, sometimes nothing at all work

I set my proxy to 127.0.0.1:3128, and then I added this to the configuration file: acl blocked_sites url_regex -i "/usr/local/etc/squid/blocked_sites" http_access deny blocked_sites http_access allow ...
1
vote
1answer
47 views

Can't connect from OSX to FreeBSD with mosh [closed]

I've installed mosh on my laptop using Macports and on my FreeBSD server using ports. Whenever I try to connect to my server I get the following error: Password for xxxxxx@xxx.xxx.xx.xx: zsh:1: ...
3
votes
2answers
57 views

dnsmasq does not listen to conf file

I have installed and started dnsmasq, using brew install dnsqmasq and sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist respectively. I tried to use the "adress" function inside ...
1
vote
2answers
68 views

Metasploit Directory Doesn't Run Executables Without ./

I have Metasploit installed on OSX in /usr/local/share/msf Metasploit's executables can't be run outside it's directory thus would give a command not found error. msfbinscan msfconsole msfd ...
2
votes
1answer
64 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
58 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
290 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
31 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
273 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> <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
123 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
52 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
9 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
25 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
33 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: http://tinypic.com/view....
2
votes
1answer
62 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
319 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
26 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
91 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 's/c/k/g;s/l/i/g;s/a/e/g;s/y/i/g;s/...
3
votes
2answers
260 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
452 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
48 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
21 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
515 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
101 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
122 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
65 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 '/home/...
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
21 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
27 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
301 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
145 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
36 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
49 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
252 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
36 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
339 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 ...
4
votes
1answer
595 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
99 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 ...
-1
votes
2answers
72 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
62 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
138 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
1k 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 ...