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
1answer
16 views

OSX: Delete all matching certificates by command-line

Using shell script to delete all matching certificates. I found a list of certificates using: security find-certificate -c "certificatename" -a -Z|grep SHA-1|awk '{ print $NF }' Output is like ...
-1
votes
0answers
38 views

How can I make a Linux system output a bell sound when no packet is received before the next packet is transmitted with the ping command?

This is easy enough on OS X. I just use ping -A example.com and it works just fine. (Note the capital "A".) But it doesn't work like that on Linux. On Linux, the manual page reads as follows: ...
0
votes
1answer
21 views

replacing first link of a text “awk equivalent of sed command”

I wanted to replace the first line of a text with sed it should be like sed -i.bak "1 s/^.*$/"CompoundState\tMethod\tApproach\tS^2\tEnergy\tPath"/" awk.xls but I also need to run it on OSX but it ...
0
votes
0answers
16 views

Preserve colours when piping to tee

I have made a little program where I update homebrew with brew update, then I send the output to a log file, but I also want to keep it on the terminal so I use tee. The problem is, it doesn't show ...
3
votes
5answers
252 views

How can I get the raw formatting output of commands?

I'd like to know which control sequences are sent to bash by programs to format their outputs. For example, if I dump man less I can discern which parts are bold or underlined. ...
3
votes
2answers
45 views

What is the problem of giving the right to use sudo vim? [on hold]

I'm using Mac OX 10.10. I would like to know what problems are caused by this: user ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf I think this is in /etc/sudoers. I also have Cent OS. Does this ...
-1
votes
1answer
20 views

Macbook Pro Display Issue (Tiny blue squares) [on hold]

My Macbook Pro display recently started showing tiny blue squares everywhere on screen. I have tried doing VRAM and PRAM reset, upgrading to Yosemite but downgraded because it was very slow and I ...
1
vote
0answers
10 views

How can one enable sharing for a mounted volume via command line? (2 Macs)

I am trying to remotely enable "sharing" on a volume connected to a remote host. So, in other words, from my local machine I'm trying to ssh into another machine where a volume is already mounted. ...
0
votes
2answers
13 views

how to locate vim which installed by brew?

I have installed a vim using brew, and it was installed to a very different place, and now I want to locate that vim, in a shell script, is there a good approach for this?
0
votes
2answers
36 views

Check if process is running Mac OS X then execute code

I am creating a script which clears the cache for Google Chrome. However, I would like to check if Chrome is open and if so not run the code but if it isn't then it will execute the code. I can see ...
1
vote
1answer
25 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 ...
0
votes
1answer
18 views

The server Emacs can't recognize the ALT key when link by a Mac

I use Mac's ssh to get access the server. I find the emacs in server can't recognize the ALT key. My server is REHL with emacs23
2
votes
2answers
39 views

How can I make the `cal` tool in OSX highlight the current day?

In Ubuntu and Fedora, when I type cal on the command line I get an ASCII calendar with the current day highlighted. In OSX, when I type cal, I get an ASCII calendar but no day is highlighted. How ...
1
vote
1answer
57 views

How can I *automatically* backup my contacts in Google Contacts/Gmail?

On a similar theme to this question, how can I automatically (on a schedule) back up my contacts from Google Contacts/Gmail from the command line (Linux or OS X)? Ideally, this mechanism would be a ...
-1
votes
0answers
18 views

How do I create a telnet server on Mac OS 10.10?

I want to create a telnet server on my mac and I am running Yosemite (10.10). I have successfully enabled telnetd (I think) but I type telnet localhost it asks for my login and password. I enter in ...
1
vote
0answers
28 views

What exactly files whose names' prefix is “AT.postflight.” are needed for?

I am not sure if this question should be asked here, since I am on an OS X, but since I am using bash, and I am asking about the meaning and the purposes of some files. I am trying to understand why ...
0
votes
1answer
22 views

OS X Directory Services

I have been reading from Advanced Programming in the UNIX environment (Stevenson and Rago), and I am currently reading about how user data is stored on various systems, including Linux, FreeBSD, and ...
1
vote
2answers
30 views

