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
1answer
42 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
66 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
75 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
106 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
39 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
1answer
48 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
157 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
1answer
150 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
28 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
20 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
678 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 ...
2
votes
0answers
252 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
51 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
129 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
133 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
84 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
98 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
87 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
140 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
50 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
332 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
71 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
653 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
96 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
50 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
454 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 ...
1
vote
1answer
132 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
40 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
55 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
2k 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
68 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
102 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
2k 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
42 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
204 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
109 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
122 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
38 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
2k 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
33 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
78 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
122 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
300 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
1answer
131 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
61 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` ...
3
votes
2answers
133 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
32 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
186 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
374 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
25 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 ...