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

How to tell the sizes of files and folders, sorted, and in MB, GB, instead of a long integer?

On a Mac, using Bash, I tend to do du -sh * to tell the sizes of files and folders in the current directory, in MB and GB. But if I want to sort them by the sizes, I might do du -sh * | sort -g ...
1
vote
2answers
750 views

Linux guest VM on mac host - Keyboard

I use a Mac as a development box, but am slowly transitioning to Linux. So I am spending the majority of my time in the Linux guest VM while working. But I still spend a fair amount of time in Mac ...
21
votes
8answers
51k views

How can I display the contents of a text file on the command line?

I would like to display the contents of a text file on the command line. The file only contains 5-6 characters. Is there an easy way to do this?
0
votes
1answer
22 views

find returns weird file order on RHEL but not on OSX [duplicate]

When I enter find . -iname "[0-9]*.nii" on my OSX machine it returns: ./03_Rest_fcMRI/9793_01_03_1.nii ./04_VEMP/9793_01_04_1.nii ./04_VEMP/9793_01_04_2.nii ./05_Tapping/9793_01_05_1.nii ...
1
vote
1answer
16 views

How do I get the Truecrypt CLI installed?

I have a unix machine with truecrypt 7.1a installed. I'm trying to mount a volume to test with the command line but I don't have the truecrypt command installed evidently. Did the command line ...
0
votes
1answer
8 views

printenv.wsf and printenv.vbs in /Library/WebServer/CGI-Executables

Please don't shoot this one down, as I looked through my Macbook Air and wanted to configure my Apache installation to more specific needs, I came across printenv.wsf and printenv.vbs, which I find ...
1
vote
1answer
9 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(!), ...
3
votes
1answer
2k views

Sound volume control does not work in Ubuntu

My sound volume control does not work when I'm logged in with my regular user, though the sound works correctly. What's weirder is that the sound control works when I'm logged in as guest. With my ...
2
votes
1answer
63 views

Best way to connect to an existing user context through SSH

What we would like to do: We have short living virtual machines for running scripts. The virtual machines are used through SSH to perform "builds" (sequence of scripts) and discarded once all the ...
2
votes
1answer
32 views

Installing Linux with USB on Mac

