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)

1
vote
3answers
50 views

How to tell the sizes of files and folders, sorted, and in MB, GB, instead of a long integer?

On a Mac, using Bash, I tend to do du -sh * to tell the sizes of files and folders in the current directory, in MB and GB. But if I want to sort them by the sizes, I might do du -sh * | sort -g ...
0
votes
1answer
22 views

find returns weird file order on RHEL but not on OSX [duplicate]

When I enter find . -iname "[0-9]*.nii" on my OSX machine it returns: ./03_Rest_fcMRI/9793_01_03_1.nii ./04_VEMP/9793_01_04_1.nii ./04_VEMP/9793_01_04_2.nii ./05_Tapping/9793_01_05_1.nii ...
1
vote
1answer
9 views

How to have tmux on startup for both OSX and Ubuntu (including Quake)

I recently updated my Ubuntu 14 system and the update has made it impossible to have tmux started up automatically. In fact the previous setting made it impossible to log into my Ubuntu account(!), ...
0
votes
1answer
8 views

printenv.wsf and printenv.vbs in /Library/WebServer/CGI-Executables

Please don't shoot this one down, as I looked through my Macbook Air and wanted to configure my Apache installation to more specific needs, I came across printenv.wsf and printenv.vbs, which I find ...
2
votes
1answer
32 views

Installing Linux with USB on Mac

