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
0answers
12 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 ...
0
votes
0answers
8 views

changing partition on dual boot (Mint + OSX)

I have a MacBook Air where I have setup a dual boot partition between Mac OSX and Linux Mint. I originally did this as a way to get my feet wet with Linux Mint. I am now loving using Linux and only ...
3
votes
1answer
42 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
16 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
41 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
19 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
32 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
27 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
34 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 ...
11
votes
3answers
426 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
1answer
53 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
1answer
39 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
83 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
21 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?
1
vote
0answers
13 views

need help with vf project in fish shell

Hi I am using virtual fish on fish shell, so while trying to do vf project projectName it throws the below error: vf project pytube fish: Unknown command 'virtualenv' ...
1
vote
0answers
15 views

OS X Yosemite is SUS - Single Unix Specification 3 certified. But what posix standard is it compliant to? the latest one is 2008

I'm confused. Is SUS compliance the same as POSIX compliance? Is yosemite compliant to the latest standards, what years exactly?
0
votes
2answers
74 views

Convert input string to date in shell script

My shell script: #!/bin/bash echo "$1"; startd=$(date -d "$1" +"%Y%m%d"); echo "$startd"; My command: sudo ./test.sh "20151010" The output: 20151010 20150213 it printed todays date ...
1
vote
0answers
31 views

Ubuntu Grub recognises MacOS but cannot boot up

I tried a little experiment on installing MacOS on a non Mac Hardware Laptop... Got this far as to put the MacOS Install ISO on to an HFS+ partition but the machine needs to boot this up for the ...
1
vote
2answers
63 views

How can I invoke vi instead of vim [duplicate]

I want to use vi for better pasting. When I use vi I get vim When I type /usr/bin/vi I still get vim This is on my Max OSX 10.10 Yosemite
0
votes
1answer
65 views

Running Java classes in a package --> Error: Could not find or load main class

I'm learning how to compile and run java classes in terminal using the commands javac and java. I have no problem compiling and running an individual class, however, when I put that class into a ...
0
votes
0answers
19 views

Folder keeps vanishing/showing up in finder, terminal says it doesn't exist

Upon a standard find routine I noticed a folder kept returning errors, even tough it didn't contain any of the arguments in the search query. Ilha-VB2-leo:FESTIVAIS_01-16 ilhavb2$ find . -iname ...
2
votes
1answer
47 views

How do I restart tor?

I have been trying to restart tor (for the sole purpose of changing my IP address). So what I did was make an alias to pkill -x tor; tor. But that gives me the usual tor is already in use/the ip ...
3
votes
3answers
41 views

Run fgrep multicore mac os x

I'm running this command on my Mac OS X on 8 cores: for i in $(cat file1);do grep "$i" file2; done > output.txt My file2 is 9 million lines so it takes a lot of time. Is it possible to use all ...
2
votes
2answers
59 views

Custom bash 'context' when running from FISH

First of all, I'm on OSX10. My default shell is BASH, which I have set up (through .profile and .bashrc) to automatically run the FISH shell when I open my terminal emulator. This allows me to set up ...
1
vote
1answer
17 views

Failure to update Homebrew

So I'm trying to update my home brew version but I get an error. Here is a copy pasted part from the console: $ brew update error: Your local changes to the following files would be overwritten by ...
9
votes
4answers
478 views

Use #!/bin/sh or #!/bin/bash for Ubuntu-OSX compatibility and ease of use & POSIX

I know that I can use either as the first line of scripts to invoke the desired shell. Would #!/bin/sh be recommended if compatibility with all unix systems is an absolute requirement? In my case ...
1
vote
1answer
21 views

Importing Python files from inside folders

On Mac OS X, I can import a .py file named test inside the directory dir by running import dir.test However, on Debian (specifically Raspian) this does not work. What is the alternative?
0
votes
0answers
30 views

Can't use Homebrew on OS X Mavericks because of otool error

When I try to use Homebrew, it will give me an error like this: JimBob:~ fast$ brew install wine sh: /usr/bin/otool: Bad CPU type in executable Error: Failure while executing: /usr/bin/otool -L ...
2
votes
3answers
49 views

How to merge keys, or handle keys with the same file name?

I created a key for logging into a server (using ssh-keygen) with the name id_rsa, and so in my .ssh directory there is id_rsa.pub and id_rsa. The reason I used this name, is because when I tried ...
4
votes
5answers
265 views

sort order explanation

Giving a lot of files, sort -n gives me this result: f1.txt f10.txt f2.txt which doesn't seem right to me. What is the explanation? Can I get this by default: f1.txt f2.txt f10.txt
1
vote
0answers
33 views

Cannot change bash shell in Mac OS X

I'm trying to update bash shell on my Mac OS Mavericks. $ brew install bash $ which -a bash /bin/bash /usr/local/bin/bash $ which bash /bin/bash $ chsh -s /usr/local/bin/bash $ which bash /bin/bash ...
2
votes
1answer
29 views