I am trying to get Ubuntu (version 14 I believe. It's the latest version) installed on my Macbook Pro (Late 2013 edition 13 inch, no disk drive in it) via a USB Flashdrive. I have followed every ...
11
votes
5answers
2k views

Using text from previous commands' output

EDIT April, 2015: If you have this same question I recommend also checking http://xiki.org/ I know this is not how terminals work, but I find myself often wishing there was an easy way of using ...
32
votes
7answers
8k views

what does the @ mean in ls -l?

I am using Mac OSX. When I type ls -l I see something like drwxr-xr-x@ 12 xonic staff 408 22 Jun 19:00 . drwxr-xr-x 9 xonic staff 306 22 Jun 19:42 .. -rwxrwxrwx@ 1 xonic staff 6148 25 ...
5
votes
1answer
94 views

Edited sudoers file with text editor - now can't run sudo

I now know that I should never try to edit the etc/sudoers file with a regular text editor. However, minutes before I learned this, I saved a new user name in the file with Sublime Text. Now when I ...
13
votes
6answers
2k views

Is there a root password on OS X and Ubuntu?

When you setup a new Ubuntu or OS X installation a user is generally created for you. On OS X it is whatever username you pick. On Ubuntu (the server version) usually the ubuntu user is created. The ...
1
vote
1answer
63 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
782 views

Yosemite + Fusion 7.0.1 now gets “Could not open /dev/vmmon: No such file or directory.” and will not start any VM

I've been on Yosemite on this machine since it hit released, and on Fusion 7 since it released. Now on 10.10.1 and 7.0.1 respectively. On one machine ...
3
votes
2answers
95 views

sed: inserting text before end of <HEAD> section

I need to insert some text into an HTML file before the end of the HEAD section. I'm trying: sed -i "s#</head>#<style> @page { prince-shrink-to-fit: auto } ...
1
vote
2answers
2k views

How to install Broadcom BCM4360 on debian on Macbook pro

I'm trying to install the wireless drivers because my macbook pro does not have a ethernet port, then I mount the 3 debian isos like local repositories to install the almost all of dependeces. So, ...
0
votes
2answers
37 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?
1
vote
2answers
1k views

How to change the output color of ls comman in terminal in OS X and iTerm2?

I know that a similar question has been as in: How to colorize output of ls ? Though, I didn't really understand the answer and couldn't really make it work. However, I have tried something ...
2
votes
3answers
201 views

Why root does not source .bash_profile?

Everytime I try to login as root using su (not su -), it doesn't source .bash_profile in user1's home directory. Basically my /var/root directory doesn't have .bash_profile, so I put a copy of ...
1
vote
2answers
70 views

Mac Terminal - rename *.png.png to *.png

I have a bunch of images that I'd like to rename as follows: *.png.png --> *.png *.jpeg.jpg --> *.jpg *.JPEG --> *.jpg The only thing I've tried thus far is mv *.png.png *.png, but I knew ...
1
vote
2answers
138 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 ...
0
votes
0answers
31 views

Swap OS X Command/Control keys without changing bash shortcuts

I originally asked this on Ask Different, but I think since my issue is probably more with bash this would be a more appropriate site. First of all, I know that you can use the System Preferences to ...
1
vote
1answer
907 views

Confused about how to convert XML to CSV using xmlstarlet on OS X?

I asked a question earlier and it was closed as being a duplicate: How to parse XML to CSV with a shell script?. The answer in the duplicate that was linked suggested using a tool called XMLStarlet, ...
9
votes
3answers
70k 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?
21
votes
5answers
10k views

How can I tell what version of OS X I'm on from the command line?

I frequently find myself SSHing into various OS X machines, and it'd be useful if I could tell what version of OS X I was on when I'm doing that. uname -a doesn't quite work, since Darwin kernel ...
0
votes
0answers
26 views

csvkit Permission denied

I am on Mac and installed csvkit. When I run csvlook, I get a traceback with the following error message: IOError: [Errno 13] Permission denied: '/Library ...
1
vote
3answers
133 views

Shell expansion for arguments?

For example: mkdir ~/{1,2,3} Creates directories ~/1, ~/2, and ~/3. It equates to: mkdir ~/1 mkdir ~/2 mrdir ~/3 But, using the same syntax in the case of CMD < argument > : brew {install, ...
0
votes
0answers
36 views

Process Being Killed due to low swap

I'm running a python (2.7) script on mac osx yosemite. The script is fairly computationally intensive, certainly bumping up against my machine's RAM limitations. The computer crashes and restarts ...
0
votes
1answer
596 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 ...
15
votes
8answers
9k views

pgrep and pkill alternatives on mac os x?

Are there alternatives to pgrep and pkill commands on Mac OS X or should I just create aliases for them using other commands available for me?
2
votes
0answers
36 views

Catch/diagnose user process being killed - Inexplicably logged out automatically

Context: I'm using bash in Mac OSX Yosemite. Problem: I'm executing a (python) script that I expect to use alot of resources and take a few hours to run, redirecting stdout and stderr to a log file. ...
0
votes
0answers
39 views

Running Mac OS X under KVM/QEMU

Note to be removed in the future, so as to avoid confusion from answerers and mods edit: Forgot to add in the note, if anyone thinks this is the wrong stack-site to post this, please comment on why, ...
2
votes
0answers
27 views

Content of root's home directory in OSX

What is stored in root's home directory on OSX? What happens if you delete it on accident? Heres whats in my current root home folder. OSX:~ root# ls -lash total 8 0 drwxr-x--- 5 root wheel ...
0
votes
1answer
33 views

Sed a plist file gives a iilegal byte sequence

With a Unix Mac 10.9.5, French CA version I've read a lot of tips but if the error is gone, the plist is corrupted. the locale command gives: LANG="fr_CA" LC_COLLATE="fr_CA" LC_CTYPE="fr_CA.UTF-8" ...
2
votes
1answer
41 views

macos - local port redirection using pfctl and syntax errors

I am running MacOS(really BSD), and I want to redirect certain traffic over an ssh tunnel using a a local forward. Seems easy enough, but I am repeatedly blocked by the ambiguous "/etc/pf.conf:29: ...
2
votes
0answers
57 views

Where does BPF packet capture read its data from?

I am interested in the low-level interfacing with network packets. From what I read, tools like tcpdump and libpcap use the BPF packet filter device /dev/bpf* to read link-layer network packets (on ...
1
vote
0answers
23 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
votes
1answer
30 views

Transfer executable file from Linux to mac

I have a file that is sitting on my server, this file is an executable file on the server. When I just use SCP to copy it down to my desktop which is a mac i get bash - ./fig up cannot execute binary ...
1
vote
1answer
37 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
59 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 ...
9
votes
3answers
2k views

How can I get the tac command on OS X?

I like to use tac to reverse the output of cat. However, it's not available in the Mavericks terminal. I tried to find it on MacPorts and again it's not available. Can anyone please show me how to get ...
0
votes
0answers
18 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 ...
3
votes
1answer
1k views

Transferring Files SSH SCP Error Message: 'Stdin: is not a tty'

I am using a Macbook SSH terminal and generated RSA key pairs and uploaded remote id_rsa.pub with approved permissions. I can connect with remote Apache web server. I can create, open, move, modify ...
2
votes
2answers
45 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
0
votes
2answers
172 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
0answers
32 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
0answers
23 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
55 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 ...