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)

6
votes
4answers
116 views

How to grep-inverse-match and exclude “after” and “before” lines

Consider a text file with the following entries: aaa bbb ccc ddd eee fff ggg hhh iii Given a pattern (e.g. fff), I would like to grep the file above to get in the output: everything except ...
38
votes
7answers
9k views

Software developer switching from Linux to OS X, what are the gotchas?

I have used Ubuntu/Fedora/Red Hat/Suse but haven't used OS X at all. If I have to start using OS X regularly, what are the things I should look out for? Tools I use are GNU tool chain, C++/Boost, ...
1
vote
1answer
20 views

how to use dd to backup second linux hard drive from os x?

I have a MacBook with Linux installed on the primary hard drive. On an external USB 3.0 drive, I have OS X installed. The external drive has plenty of space so I would like to boot up OS X and make ...
0
votes
2answers
36 views

Mac drive in use, understanding lsof

I am trying to repair permission on my external HD as I can not empty my trash when its plugged in because I get a bunch of "such file is in use". I read online that this might be resolved by ...
0
votes
1answer
525 views

Increasing `ulimit -u` settings temporarily in OSX Yosemite

I'm trying to temporarily (without restarting the machine, just for test that starts a JVM) increase the number of processes to 2048 in OSX Yosemite but I'm unable to do so. First, I tried calling ...
3
votes
1answer
92 views

OS X FileVault 2 duress password

I've been attempting to add a custom script to run after the FileVault password is entered on login that will check whether it a 'special password' that will run a script in the background after ...
0
votes
0answers
7 views

OS X Java Security Edit Site List En Masse

I'm sure, like many other systems administrators like myself who use Mac, you've come across the dreaded Java Security site list and the need to add IP's for individual blades, servers and anything ...
2
votes
5answers
486 views

How to edit/delete a .dot_file on mac without using Terminal

When I start Terminal I can not control it. It starts executing an endless loop repeating that some alias does not exist. Because of this I am not able to edit this file using a program such as vim. ...
5
votes
3answers
522 views

bash does not autocomplete my command when using sudo?

I'm using SaltStack. I would like to auto-complete the minion name when calling the salt command. The following line has been added into ~/.bashrc: complete -o default -o nospace -W "$(sudo ls -1 ...
1
vote
2answers
26 views

Making persistent USB with minimal OS on os x

I am looking to turn a 8g usb into a bootable drive with a minimal OS. All i want is an OS that will allow me to use vim, nothing else (no internet/any other services). I basically want to turn a usb ...
1
vote
0answers
40 views

osx - dd command behaving weirdly [duplicate]

I've been using dd for a couple of years now, most of the time successfully. I usually use it to dd Linux images to USB drives. My workflow doing so is as such: convert .iso image to a .img format ...
3
votes
1answer
3k views

Sound volume control does not work in Ubuntu

My sound volume control does not work when I'm logged in with my regular user, though the sound works correctly. What's weirder is that the sound control works when I'm logged in as guest. With my ...
1
vote
3answers
2k views

How to troubleshoot failed X11 forwarding with ssh?

When I try to establish an X11-forwarding connection to myserver, I get the following error: % ssh -X myserver xlogo X11 connection rejected because of wrong authentication. X11 connection rejected ...
1
vote
2answers
106 views

tmux blocks certain things on my Mac

I really like tmux and use it often so I set the following in my .zprofile: [[ $TERM != "screen" ]] && exec tmux so when I open a new window, tmux will be there for me. However, there are ...
0
votes
1answer
25 views

color scheme setup for iTerm

How do you setup color scheme of iTerm on Mac? For color scheme, I mean using different color to display folder name, file name, machine name, etc.
11
votes
1answer
807 views

'ls' showing two identical files in a directory

So somehow the command ls seems to be showing me two identical files in a directory. I am certainly not doing something right here. Behold $ ls -Blah /System/Library/LaunchDaemons total 32 ...
3
votes
0answers
13 views

Cocoa API implementation for Linux?

Is there any Wine-like project for running OS X apps on Linux? I mean an implementation of Cocoa API for standard Linux machine, as it is done with Wine.
0
votes
0answers
6 views