How to merge duplicated history of command on terminal?

Do you have an experience like this? When you try to find a previos used command on terminal by up arrow and you find $ls # 1st time push `up arrow` $ls # 2nd time push `up arrow` ...
2
votes
1answer
46 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 ...
2
votes
0answers
26 views

Reliable method to determine system language in OS X

I was hoping to do something like defaults read -g AppleLanguages | awk -F, '/[^(]/{print $1;exit}' but if only one language is listed in "Preferred Languages", then defaults read -g ...
1
vote
2answers
158 views

read first element in array

defaults read -g AppleLanguages produces something like this: ( en, de ) I'd like to extract just the first element, in this case "en", defaults read -g AppleLanguages | awk '/\(/ ...
0
votes
1answer
85 views

vim - “Press ENTER or type command to continue” right after loading only?

Recently my vim has developed the habit of displaying Press ENTER or type command to continue the first time I do certain things right after I open it. For example, if I'm at my shell prompt and type ...
0
votes
0answers
11 views

pkgsrc package install message

When installing gnupg2 on Mac OS X 10.10.2 using pkgsrc I got a message $ pkgin install gnupg2 ... =========================================================================== The following files ...
2
votes
0answers
18 views

Exporting the Safari (OSX) window to a remote Linux box

I have network access to a headless Mac mini running "OS X Server" (10.6.8 Snow Leopard). Sitting on my Linux desktop (Fedora) I can execute something like: ssh myuser@imachost xeyes and get the ...
2
votes
1answer
27 views

Strange characters in GIT completion

I'm running bash GNU bash, version 4.3.25(1)-release (x86_64-apple-darwin13.4.0) on OS X 10.10.1. A week or so ago I've noticed that autocompletion has stopped working, but only for git. I'm ...
2
votes
1answer
35 views

how to change git path?

So I just installed the latest git, with the official mac installer. I'm on Mavericks. Sadly, git --version is still git version 1.9.3 (Apple Git-50) and which git gives me: /usr/bin/git ...
2
votes
1answer
108 views

bash find: get directory of found file

I have a parent folder named "parent_folder" with a lot of subfolders, in these subfolders is a file named "foo.mp4". I can find these files easily by doing this: mymacbook:parent_folder username$ ...
3
votes
3answers
99 views

Get modification date that can be used with touch -m

I need to get the modification date of a file so that I can set it on other files using touch -m. stat or perl -le 'print((stat shift)[9])' Didn't return what I wanted. I think that you are supposed ...
1
vote
2answers
40 views

Why does terminal say I have mail every time I open it?

I am using OSX 10.9.5 Whenever I open a terminal, it says something like: Last login: Wed Jan 21 10:29:13 on ttys002 You have mail. What mail is it talking about ? If I open the mail app, I have ...
0
votes
0answers
31 views

Can't boot into slackware installer

Can't boot into Slackware installer, I get stuck in this: The last line I see is: mousedev: PS/2 mouse device common for all mice I tried a external Keyboard with Mouse (Cordless but at least ...
0
votes
0answers
14 views

Mac OS X package installer generation/building on Ubuntu 14.04

I'm implementing a building server for an application that will run on Android, Linux and Mac OS X. I already have in place the scripts for apks and debs generation and I need to do the same for Mac ...
3
votes
1answer
90 views

Mac OS X combine cp and cat to sequentially copy and rename files in list

I am using a MacBook Pro OS X 2013 model. I have a list of filenames in a text file named list.txt separated by line breaks list.txt exactly like this, but this list is going to be long e.jpeg ...
1
vote
0answers
32 views

Same Swap Partition in Multi Boot [closed]

I have a Macbook Pro with 256 GB of space and 8GB of RAM. and I want to make a multi boot like: Mac OS X 120 GB Windows 8.1 30 GB Ubuntu 14.04.1 30 GB Debian 7.7 25GB Arch Linux 15 GB COMMON ...
0
votes
0answers
43 views

httpd -k stop/ start not working OS X

GE-Erics:~ eric$ httpd -k stop AH00548: NameVirtualHost has no effect and will be removed in the next release /private/etc/apache2/extra/httpd-vhosts.conf:19 AH00112: Warning: DocumentRoot ...
0
votes
1answer
98 views

Using the cURL command, how does one fetch stock data which comes back *without* commas and spaces?

What can I add to the below script so that it fetches the stock data and brings it back WITHOUT any commas and spaces? For example GOOG Outstanding shares is 675,000,000. I desire the output of ...
2
votes
0answers
49 views

Increase SSH ConnectTimeout greater than 60 seconds

I don't seem to be able to increase the SSH connection timeout much beyond a minute: $ date; ssh home-qnap -o ConnectTimeout=7200; date Wed 14 Jan 2015 15:23:32 AEDT ssh: connect to host home-qnap ...