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
2answers
165 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
27 views

Reset Bash's memory used for auto-complete

After renaming a file to a similar name, I noticed TAB was still completing the old filename (if it matched the letters so far) and not showing the new one. No matter how many letters I typed, it ...
1
vote
1answer
45 views

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

I use Mac's ssh to get access to a server. I find the emacs on the server can not recognize the ALT key. My server is RHEL with emacs23.
2
votes
2answers
85 views

Unix, Mac OS and Linux?

I am working to learn more about unix and linux for a project. I noticed that Unix is the parent system of Mac OS and also of linux. Are the two similar in scope of C based programming? And how ...
4
votes
3answers
4k views

How do I parse namespaces from an XML file using XMLLINT and BASH

Below I have an example of an Adobe XML swidtag used to track inventory. I need to parse out relevant information using xmllint in bash and output that to a new text file. For example I would like ...
0
votes
3answers
49 views

Echo filtered numbers within a for loop and with an if statement

Desired output: all numbers greater than 5. One of few attempts: for i in {1..10}; do if ["$i" > 5]; then echo $i; fi; done But the output is: -bash: [1: command not found -bash: [2: command ...
0
votes
1answer
41 views

FreeBSD 9.3 and OSX color tags

I am using nas4Free 9.3.2 and FreeBSD 9.3-RELEASE-p22. I noticed after using cp, that my moved files no longer had the color coded labels I had applied in OSX. Share mounted in AFP. To test this, I ...
0
votes
1answer
49 views

How to keep all log files?

I just lost important log file. Time Machine etc is not in use in that Mac. I would like to setup in my Mac (El Capitan) some unix thingie, which keeps all log files. Logs rotate, right? So if i ...
0
votes
1answer
37 views

Ignore parts of script under some circumstances?

My script looks like this strenggen ( ) { something; } strengen 1 strengen 2 strengen 3 strengen 4 strengen 5 etc.. Which adds a few files to the directory called strengen?string=1, ...
1
vote
1answer
49 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
29 views

Terminal tab title not working correctly with MacPorts bash

I'm using OS X Yosemite 10.10.5. When using the default /bin/bash as your login shell, setting the following in .profile: PROMPT_COMMAND='echo -ne "\033]0;${PWD/$HOME/~}\007"' sets the Terminal tab ...
39
votes
6answers
33k views

Is Mac OS X UNIX?

I have this argument recently saying Mac OS X was not UNIX, but Unix-like. I know there is a Single Unix Specification and those spec complaint could use the UNIX trade mark. Is Mac OS X an UNIX ...
1
vote
4answers
4k views

How to troubleshoot failed X11 forwarding with ssh?

When I try to establish an X11-forwarding connection to myserver, I get the following error: % ssh -X myserver xlogo X11 connection rejected because of wrong authentication. X11 connection rejected ...
4
votes
1answer
73 views

Tmux and dim-ed colours in Terminal.app on MacOS

The problem On my Mac (10.11) Tmux does not show dim-ed colours properly, and this causes annoyance. In the following picture, the commit author's name is supposed to be represented in dim white. ...
1
vote
0answers
20 views

Gtk primary key

Is there any way to setup Gtk applications under Linux to force use Super as primary modifier, instead of Control. I tried gtk-key-theme-name=Mac for both gtk2 and gtk3 without success, also I found ...
0
votes
0answers
78 views

Cannot login to SSH with public key

I'm using Yosemite 10.10.5 I think the problem is im missing a file called id_dsa - I have an id_rsaand and i've added the contents of id_rsa.pub to my servers ~/.ssh/authorized_key file. Here is ...
2
votes
2answers
59 views

Get OSX codename from command line

Is there a way to get OSX codename (I.e. Yosemite, El Capitan etc) from command line? I'm not looking for Version information (e.g. sw_vers -productVersion ) which gives 10.10 etc Thanks!
1
vote
0answers
30 views

What are the major differences between the Darwin/BSD and GNU versions of Findutils?

OS X comes with its own versions of find, locate, and xargs. GNU versions of these utilities are also available as part of GNU Findutils. What are the major differences between the two versions? Is ...
1
vote
3answers
1k 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 ...
12
votes
5answers
2k views

Do I need a Linux distro to learn the command line or would OS X be sufficient?

I am going to learn how to use the command line. Specifically, I will be using the book: "The Linux Command Line: A Complete Introduction". Now, do I have to use a Linux distro to walk through the ...
2
votes
2answers
69 views

What Port is Squid Running on in OS X/BSD

I've recently starting playing around with the Squid caching server on my OS X based computer. I'm curious if there's a way to tell which port Squid is running on using netstat or other standard unix ...
1
vote
4answers
89 views

How does the unix path get set when the computer first starts?

I use a mac. If I open a terminal and run echo $PATH I get the current "PATH" variable in my environment. If I add something to my path or to my other environment variables, it only persists for as ...
3
votes
2answers
130 views

Why does deleting directories generate error messages with find -exec?

Why is it that: find . -type d -name test -exec rm -r {} \; generates error messages: find: ./foo/test: No such file or directory find: ./bar/test: No such file or directory find: ./blech/test: No ...
3
votes
4answers
2k views

In Mac OS X Snow Leopard, how can one file's permissions be matched to another?

I need to make the permissions of a file exactly match the permissions of another file in OS X 10.6. I don't see 'getfacl' or 'setfacl' as suggested in some other posts for Linux. And, it doesn't ...
1
vote
2answers
117 views

Apply Colors to Terminal Output to highlight URL & Others

I am looking for a way to apply colors to highlight URLs (http://....) and IP @ in the output of a terminal command. Example would be with a wget command for example where I would like to be able to ...
3
votes
2answers
231 views

Why does my ls --help not work?

Marias-MacBook-Air:~ marias$ ls --help ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
1
vote
0answers
60 views

How to permanently get rid of folder that keeps coming back on reboot

I ran a virus scan with Clamxav on my mac a couple days ago and it picked up on a PUA (Potentially undated app). It was located in /Application Support/Generic/E18VMjMwVtTrc. There was and executable ...
1
vote
1answer
75 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
1answer
37 views

Why different UIs display different size of the same file?

Here's what Finder displays: QuickTime 7: Terminal: Why?
1
vote
1answer
49 views

How to find out if the script is running in Linux or OSX

I want to write a bash script to get some information of Switches through snmpbulkwalk. I would like to use the same script in Linux and OSX environments, so I want to know if there is a way to do a ...
-1
votes
1answer
26 views

Booting a Linux environment CD on a Macbook Pro

Im trying to boot my Linux environment on my Macbook pro which doesn't have a CD reader. I got the files on the CD but still can't figure out a way to boot it upon start up. Is there any way to make ...
1
vote
0answers
25 views

Mac OSX, how to auto generate a select box of locally installed printers?

Short introduction into the current architecture of a POS program which I am currently developping: + Web based database server + locally installed Mac Mini (Yosemite, headless) with database mirror, ...
0
votes
1answer
76 views

How to use content address in sed on osx without error “expected context address”

I'm getting this error sed: 2: " /^[[:space:]]*pause$/, ...": expected context address with this line: /^[[:space:]]*pause$/,+1d which works on my debian Ubuntu system. The full file is ...
5
votes
1answer
186 views

Show output on terminal and output to log file, without using tee

I want to run a command, then show the output on the screen as well as output it to a log file, currently I use tee -a, but the problem is tee doesn't preserve colours, and currently I have not been ...
0
votes
1answer
233 views

Getting RE error: repetition-operator operand invalid on osx sed

I'm copy a sed script form Ubuntu debian to osx but getting RE error: repetition-operator operand invalid What is wrong? $ . sed_shorter_version_user_extensions_to_ruby.sh sed: 22: " ### DELETE ...
2
votes
0answers
155 views

Unable to delete Root CA (UNIX: operation not permitted)

I am trying to delete a root certificate authority from my Mac OS machine. When I try this from the 'Keychainaccess' program it asks for my password and then shows 'ecKeychainItemDelete: ...
2
votes
3answers
55 views

find and md5sum not yielding any output (find -o limit?)

I ran into a situation that I don't really understand. I have a bunch of backup files in a recursive structure of which I want to calculate the md5. When I add some additional file extensions the ...
3
votes
2answers
2k views

Mac OS X partition type problem

As a 2 decades of MS-Windows user I have switched to Mac OS X a month ago. And my knowledge is not enough to fix my big problem which I encountered yesterday and my brand new MBPro is dead now. I ...
2
votes
3answers
36 views

Is there a way to colourize the output of a command without using bashrc/bash_profile?

I have made a program where I can read several logs from different programs, I want to colourize certain terms in the output , so I can find the more interesting parts. (I will not use grep or ...
1
vote
2answers
349 views

How to split a directory of files into sub-directories

I have a directory full of files similar to these: 3260_661901_2008-2008.dat 3260_661901_2009-2009.dat 3260_661901_2010-2010.dat 3260_661901_2011-2011.dat 3260_661901_por-1998.dat ...
3
votes
0answers
67 views

Route keyboard through only /dev/ttys000 on Mac OS X [closed]

I have a USB RFID reader which acts as a HID - pretending to be a keyboard. If a card/tag gets close it 'types' 01234567890\n (ie. the tag's code followed by a newline) straight into the active ...
1
vote
1answer
167 views

Connect to an Ubuntu VM from a terminal on the host machine

I'm running an instance of Ubuntu Server 14.04 inside VirtualBox, and for multiple reasons, I prefer to work with it using the terminal emulator on the host system (OS X 10.0) than with the default ...
0
votes
0answers
74 views

How to install Wine 1.7.50 on mac

I want to install WineHQ 1.7.50 on macbook pro as it supports DirectX11. I tried installing it from source but I get random warnings but no errors were thrown. ./configure make depend ...
0
votes
0answers
25 views

fs_usage: a part of stdout is missing.. Where did it go?

I'm using $ fs_usage -f diskio to spy on processus when I hear my hard drive spinning for no reason, so that I know who is working so hard.. Here is one sample line: 16:14:13.785568 ...
4
votes
4answers
30k views

How to put Mac OS X wireless adapter in monitor mode

I'm searching for a equivalent of "iwconfig eth0 mode Monitor" in Mac OS. From man iwconfig mode Monitor does the following: "the node is not associated with any cell and passively monitor all ...
2
votes
0answers
37 views

Compiling FreeBSD on OSX

I currently have the source for the FreeBSD kernel. I want to compile it and create an iso image, on my OSX 10.9 computer. Can this be done? Do I need any other tools?
1
vote
2answers
349 views

Linux System calls in C on OSX

So I did a quick test and #include <sys/types.h> #include <unistd.h> #include <stdio.h> int main (int argc, char *argv[]) { printf("Hello World\n"); ...
1
vote
1answer
77 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 ...
0
votes
1answer
41 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
32 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 ...