redirect help info to vim [duplicate]

I use this kind of commands to redirect help info to vim, for example: man ls | col -b | vim -R - but for some help info highlighted with color: celery -h there is a mess in it. How to make it ...
8
votes
1answer
71 views

OS X, bash: less works on open file descriptors, cat doesn't

In a bash script I'm working on (which has to run on Ubuntu and OS X), I need to redirect the output of hundreds of commands to a file. Rather than appending &>... to all of them, I simply do ...
1
vote
1answer
654 views

MacOS X Mavericks running VirtualBox cannot communicate with Linux VM

I have a MacOS X Mavericks host running Vagrant using VirtualBox as a provider. I have experienced several times that with different VMs (particularly Ubuntu Linux VMs) after the first time the VM is ...
1
vote
1answer
30 views

Trying to find all files in certain directory that are not referenced in other files

I have this project that has a images folder with images in them and I'm pretty sure some of them are not used. So I'd like to list all images that are not referenced in any other file. I'm not very ...
0
votes
1answer
25 views

bash script failing to use ssh -i. Can't see directory

I am experiencing something strange. I am working on a script to remote install Splunk on servers via a script. In this script I ssh to my practice servers (5 amazon EC2 instances running Redhat). ...
0
votes
0answers
63 views

Installation Step Failed (installing the system) - Kali Linux

I am trying to install Kali Linux on a Virtual Machine using Virtual Box on an OS X host. The only issue is I get this error: Here are logs of my errors: hardware-summary partman syslog Also if ...
0
votes
1answer
95 views

Process Being Killed due to low swap

I'm running a python (2.7) script on mac osx yosemite. The script is fairly computationally intensive, certainly bumping up against my machine's RAM limitations. The computer crashes and restarts ...
3
votes
2answers
118 views

Multi-month view in calendar (cal) in OS X

I am hoping to run some of the commands listed in this article, e.g.: cal -3 which is supposed to show me the last month, this month, and next month. This command does not work in OS X. $ cal -3 ...
1
vote
1answer
43 views

Non-deterministic errors when using nested sshfs

The OSX implementation of sshfs doesn't like to connect to my Android phone running SSHDroid, so I'm attempting to gain access by mounting an ubuntu VM via sshfs which in turn has a mountpoint to the ...
1
vote
1answer
39 views

Lsyncd not working on Mac 10.9

I'm attempting to use lsyncd to automatically move files to my local development server. My host is OSX 10.9. SSH on the server works. I can connect using ssh from the host. I am using an SSH key to ...
0
votes
0answers
10 views

VLC exporting video frames uncontrollably, can't figure out how to stop it (possibly related to ffmpeg)

I have a very peculiar problem. Every time I open a video in VLC, in any format, it immediately begins exporting frames to my Pictures folder I tried deleting VLC and reinstalled a newer version but ...
6
votes
2answers
20k views

How to know when and which user logged into the system under Mac OS X? Last is not enough!

In Mac OS X, if I don't touch it for a while, it will lock the screen and one must use password to unlock it, but this kind of log in is not recorded by last command. I want to know if anybody tried ...
0
votes
1answer
58 views

csvkit Permission denied

I am on Mac and installed csvkit. When I run csvlook, I get a traceback with the following error message: IOError: [Errno 13] Permission denied: '/Library ...
4
votes
1answer
140 views

How can I redirect all UDP traffic from one port to another on BSD / OS X?

On Mac OS X 10.9.5 I am running boot2docker and would like to temporarily forward a non-privileged UDP port 69 to port 69 of the boot2docker virtual machine. Virtualbox only supports forwarding ...
2
votes
1answer
49 views

rsync -vvv gets stuck in OS X with no clear explanation

