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
21 views

On the relationship between shell initialization and desktop apps after a “graphic login”

I am very (zsh)/somewhat (bash) familiar with the shell's initialization sequence when the user logs in through a text interface. But what about the case of a "graphic login", IOW, when the user logs ...
1
vote
1answer
143 views

generate file names in loop [closed]

DISCLAIMER: I am using Mac OSX. The bash script is in a different directory from the files that require processing. From here my struggle begins… HELP 1: I have multiple files each housed in a ...
1
vote
1answer
316 views

Symlink to file which does not exist yet

I'm currently trying to cleanup my home directory by moving files like .vimrc, .bash_profile, etc. to a directory .dotfiles in my home directory. The idea is to use symbolic links to these files ...
1
vote
1answer
395 views

ssh algorithm negotiation failed

Problem Ok, the problem is that I am using Pycharm on El Capitan. I am trying to connect to a server that has strict login Kexalgorithms using the newer Key Exchange Algorithms than Pycharm seems to ...
1
vote
1answer
36 views

Password Generator not working OS X

I am creating a Password Generator using 4 Arrays (Lower Case, Upper Case, Symbol and Number) with the RANDOM function. Basically I will generate a random number and then apply it to each of those ...
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/...
1
vote
1answer
511 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
100 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
1answer
144 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 ...
1
vote
1answer
147 views

MacOS terminal ssh input buffer size

I am trying to cut-paste some switch config over an ssh session from my mac. It seems to start mangling it after a set buffer size. Surely cut-paste buffer is large enough, since I can cut-paste just ...
1
vote
2answers
63 views

How to change pager key bindings

I'd like to swap RETURN (scroll forward N lines, default one window) and SPACE (scroll forward N lines, default 1) in less to get a for me more natural way to page through man pages. I saw years ...
1
vote
1answer
82 views

Searching inside archives for specific files and patterns [duplicate]

Is it possible to grep inside a bunch of archives with regular expressions on both the names of the files they contain and the contents of those files? I would like to know which files in which ...
1
vote
2answers
482 views

Bash is not sourcing ~/.bash_profile on OSX

I just got this really weird problem. When I start bash, I get these two lines: -bash: fasd: kommandot finns inte -bash: brew: kommandot finns inte "kommandot finns inte" means command does not ...
1
vote
1answer
103 views

Bind tmux prefix to section symbol §

I usually use the backtick key as my prefix, but this keyboard has the section/stanza symbol § where the backtick usually (at least, for me in the UK) is. If I bind to this key, quoted or unquoted, ...
1
vote
1answer
57 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 ...
1
vote
1answer
61 views

What happens if I move the hard drives used by Rsync to another computer, and keep syncing them with it?

I realise the question is confusing, so allow me to elaborate. I apologise for the phrasing, as I wasn't sure how to put it. Here's the scenario: As my backup, currently my Mac launches Rsync every ...
1
vote
1answer
490 views

Using git over sshfs on OSX

Due to a new job, I'm switching from working on Ubuntu 14.04 to OSX Yosemite. I mainly work in R, and I was using RStudio and git to manage my code on a server (Debian). To this I mounted the server ...
1
vote
1answer
243 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(!), ...
1
vote
1answer
37 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
273 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
2answers
266 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
1
vote
1answer
43 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?
1
vote
1answer
524 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 ...
1
vote
2answers
58 views

Including Directories in Locate on Mac OS X

Can anybody shed light on which directories OS X decides to put in the locate database and which it decides to omit? It's pretty clear that ~/Library is out - which others? And how do I modify this ...
1
vote
2answers
141 views

SSH Tunneling Through a Firewall to a Cluster

I work at a university but I often work remotely. There is a cluster computer at the university that I need to be able to interact with, but its behind a firewall. Let's call the firewall F and the ...
1
vote
2answers
119 views

.bash_history keeps truncating

My .bash_history keeps truncating even though I set: export HISTSIZE= export HISTFILESIZE= On my .bash_profile. Im not sure when it happens but it might happen when I logout or shut down my ...
1
vote
1answer
45 views

Unable to view Applications Directory Content in Terminal

Not sure what I'm missing here, but when I try to list the contents of the Applications directory from the Terminal it produces a directory with a couple .dmg files and none of the actual application ...
1
vote
3answers
2k views

Remove patterns from string using bash

I'm trying to remove some patterns from a file input string (parsing file line by line). Here is a sample string: 1: (10/17 12:49:31.175) - CONSTANT ID1 - CONSTANT ID2: RAW DATA OUT > [0x00,...
1
vote
1answer
51 views

Get path of currently marked file

Im running OS X and I'm wondering if there is a way to get the path of the currently marked file in Finder. Like, can UNIX determine what file i have clicked on? Reasons for this would be for ...
1
vote
1answer
62 views

How are files or chunks delimited on disk?

I'm trying to recover some lost files by grep-scanning a hard disk. (The OS is Darwin 11.4.2. The file system is HFS.) How can I determine where a file (or contiguous chunk thereof) begins and ends ...
1
vote
1answer
870 views