List all directories whose contents (files) have not been updated or accessed before a certain date?

Would like to easily located folders to archive/trash and an easy way to automate this would be to choose folders I haven't made any use of for years. Since folders themselves can have different ...
2
votes
4answers
57 views

Join pattern line and consecutive non-empty lines, separated by commas and enclosed in ()

I have a file that has click css_add_violation_false click css_add_claim_false and select css_driver1_birth_date_month birth_date_month select css_driver1_birth_date_day birth_date_day How ...
0
votes
1answer
23 views

Offlineimap unknown SSL protocol error

I am using offlineimap to fetch mail from several IMAP servers. This used to work but today offlineimap has been unable to fetch mail, producing the following errors: *** Processing account example ...
3
votes
0answers
21 views

cursor and combining diacritics in shell

I frequently deal with combining diacritics, especially the combining acute accent (U0301, or \xcc\x81). I have a keyboard set up to insert this character, and that works fine in the shell. $ echo а́ ...
1
vote
1answer
16 views

tstime and memory usage

So I am interested in measuring the high-water memory usage of a process. I would love to be able to use tstime but am having troubles figuring it out. Does it work in Unix? When I go to ...
0
votes
1answer
58 views

What's wrong with this grep?

> output2.txt cd # some directory i'm trying to search find views/shared -type f -name "*.js" -print0 | while IFS= read -r -d $'\0' line; do echo -n "${line%.js}" | tee -a ...
1
vote
2answers
25 views

Bash not sourcing ~/.bash_profile on os x

I just got this really wierd poblem. 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
3answers
54 views

How to copy contents of a (large) vim file to the OSX system clipboard to paste in other apps?

I like to use vim to edit other (non-programming languages) stuff. So I paste the content into vim and make the changes. How can I copy all of the text back into the primary clipboard for pasting? ...
0
votes
0answers
19 views

On OSX, vi seems to return 1 unexpectedly despite no error

So, on stock Mac OSX Yosemite, if I run vi /tmp/foo and then type in some text, and finally do :Wq (a common typo I make) and then :wq. Everything will appear to be fine, but for some reason the exit ...
3
votes
1answer
59 views

Shuffle two parallel text files

I have two sentence-aligned parallel corpora (text files) with about 50 mil words. (from the Europarl corpus -> parallel translation of legal documents). I'd now like to shuffle the lines of the two ...
0
votes
0answers
9 views

Audio File Search, Count and Sort - OS X or Synology

There is a collection of audio files on a Synology NAS. Approximately 24,000 albums worth, that I need to analyse and report on. I will need to: Count total number of files Count types of files ...
3
votes
1answer
51 views

Round-tripping text through zip, unzip fails with 'extra bytes' error on OS X [duplicate]

I'm trying to zip streaming text, and unzip it later. A minimal example is: echo "Hey, could you zip this for me?" | zip hello.zip - ; unzip -p hello.zip This fails, with the following output: ...
0
votes
2answers
56 views

open(1) in rifle.conf for ranger on OS X

ranger ~/.config/ranger/rifle.conf For simplicity What one line – in the rifle configuration file – could cause open(1) to be used for all types of file? Background ...
3
votes
1answer
34 views

How to prevent swapping on Mac OS X?

I am inclined to run Tails through a virtual machine so that I could chain two VPNs. One running through the host Mac osx and one more running from inside the virtual machine that's running Tails. ...
2
votes
3answers
58 views

Get Name of Computer Cross-platform?

I'm creating a login message for my computer inside of /etc/bashrc and would like to greet them to the computer with the computer's name showing. Here's my code: # (system stuff here) echo "Welcome, ...
0
votes
1answer
21 views

X11Fowarding not working on Arch Linux ARM

I am trying to setup X11Forwarding between my Arch Linux ARM server and my OSX computer. I am accessing the server locally (always). /etc/ssh/ssh_config: X11Forwarding yes AddressFamily any ...
1
vote
0answers
10 views

How and when is keyboard data encoded from keyboard to application? [duplicate]

