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
0answers
313 views

Macbook Pro Retina 2015 Wifi problems on Kali

I have successfully installed Kali 2.0 on my Macbook Pro retina 2015 model running El Cap via dual boot. I do have some experience with ubuntu etc, and thought I'd try Kali for multiple reasons. Now,...
1
vote
2answers
69 views

Generate unique numbers RANDOM function OS X

I am creating a random generator based from a number array list. However, I would like it to be unique so that random number cannot be used again. I have tried creating a 'USED' array list which will ...
0
votes
1answer
492 views

Upgrading from Python to 2.7.10 to 2.7.11 on OSX

How can I upgrade Python from 2.7.10 to 2.7.11 on OSX (Yosemite)?
0
votes
1answer
54 views

Umount command unmount two mount points

I have two mount point say, /volumes/dir1 and /Volumes/dir2. When I umount one volume the other automatically gets unmounted. The volumes are mounted from remote system. They output different file ...
0
votes
2answers
87 views

Resource usage (% CPU) for given command on OS X

The time -v command outputs % CPU utilization for a given command on Linux. How do I do this on OS X? The Linux/OS X difference is illustrated here. I would like to measure multi-core utilization ...
2
votes
2answers
93 views

sed to match pattern between matching curly braces

From a pattern such as [string 1]{string 2} I want to extract string 2, the string between the last pair of matching curly braces -- that is delete [string 1] and the open { and close }. My ...
0
votes
2answers
43 views

Is there an equivalent of javascript Math.min() in bash/bc etc.? [duplicate]

I need to convert some javascript calculations to bash, and I am wondering if there is an equivalent function of javascript Math.min() in bash, bc or any other calculator in the shell?
1
vote
0answers
32 views

How do you pass variables to jsc/javascript?