I am trying to get Ubuntu (version 14 I believe. It's the latest version) installed on my Macbook Pro (Late 2013 edition 13 inch, no disk drive in it) via a USB Flashdrive. I have followed every ...
2
votes
1answer
63 views

Best way to connect to an existing user context through SSH

What we would like to do: We have short living virtual machines for running scripts. The virtual machines are used through SSH to perform "builds" (sequence of scripts) and discarded once all the ...
1
vote
1answer
16 views

How do I get the Truecrypt CLI installed?

I have a unix machine with truecrypt 7.1a installed. I'm trying to mount a volume to test with the command line but I don't have the truecrypt command installed evidently. Did the command line ...
5
votes
1answer
94 views

Edited sudoers file with text editor - now can't run sudo

I now know that I should never try to edit the etc/sudoers file with a regular text editor. However, minutes before I learned this, I saved a new user name in the file with Sublime Text. Now when I ...
3
votes
2answers
95 views

sed: inserting text before end of <HEAD> section

I need to insert some text into an HTML file before the end of the HEAD section. I'm trying: sed -i "s#</head>#<style> @page { prince-shrink-to-fit: auto } ...
2
votes
3answers
202 views

Why root does not source .bash_profile?

Everytime I try to login as root using su (not su -), it doesn't source .bash_profile in user1's home directory. Basically my /var/root directory doesn't have .bash_profile, so I put a copy of ...
1
vote
2answers
70 views

Mac Terminal - rename *.png.png to *.png

I have a bunch of images that I'd like to rename as follows: *.png.png --> *.png *.jpeg.jpg --> *.jpg *.JPEG --> *.jpg The only thing I've tried thus far is mv *.png.png *.png, but I knew ...
0
votes
0answers
31 views

Swap OS X Command/Control keys without changing bash shortcuts

I originally asked this on Ask Different, but I think since my issue is probably more with bash this would be a more appropriate site. First of all, I know that you can use the System Preferences to ...
0
votes
0answers
26 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 ...
1
vote
3answers
133 views

Shell expansion for arguments?

For example: mkdir ~/{1,2,3} Creates directories ~/1, ~/2, and ~/3. It equates to: mkdir ~/1 mkdir ~/2 mrdir ~/3 But, using the same syntax in the case of CMD < argument > : brew {install, ...
0
votes
0answers
36 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 ...
2
votes
0answers
36 views

Catch/diagnose user process being killed - Inexplicably logged out automatically

Context: I'm using bash in Mac OSX Yosemite. Problem: I'm executing a (python) script that I expect to use alot of resources and take a few hours to run, redirecting stdout and stderr to a log file. ...
2
votes
0answers
27 views

Content of root's home directory in OSX

What is stored in root's home directory on OSX? What happens if you delete it on accident? Heres whats in my current root home folder. OSX:~ root# ls -lash total 8 0 drwxr-x--- 5 root wheel ...
0
votes
0answers
39 views

Running Mac OS X under KVM/QEMU

Note to be removed in the future, so as to avoid confusion from answerers and mods edit: Forgot to add in the note, if anyone thinks this is the wrong stack-site to post this, please comment on why, ...
0
votes
1answer
33 views

Sed a plist file gives a iilegal byte sequence

With a Unix Mac 10.9.5, French CA version I've read a lot of tips but if the error is gone, the plist is corrupted. the locale command gives: LANG="fr_CA" LC_COLLATE="fr_CA" LC_CTYPE="fr_CA.UTF-8" ...
2
votes
0answers
57 views

Where does BPF packet capture read its data from?

I am interested in the low-level interfacing with network packets. From what I read, tools like tcpdump and libpcap use the BPF packet filter device /dev/bpf* to read link-layer network packets (on ...
2
votes
1answer
42 views

macos - local port redirection using pfctl and syntax errors

I am running MacOS(really BSD), and I want to redirect certain traffic over an ssh tunnel using a a local forward. Seems easy enough, but I am repeatedly blocked by the ambiguous "/etc/pf.conf:29: ...
-1
votes
1answer
30 views

Transfer executable file from Linux to mac

I have a file that is sitting on my server, this file is an executable file on the server. When I just use SCP to copy it down to my desktop which is a mac i get bash - ./fig up cannot execute binary ...
1
vote
0answers
23 views

To plot 7x10 pictures for review in video

Assume you have 77777 pictures. You want to review them and their differences: have 7x10 pictures without margins to have an image viewer where the minimum browse time can be less than 1.0 s such ...
1
vote
1answer
37 views

mv to file with

I ran the following mv command, apparently by mistake using backslashes by mistake instead of slashes. mv 2015-02-02_flyer_ppces.pdf ..\PPCES2015\2015-02-02_flyer_ppces.pdf The output is empty. ...
3
votes
3answers
59 views

Is swapping enabled by default on common operating systems?

As a result of this question, I was a bit confused. After some research I found that swapping is enabled by default on Mac OS X. Swapping was furthermore introduced in Windows 3.0, so I believe it is ...
0
votes
2answers
37 views

How can I quickly find the 20 most recently modified files on Mac OS X (instead of using Python)?

Of course it's possible to take the output of find . -type f | xargs ls -l and pipe it to a Python script that would sort the lines and output the top 20. But is there anything faster than that?
2
votes
2answers
45 views

SED on Mac OS X

I'm using a MacBook Pro and I want to find and replace a given word with another with sed command, but it makes no changes. What is the problem? sed 's/\<cat\>/dog/g' tt.txt
1
vote
0answers
32 views

OS X: Apply inheritable ACL permissions to pre-existing subfolders and files

I have a folder with numerous ACL permissions set. Most of these include file_inherit and directory_inherit permissions and therefore should be, and are, automatically propagated to any new ...
1
vote
0answers
23 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 ...
0
votes
0answers
48 views

Sharing folders between VMWare 7.1.1 and Mac OS X using open-vm-tools

I didn't have any luck sharing my OS X 'Downloads' folder with a Fedora guest Linux OS using the VMWare tools (see my earlier question) . I came across this solution (with 8 up-votes) for Ubuntu that ...
0
votes
0answers
56 views

Cannot share folders betwen Mac OS X based VMWare 7.1.1 and Guest Fedora 21 system

I would like to share my Mac OSX 'Downloads' folder. I set this up as a shared folder in vmware settings. Currently, although I made a folder at mnt/hgfs/Downloads, it does not have the contents of ...
0
votes
1answer
23 views

Multi line substitution duplicating across lines in OSX

I'm a little rusty in my sed and haven't used it much since moving to a Mac but I am aware there seems to be a difference with what sed is used on a Mac per Ubuntu after a few searches. What I am ...
0
votes
0answers
18 views

OS X USB installer utilities, cannot ssh any host

I booted my mac from a OS X USB key installer. I cannot boot it from the internal HD because OS is damaged. I want to copy some files from my Mac to another computer with scp. The problem is that ...
0
votes
1answer
86 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 ...
1
vote
0answers
85 views

How to convert the qemu parameters for an osx guest for libvirtd

I managed to have an osx guest running in qemu with the following commands: // create the virtual image $ qemu-img create -f qcow2 mac_hdd.img 35G // .. install osx ... // start the guest $ ...
0
votes
0answers
42 views

How to create multi-bootable OS from USB drive in Mac OS X

While Googling and tried with some instruction from many website introduction including Youtube and also been get through this article http://apple.stackexchange.com/q/130221/116741 but still can't do ...
0
votes
1answer
47 views

Error with sed on MAC OS X invalid command u

Im french sorry in advance for my bad english... So i have an error on MAC OS X when im using sed sed -i '' '/user_pref("mail.identity.id1.reply_on_top", 1);/ a\ ...
0
votes
0answers
45 views

How do I start dnsmasq?

I have installed dnsmasq but I can't start it: $ dnsmasq dnsmasq: failed to create listening socket for 10.0.1.57: Permission denied $ sudo dnsmasq dnsmasq: failed to create listening socket for ...
3
votes
1answer
55 views

Edit a file via a script yet maintain the osx tags

On OSX you can have tags which allows you to identify different categories of files. Here are two text files with different tags when viewed in Finder: I have a large number of these files and have ...
0
votes
1answer
37 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 ...
1
vote
2answers
55 views

How do I find folders containing no recently modified files?

I have a directory that gets a lot of data dumped into it, and I want to find all directories whose contents haven't been modified recently (e.g., in the last 5 days). I'm trying to compose a call to ...
0
votes
0answers
92 views

Dual Booting Macbook pro mid-2009 with Ubuntu and OS X Yosemite

Machine - Macbook Pro 15" Mid-2009 Hi, I am trying to triple boot my system with: 1. OS X Yosemite. 2. Ubuntu 14.04 LTS 3. Windows 8.1 For now I am trying to install linux first and then I plan to ...
2
votes
1answer
38 views

What's the easiest way to detect what signals are being sent to a process?

I'm trying to debug an issue with my shell (specifically, fish) sending signals to my background processes. I'd like to be able to recognize what signals a process is receiving. Ideally, I'd like ...
0
votes
1answer
139 views

Why convert .GIF to .MP4 file using by ffmpeg on Mac OSX got .MPEG4?

ffmpeg -i original.gif -r 10 outfile.mp4 According to command above, I've got outfile.mp4 but when clicked to see the information of file, i see it's actually a .MPEG4 file and the icon of file is ...
2
votes
1answer
45 views

Replacing by tab character in Sed in Osx

I am working in Mac OS X,I have tried several commands in sed to replace by a tab character followed by a file name. for f in *.txt; do sed -i '' -e "s/$/\t$f/g" $f; done for f in *.txt; do sed -i ...
12
votes
3answers
482 views

No colored output in less for the ls command

If I run ls I get colored output which I find pretty handy for quickly getting a glance of the kind of file. When I try to pipe it to less even with the -r and -R flags the coloring always get lost. I ...
3
votes
2answers
82 views

How can I test if my /tmp “works”?

I had to delete some files and whatever, long story, I ran sudo rm -rf /tmp/. Now, on mac (might be universal, I'm not sure) it is a symlink to /private/tmp/. But my /tmp/ folder has a thumbnail ...
0
votes
2answers
47 views

Maintaining the Current Style of the Command Prompt After Using 'su?'

When I use the su command in OS X's Terminal — say, to quickly switch to an administrator account to mount a drive using diskutil — the style of the command prompt changes. ...
0
votes
2answers
173 views

Shell script for ssh into a Unix/Linux server from MacOS X 10.10

I am attempting to ssh into a server by using a bash script from MacOSX. #!/bin/bash spawn ssh username@gatewayserver expect "password" send "Mypassword\r" interact spawn ssh ...
0
votes
1answer
61 views

How to turn on tab completion in zsh/prezto?

I have installed prezto and trying out zsh. However tab completion is not on by default. What is the best way to enable tab completion in prezto?