How to transfer data “offline” between osx and ubuntu?

I need to transfer around 50gb of data from my Ubuntu to my OSX. scp and samba are both too slow it seems - even with the Ethernet cable connected (14-15 hours!). I have physical access to both ...
1
vote
1answer
142 views

How can I tell why a process is waiting?

I'm trying to run a command on OSX Mavericks and it seems to be hanging. I found out that Control + T is a Unix command to show the status of a foreground job. Pressing it several times over the ...
1
vote
2answers
344 views

Limiting access to a website based on IP address when .htaccess is not allowed

I am trying to limit access to a website to a small set of IP addresses. I am a regular user on the Mac OSX web server. My first attempt at limited access was to create an .htaccess order deny,allow ...
1
vote
1answer
115 views

newsyslog for paths with empty spaces

How can I configure newsyslog to trim logs with paths containing empty spaces? I define my paths at /etc/newsyslog.d/frank.conf like this: "/Users/frank/Library/Application Support/Google/Drive/*....
1
vote
1answer
166 views

How to fix SSH on OSX?

I have been able to connect to OSX machine using ssh client successfully for hours, but then it stops working and I get connection refused. ps -ax | grep ssh 841 ttys004 0:00.00 grep ssh Using ...
1
vote
1answer
35 views

rsync from Mac ext hd to VPS works but not VPS to Mac

There are no errors with either rsync -a /Volumes/hd/dir_foo foo@foo.com:~/ or rsync -a foo@foo.com:~/dir_foo /Volumes/hd/dir_foo in the first instance the synced folder on remote system CentOs ...
1
vote
1answer
468 views

rsyncing from ext3 on mac: file has vanished

I am on Os X and I am rsyncing from a ext3 volume (that I read with osxfuse 2.6.2) to a HFS+ volume. The data I am backupping are ~ 500GB. Sometimes rsync gives the following message: file has ...
1
vote
1answer
69 views

How to create an alias for opening a directory on Mac

Trying to create an alias hello. After typing hello in Terminal, then vi opens hello_folder. Now, this code returns: $ hello -bash: hello: command not found 1 #!/bin/bash 2 cd ~/Documents/ ...
1
vote
2answers
650 views

Mac OS X LDAP query via dscl yields different results for same user with same datasource

Where is the NFSHomeDirectory attribute stored for a Mac user who authenticates via LDAP? It doesn't seem to be in the LDAP database on the backend so I assume Open Directory is involved. I have 2 ...
1
vote
1answer
65 views

OS X virtualization for software development

I am a OS X user and I work on multiple platforms for which I need multiple dependencies. I want to separate my different development dependency packages in virtual environments so they are all ...
1
vote
1answer
1k views

Hide a file extension using Terminal

I have about 40 files in my folder. I selected all the files and pressed command+I. Instead of opening one Get Info window, my Mac shows up 40 windows! Is there a terminal command to hide the file ...
1
vote
2answers
1k views

Mac OS X: Terminal Prompt Username

I'm using Mac OS Snow Leopard (v10.6.8). I've changed the account name under System Preferences > System > Accounts > Full Name. However, that does not change the username on the terminal ...
1
vote
1answer
256 views

OfflineIMAP tells me SQLite isn't installed, even though it is

Whenever I run OfflineIMAP v6.5.3.1 I get an error for every folder (i.e. tag and folder in Gmail) which tells me there was a problem and then right after it tells me: SQLite backend chosen, but no ...
1
vote
1answer
915 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 ...
1
vote
1answer
55 views

why the “open” command runs under the home directory?

Under Mac OSX (Mountain Lion), I have a shell script "a": #!/bin/bash open -a Terminal b which run another shell script "b" using Terminal: echo `pwd` Something interesting is that, no matter ...
1
vote
1answer
67 views

How can I get a regular gcc etc. under HomeBrew under Mac OSX Mountain Lion?

I have a Mac with command-line developer tools installed, including Apple's LLVM C compiler, present as /bin/gcc. How can I get a real gcc installed so that e.g. make will see the standard gcc ...
1
vote
1answer
202 views

How to install wine via brew?

I am trying to install wine via homebrew on Mac OS Mountain Lion 10.8.4. $ brew install wine Error: wine dependency jpeg not installed with: --universal How do I resolve this?
1
vote
1answer
723 views

Where would I find where an .htaccess file is located and being used on a Mac OS X Lion server that sets Basic Auth on an Apache server?

I've installed some software, namely, a continuous integration (CI) server (Jenkins) on a Mac Mini running Lion Server. The server, by default, runs from port 8080 on local host via the url: http://...
1
vote
1answer
155 views

ipfw on Mac OS X 10.8

I'm trying to setup local transparent proxy with ipfw and squid and ran into some problems. I have a single rule 00100 fwd 127.0.0.1,3128 log tcp from any to any dst-port 80 but it either gets into ...
1
vote
2answers
193 views

Keep the ssh session

I am using Macbook developing a client application. I want to access server logs, so I opened a shell terminal and established a ssh connection to the server and access the log file there by ...