I have a few javascript things that I am running from the Terminal by passing them to jsc, with <<<. (javascript is an alias to /System/Library/Frameworks/JavaScriptCore.framework/Versions/...
0
votes
0answers
44 views

Array Creator Bash OS X not expected output

I am creating a script which will prompt a user to enter a location of a text file and based from that it will create an array. First Question The text file that I am using is sample.txt and it is ...
3
votes
2answers
119 views

How to delete, without rm/unlink

Related to another question I asked here [http://unix.stackexchange.com/questions/253932/rename-folder-with-odd-characters] I'm wondering if it's possible to bypass the normal rm/rmdir/unlink ...
0
votes
0answers
23 views

how to interpolate a variable in a string to be called from the cli [duplicate]

I would like to have: alias lstime="gfind -type f -printf '%T+\t%p\t%k kB\n' | sort -nr | head -${1}" in my .bash_profile on El Capitan. So that I can call it via: lstime 10 and that the 10 ...
0
votes
3answers
81 views

strange vi behavior on OSX Debian ssh terminal

While creating a swapfile I issue vi /etc/fstab as root. fstab file comes up, great. Issue G $ to jump to end of line and i to enter INSERT mode. Press the right arrow to move the cursor over by one ...
1
vote
1answer
256 views

Get absolute path of file OS X

I am creating a script which will prompt the user to enter a location of file and it will convert it to an absolute path. This is what I have so far. I'm not sure how to append these together. ...
0
votes
1answer
55 views

Tmux raspbian installation

i have installed tmux on my pi (raspbian jessie) it has installed ok but when I ssh from osx command + b + " doesn't work, or any other command for that matter. Do I need to create a config file?
2
votes
1answer
83 views

Can a bootable NetBSD be built on OSX?

I've got OSX 10.9.5 . I want to build NetBSD (or at least it's kernel) on my OSX box. I've tried building the 'config' program but I can't find 'build.sh'. Is this possible and what would be the steps ...
1
vote
1answer
35 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
2answers
996 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 ...
6
votes
3answers
570 views

Any tips for surviving Terminal.app?

I've recently switched to using a Mac full-time, and am having trouble getting used to Terminal.app after years of loving gnome-terminal. I miss having URLs show up underlined, using alt+arrow to ...
0
votes
0answers
15 views

Delete SharePoints Mac

I have a Fileshare on a macMini with this Name $ dscl . -list /SharePoints 01_Produktion_Repro_%0 But if I want to delete this Share, I get an error: $ dscl . -delete "/SharePoints/...
3
votes
1answer
26 views

command-click git commit ID in Terminal, and be taken to that commit in github?

I'm running a Mac and use iTerm with ZSH as my shell. Currently I can command-click (⌘+click) on links or directories in my iTerm window, and that directory or web link will open. Is there a way (...
3
votes
2answers
1k views

Vim script check running platform

" Get running OS let os = "" if has("win32") let os="win" else if has("unix") let s:uname = system("uname") if s:uname == "Darwin" let os="mac" else let os="unix" endif ...
0
votes
1answer
26 views

Find out user logged in at specific time on Mac OS X 10.11.x

I'll like to find out which user was logged in at a particular time that a file was created. I'm having trouble with the "Last" command when attempting to use the "-t" switch. Open to any ...
1
vote
0answers
22 views

Search drive and copy source to flat target

I have backups and backups of backups (there are copies of copies) of images spread out over various drives. I want to scan the drives and copy all images from a source to one flat target directory. I ...
20
votes
4answers
10k views

How do I configure Emacs to use 'ispell' on Mac OS X?

I'm using brew as my package manager for both Emacs and ispell. I have both installed. Doing a quick google, I was unable to figure out how to tell Emacs where ispell is and to load the appropriate ...
2
votes
1answer
121 views

Why do I have 9 bash processes, why does one of them take up so much CPU and how do I stop them?

I have 9 different bash processes running at all times (I sometimes get more, for example, I have 37 bash processes now.). I found this question, where OP had a similar issue. But I don't see this as ...
1
vote
0answers
47 views

Deleting / renaming a network hardware port in OS X / Darwin

This is a problem that so far no one at Apple.SE could help me with, so I'm just gonna give it a shot to ask it in a different form over here. (I hope I'm using the right SE site... or is this better ...
3
votes
2answers
69 views

Replace only on the first matching line with sed

Using BSD sed (no GNU extensions), how can I perform an operation similar to the example provided below, but where instead of the line number, the replacement is performed on the first line in which a ...
0
votes
2answers
48 views

Can you fake a SOCKS5 proxy?

What I'm wondering if there's a possibility to do something like curl --socks5-hostname 127.0.0.1:8080 url.com Without actually going through any proxy, just your normal internet connection, ...
0
votes
1answer
106 views

How to read the man page for a bash builtin? [duplicate]

So, I needed to figure out how "exec" works. However, doing man exec brings me to a 99% useless man page describing what bash builtins are. It of course also does this with many other man pages such ...
1
vote
2answers
62 views

Metasploit Directory Doesn't Run Executables Without ./

I have Metasploit installed on OSX in /usr/local/share/msf Metasploit's executables can't be run outside it's directory thus would give a command not found error. msfbinscan msfconsole msfd ...
4
votes
1answer
359 views

Why GNU find -execdir command behave differently than BSD find?

On my OSX, I've installed GNU find next to default BSD find via: brew install findutils. As far as I understand, BSD find is following POSIX standards and GNU makes it optional (as per this post), ...
0
votes
0answers
19 views

How to make versions consistent

I'm using OS X 10.10, and IIRC I've installed bash and other GNU utilities using brew. The output of which bash is /usr/local/bin/bash, and it's version is 4.3, however the env variable SHELL points ...
1
vote
1answer
41 views

Don't run this sed when a string is matched?

I have this sed command for deleting numbers inside of tags: sed 's/\(<[^0-9>]*\)[0-9]*\([^0-9]*>\)/\1\2/g' But does anyone know how I can exclude certain strings from this? Now it would ...
1
vote
1answer
714 views

Printing to Linux CUPS printer from Mac El Capitan - fills error_log and doesn't print

any ideas on this one? I'm trying to print to a CUPS printer running on Debian from a Mac running OSX 10.11 El Capitan. When I try to print, my /var/log/cups/error_log reads: D [12/Oct/2015:00:59:04 +...
1
vote
2answers
53 views

Appending Echo [Password Generator]

I am creating a password generator however I am not get the passwords to append properly. Here is my script i="0" while [ $i -lt 5 ] do echo -n '#' >> passwords.txt && openssl rand ...
0
votes
1answer
15 views

Virtualizing OSX partition on MacBook running Linux

I have a Macbook Pro with a partitioned drive that hosts Arch linux and OSX. Linux is my main development environment but occasionally a need arises to test some code on OSX. This doesn't happen often....
1
vote
1answer
508 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 ...
0
votes
0answers
1k views

lrzsz doesn't working in my Mac OS X

When I was used secureCRT in Windows, I often used sz and rz to transfer files between my linux server and client machine. But I can't use that way in iterm2 in MacOS X. lrzsz package has installed ...
3
votes
1answer
56 views

How to I convert month name to number in BSD date?

I have found solutions for GNU date, but not for BSD date. I would rather not make an if, etc. before I know if there's a built in way.
1
vote
3answers
2k views

zsh alias being overridden somehow

I'm on a system running OS X 10.8.5. I recently tried to alias ls to ls -G -la command. I opened up ~/.zshrc, put in the alias, relaunched the terminal, but the change didn't take effect. Upon ...
1
vote
0answers
31 views

Is there a GNU/Linux equivalent to the Mac OS X open command? [duplicate]

In Mac OS X there is a handy open command that opens the target file or directory in the default GUI application meant for it: open /usr/local/share will bring up a Finder window with the /usr/...
4
votes
2answers
477 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 ...
1
vote
0answers
48 views

Certain squid functions don't work, sometimes nothing at all work

I set my proxy to 127.0.0.1:3128, and then I added this to the configuration file: acl blocked_sites url_regex -i "/usr/local/etc/squid/blocked_sites" http_access deny blocked_sites http_access allow ...
6
votes
2answers
261 views

What is causing `diff` to run `git diff`?

I'd like to use diff as described here and in the documentation I see when I type man diff. However, when I type diff, what I get is this: ~ ❯❯❯ diff usage: git diff --no-index <path> <path&...
3
votes
2answers
53 views

dnsmasq does not listen to conf file

I have installed and started dnsmasq, using brew install dnsqmasq and sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist respectively. I tried to use the "adress" function inside ...
1
vote
1answer
40 views

Can't connect from OSX to FreeBSD with mosh [closed]

I've installed mosh on my laptop using Macports and on my FreeBSD server using ports. Whenever I try to connect to my server I get the following error: Password for xxxxxx@xxx.xxx.xx.xx: zsh:1: ...
20
votes
7answers
5k views

OS X: how to keep the computer from sleeping during a ssh session

When I ssh into a OS X computer on my network the session lasts until the OS X goes into sleep mode. Is there a way to prevent this from happening during my SSH session, apart from physically bumping ...
4
votes
2answers
283 views

How can I tell if a directory is mounted with noatime or nodirtime?

I work with an NFS partition on a mac. Commands like du take a very long time, and I was considering unmounting the NFS and remounting it with noatime and nodirtime. The partitions have been mounted ...
1
vote
1answer
56 views

Why doesn't this work when I add it to the current sed being run?

I have a text file that looks like this: (empty) str int int If I add this s/^/\</g to my current sed (making it 's/\&/\</g;s/\</\ /g;s/^/\</g') this is the output. < ##only ...
21
votes
3answers
165k views

How to install apt-get or YUM on Mac OS X

I am new to Mac OS command line, I want to use either of apt-get or yum. Can anyone help me to install them and make them successful running?