questions narrowly about terminal.app alone should use this tag. Please consider using **command-line** for any question not specifically about the native terminal app

learn more… | top users | synonyms

1
vote
1answer
59 views

How can I find the serial number of my Apple Keyboard USB on a mac programmatically from the terminal?

I would like to retrieve the Apple USB Keyboard's serial number from a command to use in a script. What command can I use ?
-1
votes
1answer
27 views

Downloading music

if I download music from a legitimate website, like amazon or iTunes, and half through my download I receive a Facebook notification or a text message or phone call on my phone, will the notification ...
2
votes
1answer
24 views

Automator task to open screenshots in Preview automatically

I'm pretty new to Automator but it seems like it's possible - I just can't seem to get it to work. I'd like to be able to take a screenshot and then open it up in Preview for easy annotation. If it's ...
2
votes
3answers
148 views

Set the result of command to variable in Terminal post execution

How can you set the output of a command run in terminal to a variable after it has run? Background (You can skip of you don't need the background) I run VirtualBox VM and do a lot from the command ...
3
votes
1answer
346 views

Switching spaces on one monitor affects open applications on other monitor; looking to prevent this - BOUNTY

Kind of hard to describe. Using Yosemite 10.10.3. Using a mac with two monitors. Left monitor has one desktop space. Right monitor has two desktop spaces. I use a lot of terminal windows at work (...
104
votes
18answers
113k views

Is there a Mac OS X Terminal version of the “free” command in Linux systems?

On Linux, I often use the free command to see the current amount of free and used memory in the system. For example: $ free total used free shared buffers cached ...
5
votes
4answers
2k views

Force Terminal to Use Gedit for any Text Editing - not vim

I'm learning to program. While following this mission, I typed git commit, which opened up vim. I don't know or want to know vim (no offense to vim lovers). I'd like to have: terminal open gedit ...
5
votes
3answers
870 views

How does the sudo key symbol work?

I'm trying to write a script that requests the user password for some sudo-related commands. My goal is to emulate the default method that OS X uses to obtain the user's password, Password: followed ...
1
vote
2answers
41 views

Why does 'set -x' cause the terminal to dump garbage

This problem is quite annoying and I cannot search Google for 'set -x' because the minus sign has another terminology there. In my MacBookPro, when I use 'set -x' to debug bash commands, I'm getting ...
0
votes
2answers
51 views

How to get defined lines from OS X Terminal result?

How do I get the first 20 lines of a OS X Terminal result?
4
votes
5answers
2k views

How to find the currently connected network service from the command line?

I would like to find out which of the available network services (e.g. Ethernet or Wi-Fi) is currently active. In this screenshot from the Network Preferences, you can see that Wi-Fi is currently ...
1
vote
0answers
34 views

Are there any advantages to using GNU over the default OSX command line utilities? [closed]

Are there any advantages to using GNU utilities (installed via homebrew) as opposed to the default, BSD based OSX utilities? They seem very similar to me, but I will not pretend to be a master of ...
0
votes
0answers
10 views

Screen Sending EOL After Each Character

I just connected my Anthem AVM20 audio/video controller to my Mac Mini via an USB to RS232 cable. I've been able to bring up a screen session. The problem is that it appears to be sending some sort of ...
0
votes
0answers
27 views

How do I make terminal windows STAY the same size?

I have set up my terminals, so that they are the size I want them to be. However, I often have several tabs open in each window. Terminal keeps trying to make the window BIGGER when I get too many ...
0
votes
2answers
63 views

How to get file sizes of large files in OS X Terminal?

I'm trying to get the file size of a big file (1GB +) using the OS X Terminal. I'm using du -sh. But also after 30 seconds I don't have any result, is there any faster command? Thanks.
12
votes
2answers
16k views

Create a Terminal command to open file with Chrome

I want to create command in terminal that would allow me to use chrome index.html and have the the given file open in Google Chrome. How can I get this working?
0
votes
0answers
37 views

-p: command not found - Automator help needed

I'm using Automator to run a shell script for taking an interactive screencapture and opening it in Preview for easy annotation. When running the script it fails and states -: -p: command not found. ...
1
vote
1answer
37 views

Change iTerm2 profile depending on current directory

Using my .bash_profile, I used to change my iTerm2 profile per machine with the following command: echo -e "\033]50;SetProfile=ssh\a" Now, I want to change it depending on my current working ...
7
votes
5answers
4k views

El Capitan - Right Click Menu - Open Terminal Here

I know this may have been asked several times, however I cannot find a valid method that will work for me. On El Capitan - I want to add a option to the right click menu (not the services section) ...
0
votes
1answer
30 views

How to change the GNU Make's (default) default location of gcc

I run Mac OS X El Capitan 10.4. I have used brew to install Compilation Tools (https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/). Now when I run make, it ...
1
vote
1answer
38 views

Is there a terminal command to open applications in a specific Desktop?

For example when I run open -a Kodi I'd like to be able to specify which Desktop I'd want the application to launch in. Trying to avoid dragging/dropping to the desired workspace.
0
votes
2answers
23 views

How to see progress of download started in the terminal

When downloading software via the terminal is there a way to see the download progress? I kicked off a download via the terminal and I can't tell if it's progressing or stuck.
1
vote
1answer
46 views

Make Cmd+C do both Copy and Stop in the terminal

Left control Key located in a very unpleasant place on my Mac keyboard. It's hard to reach in the terminal. Luckily, I don't need it very often: I have Cmd for most of the things. There are few cases, ...
12
votes
4answers
238 views

in terminal, I cannot type lower case e

2015 MBP, fully up to date OSX I open a terminal window and if I type the letter "e" (without quotes of course) it beeps and will not type the letter. Every other letter works just fine in terminal. ...
0
votes
1answer
46 views

Can't empty trash on Mac

Recently every time I try to delete files, my OS asks me to type in a password. After I type in password, the files are deleted from the folder, but it doesn't free up space and the files don't show ...
1
vote
0answers
29 views

Dump iCloud keychain in Terminal

I failed to find the path to iCloud keychain to do just security dump-keychain - the iCloud keychain isn't shown when I try security list-keychains. What is the path to that keychain (or, if it cannot ...
1
vote
1answer
3k views

Using kdiff3 as default git diff viewer on Mac OS

I have kdiff3 installed on my Mac (Version 0.9.97, 64 bit). Here's my ~/.gitconfig: [filter "media"] required = true clean = git media clean %f smudge = git media smudge %f [user] ...
6
votes
5answers
8k views

Creating a virtual serial port

I'm trying to create a pair of virtual serial ports on my mac. This is fairly easy to do with many shareware programs on a PC. I figured there would be some uber-powerful shell command to do this in ...
13
votes
3answers
9k views

Make files in `/usr/local` writable for homebrew

I've been trying to get homebrew working nicely, but it appears everything inside /usr/local isn't writable, and everything falls over. It keeps telling me to recursively chown /usr/local, and I ...
8
votes
1answer
480 views

How to get the geolocation of an IP address in Terminal?

Is it possible to get the geolocation of an IP address in Terminal? Not sure what the numbers in an IP address mean, but there must be some logic behind it, so lookup can't be that hard.
4
votes
3answers
3k views

OS X won't create any symbolic links, creates aliases instead

No matter how I try to create an symbolic link OS X refuses to play along and instead creates an alias. I've tried several tools and also through the terminal using the ln command. I am on a fresh ...
3
votes
1answer
935 views

I want to change clock from 12h to 24h mode via terminal

So I'm looking for the command to change from 12h to 24h. Is there even such a command? I mean I can do it with the GUI but I need to be able to do it via terminal so I can put it in a bash script. ...
2
votes
1answer
102 views

How to fix “You are not allowed to use ”Application“”

How do I fix this message, I am Admin, Mobile. Even if i login to a root account this message still appears. I have iTerm so if any commands need to be inputted to fix this problem I can still do it. ...
0
votes
1answer
69 views

Extract text between two unicode symbols using AppleScript or bash?

My goal is to take text from a standard .txt document, and use (preferably) Terminal or Applescript to extract text between the symbols ▶ and •. While there is only one ▶ symbol there are multiple ...
0
votes
1answer
17 views

How do I get 'New Terminal at Folder' functionality when dragging a folder to the terminal dock icon?

Sometimes I like to open folders in Terminal by dragging the folder to the Terminal dock icon. However this creates a new Terminal window instead of creating a new tab in my current Terminal window. ...
10
votes
10answers
621 views

Can I shorten the typing needed to `cd` into some well know directories

I find myself opening a terminal and then CD'ing a lot into the same directory the path of which is very long. This means I am cd'ing a lot and using the tab to speed things up a lot. IT would be ...
4
votes
1answer
80 views

Is there a way to control dual monitor relative position from terminal?

I have a weird setup for my home office that allows me to switch from a standing desk to a sitting desk. The only problem is that when I alternate positions, my laptop's external monitor switches ...
1
vote
2answers
49 views

How to inspect TCP/IP packets

How can I inspect IP packets send through currently open TCP connections? I opened a nettop utility in Terminal, which I think lists IP packet, but doesn't tell anything about their content, namely ...
0
votes
1answer
31 views

Is it possible to create a service using only the shell and bypassing automator altogether?

Using automator is somewhat of a tedious task. Using the shell in the Terminal is much easier all around. Even using the "Run Shell Script" action inside automator is not the same as using the actual ...
0
votes
0answers
12 views

Is there something like Alt-SysRq-k in Terminal?

What I mean is whether there is something that kills all processes in the current tty
0
votes
0answers
9 views

How to Replace TextMate's Search by Custom Function?

TextMate uses currently mdfind as its search (CMD-F) which is bad/unstable/useless/... with .tex files. I would like to replace it by my own search function. How can you replace TextMate's default ...
0
votes
0answers
45 views

Open new Terminal window with home directory set to current directory?

I want to programatically open a new Terminal window. I've setup a custom profile in the Terminal preferences and exported the profile. I can open a new window with that profile by calling it ...
0
votes
1answer
102 views

Weird null characters ^@ output on iTerm 2 / zsh when a command is running

When I m using iTerm 2 (with zsh), and a command is running at the prompt, every minute or so ^@ (NULL character) got displayed on the terminal. Below is an example, using socat, but other commands ...
0
votes
1answer
18 views

Can I edit/create a PDF's Table of Contents with freeware?

I have a PDF with a number of parts. I would like to create a Table of Contents to navigate the PDF with ease. I would like to do on a Mac this with freeware. (A command-line program would be great.) ...
3
votes
1answer
116 views

Can't write to /usr even with sudo

Here's my problem: sudo php -d detect_unicode=0 go-pear.phar ...should let me run as root and modify /usr & /usr/share directories, but I get this: Below is a suggested file layout for your ...
1
vote
1answer
43 views

How can I get ^C to show up when I do Control-C on a Mac terminal?

If I type a command, and halfway through I decide not to run that command, I do a Control-C to cancel it without having to backspace the whole thing, e.g. mv foo.txt bar.txt. On Ubuntu it'll show up ...
3
votes
2answers
52 views

How to Change USB Thumb icon using Terminal or Bash/other scripting language

I'm looking for a method to change USB or External Drive Icon using bash or any other command line method. I know how to manually chnage them like this I am using El Capitan
3
votes
1answer
49 views

OpenSSL encryption method doesn't work on El Capitan

The following file encryption method works on OS X Yosemite: Encrypt: openssl enc -aes-256-cbc -salt -in file.zip -out file.zip.enc Decrypt: openssl enc -aes-256-cbc -d -in file.zip.enc -out file....
1
vote
0answers
22 views

How should daemons tell users about errors?

I wrote a bash script that backs up certain files on my computer. To automate the running of the script, I set up an associated daemon that runs the script every day. There are certain instances ...
29
votes
13answers
18k views

How can I sleep the display from Terminal?

I'd like to be able to turn my screen off from command line. I know there's the keyboard shortcut ctrl+⇧+⏏ but I want to do it from a shell script or remotely. Is there a way?