All of a sudden (not sure when the problem started) my rsync commands against a given machine get stuck: $ (dd bs=1024 count=1024 </dev/urandom >/tmp/temp_file && rsync -arvvv ...
0
votes
1answer
13 views

How do I assign hostnames for machines on my network?

I'm using Terminal on a Mac running OS X Yosemite. Wondering how I can assign hostnames so that I can run telnet instead of using the ip address.
4
votes
2answers
61 views

Mac OS X how to verify particular packages are installed

In a BASH script I need to check if gcc, g++, cpp, make, libpng devel, zlib devel, git, Java (including devel files), ant and pkg-config are available on Mac OS X and if not, I need to prompt user to ...
2
votes
1answer
39 views

Why does my ls --help not work?

Marias-MacBook-Air:~ marias$ ls --help ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
3
votes
0answers
39 views

Deleting ghost files with non-ASCII characters

I have some weird files and folders in my trash on Mac OS X. After I "empty" the trash, the files still remain. I attempted to manually delete the files: $ cd ...
2
votes
1answer
38 views

Installation of GPG alongside a running one: configure problem?

I already have a production version of GPG from a previous installation. I would like to build and test the last version of GPG without interfering with the production one. I am performing this test ...
1
vote
1answer
666 views

VPN Setup Errors

I'm trying to install a VPN on one of our servers for use within my campus so that we can play some games, but I appear to be getting errors when I try to connect, as shown below. Not quite sure about ...
0
votes
0answers
23 views

Problems launching Ubuntu from rEFInd on Yosemite

Firstly apologies if this should be posted on a mac stack exchange group. Ive been running Ubuntu on my macbook pro for a while now and not had too many issues, recently however I have hit a wall. I ...
1
vote
0answers
9 views

partprobe equivalent on OS X

After I manually edited a partition table on a device in OS X, the corresponding devices don't get created automatically under /dev. How to I tell the OS X kernel to reread partition tables as I ...
0
votes
0answers
47 views

$PATH variable on Fish Shell OS X

I have somehow screwed up my path variables with Fish shell on OS X. Is this the proper $PATH variable in the config.fish? user@host ~> more ~/.config/fish/config.fish set -g -x PATH ...
1
vote
1answer
32 views

Access Macintosh HD from Ubuntu - Permission denied

I've followed this instructions and now I'm able to access my Machintosh HD from Ubuntu, the problem is that I can't access the folder I need (example Desktop), it say that I haven't enough ...
5
votes
3answers
538 views

Why does du report a size of 0 for some non-empty files on a HFS+ partition?

What is the explanation for the difference: $ ls -l /Applications/Safari.app/Contents/Info.plist -rw-r--r-- 1 root wheel 15730 11 jui 15:02 /Applications/Safari.app/Contents/Info.plist $ du -sh ...
0
votes
1answer
82 views

Mounting smb shares on OS X accessible with Microsoft account

I have a Windows machine which shares a particular directory and only an owner of this directory is able to access it over the network. Owner account is linked to Microsoft account. I am trying to ...
15
votes
4answers
6k views

Fix or alternative for mktemp in OS X

I'm looking at a bash script someone else wrote that uses mktemp: TEMP=`mktemp --directory` However, this line does not work on my machine (OS X 10.6). How would I fix this line so that it is ...
18
votes
2answers
8k views

ssh-add is not persistent between reboots

I add a ssh key to the agent by $ ssh-add ~/.ssh/id_rsa_mac Identity added: /Users/alex/.ssh/id_rsa_mac (/Users/alex/.ssh/id_rsa_mac) After reboot I don't have this key added anymore: $ ssh-add -l ...
5
votes
3answers
2k views

Transferring Files SSH SCP Error Message: 'Stdin: is not a tty'

I am using a Macbook SSH terminal and generated RSA key pairs and uploaded remote id_rsa.pub with approved permissions. I can connect with remote Apache web server. I can create, open, move, modify ...
0
votes
1answer
28 views

.txt File from Mac not converting properly

I have a .txt file from my Mac that when I send it over to my Raspberry Pi running Raspbian and open it in nano it converts weirdly. Example: Text file in Mac OSX: ...
2
votes
2answers
55 views

Split shell horizontally to show ls -al and pwd

I use zsh as my default shell on OSX. I would like for my shell to always have a horizontal split showing pwd and ls of the current directory I'm in. How do I go about it ?
1
vote
2answers
898 views

Add text to end of every line

I have tried a lot of commands, like this: sed -i '' "s/$/<@string>/" txt.txt > txt2.txt This makes txt2.txt empty, why?!? sed 's/$/<@string>/' txt.txt > txt2.txt This does ...