I hope this is not the wrong place to ask this, if it is, please point me in the right direction. As the title says, how and when is keyboard data encoded? I just wanna know in basic terms the ...
1
vote
2answers
38 views

Insert multi lines after match using Mac's sed command

I have 2 files:- a.xml <project> <modelVersion>4.0.0</modelVersion> <parent> ... </parent> </project> b.xml <project> ...
-1
votes
2answers
48 views

Find file, Edit text within files

Im trying to find a file then edit the text within these files. This is what I have so far, but sadly Im not that well versed... Help Please? grep -rl "wrongtext" ~/Library/Calendars ...
0
votes
0answers
20 views

Ubuntu 14.04 VM resizing in VMWare fusion 7 whenever a terminal is opened?

On a computer at work, we have a virtual machine running that resizes the whole VMWare window whenever you launch a new CLI terminal window within the VM. Any ideas how to fix it? It's quite annoying. ...
1
vote
0answers
41 views

Using curl results in error: “Library not loaded: /usr/local/lib/libcurl.4.dylib …”

I had a few issues with the cURL library interfering with Homebrew. After hopefully removing the library (I no longer use it anyway), I started receiving errors whenever I used commands such as curl ...
4
votes
3answers
147 views

How to copy recursively and change file names to be unique

I have a large tree containing a lot of photos on an external drive that was formatted with one of the linux filesystem types (don't remember which one). It's mounted on my mac and I'm trying to copy ...
0
votes
0answers
56 views

Remote X11 applications have wrong keyboard mappings (local: OSX, remote: Linux)

I am connecting from a Mac (with OSX 10.6) to a Linux machine (with CentOS 6.6) by using the ssh command (ssh -X). On the Mac side, I am using the Terminal app. After logging into Linux, I can use ...
2
votes
2answers
80 views

How can I setup a separate bash environment with only GNU utilities on OS X?

For the last 5 years, I have used linux as my everyday OS for performing scientific computing. My work recently gave me a Mac that I will be the primary user for the next few months. I keep running ...
0
votes
1answer
30 views

How to send a NDP message?

I would like to send a NDP ( Neighbor Discovery Protocol ) message from my Mac on the network to discover which device is available or not. How can I do this ?
2
votes
1answer
62 views

rsync over SSH sometimes very slow--other times maxes out bandwidth

I have a bash script set up on computer A (Mac OS X) set to run every five minutes via a cronjob. This script checks for new files on remote computer B (Gentoo Linux) then rsyncs any new files to ...
0
votes
1answer
19 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, ...
2
votes
1answer
37 views

using dd command for folder, but deleted items don't seem deleted [closed]

here is the image I used dd command to create a new floppy. First I tried it with a folder filled with naber.bin, test.bin, blabla.bin and boot.bin. And then i deleted all except boot.bin. ls -a ...
1
vote
1answer
50 views

Installed PDFInfo with Homebrew Cask but no command associated with “pdfinfo”

First, please excuse this very basic question. I'm sorry I have to ask it, but it's very difficult to find your way around the shell at the beginning. I installed pdfinfo with Homebrew Cask: brew ...
0
votes
0answers
35 views

How do I move files from a disk image using Terminal.

I downloaded an application (LaTeXiT) that installed itself as a disk image. I navigated to /Volumes and into the disk image, but when I try to move the contents to my /Applications folder, it returns ...
0
votes
0answers
59 views

Dual Booting - MAC OSX

I'm new to the whole Linux OS and want to use a distro called "Parrot Security" Problem is, I have a Mac Laptop to which I want to dual boot from. I've installed reFINd and tried to boot from a ...
1
vote
1answer
23 views

To recover OSX data in Debian

I have had taken backups by TimeMachine and now my Macbook Air 2013-mid finally died so I have to rescue files in Debian 8.1. However, it seems that no backups of so directories have been taken. I ...
0
votes
1answer
159 views

“dyld: Library not loaded: /usr/local/lib/libcurl.4.dylib” while executing curl with a unprivileged user

My MAC OS is Yosemite 10.10, which has an old version of curl. I have installed Xcode and Xcode command line tools. I run cURL with the "sudo" command as “sudo curl”: sudo curl Password: ...