Using programs and commands that do not have a graphical user interface (GUI) but are rather controlled by typing text commands into a terminal program, or shell.

learn more… | top users | synonyms (2)

3
votes
1answer
145 views

What is the difference between shutdown command and doing shutdown from apple menu?

What is the difference between issuing command shutdown -h now in terminal and doing Shutdown from apple menu? Using command it's instantly power down the system. But via menu it takes around 30-40 ...
1
vote
1answer
34 views

Different values for du and du -h

On the command line, du seems to return twice the numeric value returned by du -h. Apparently, du -h resembles the actual file size, so what's the plain du value representing?
1
vote
2answers
122 views

How to use the flag -p of BSD split?

Manual -p pattern The file is split whenever an input line matches pattern, which is interpreted as an extended regular expression. The matching line will be the first ...
1
vote
2answers
718 views

How to keep original “date created” when copying via Terminal?

There are many questions online asking how to make the commands rsync and cp go about copying a file while keeping the "date created" attribute the same as the original instead of the time of copy. I ...
0
votes
2answers
276 views

Suspended (tty output) when launching editors like vim, vi, emacs, or nano

I've been using Oh-My-ZSH for a few weeks now and it's been a great experience. Just today, though, terminal started acting strangely. When I try to run an interactive terminal editor like vim, vi, ...
44
votes
4answers
80k views

Can I get the CPU temperature and fan speed from the command line in OS X?

Is there a command I can run from the command line in OS X to get the current CPU temperature and/or the fan speed(s)? To be more specific, I'd like to be able to get the same info available in the ...
2
votes
1answer
700 views

How to disable Bluetooth Sharing via terminal?

I want to disable the Bluetooth Sharing that is located in the sharing preference section. I want to be able to disable it via terminal, does anyone have an idea on how to do that?
35
votes
7answers
13k views

How can I change a file or folder icon using the Terminal

How can I change or set the icon for a file or folder, in the terminal, do I need to use a scripting language?
0
votes
2answers
237 views

Shell command to count pages in a PDF (other than pdftk)?

I have been using this to get a page count of PDFs in shell scripts in OS X: pdftk "$i" dump_data | grep NumberOfPages | awk '{print $2}' | tr -dc '[0-9]' (where $i is the PDF filename) However, ...
0
votes
0answers
93 views

GUI alternative to ImageMagick Montage (very simple collage)

For example Instagram's pictures are quite low resolution. I normally join a few pictures together with montage (installed with brew, from ImageMagick project). montage IMG_7771.JPG IMG_7772.JPG ...
4
votes
4answers
3k views

Can I list files ordered by date added to a folder from a command-line tool like ls?

I need to build a script that shows files in the same order as the default Downloads folder in the dock, ordered by Date Added, newest first. I can't seem to find the option in ls. Any other way to ...
0
votes
1answer
70 views

Applescript or Shell rename a file?

The following is the code I have, however, it doesn't let me choose the extension I want to save it as. How can I save the file as a ".plist" ? do shell script "echo '{ Filter = { Bundles = ( \"'" ...
9
votes
3answers
3k views

How to programatically add folder to Spotlight “do not index”?

Is there any way to programmatically add a folder to Spotlight's "Privacy" tab? Either through Terminal or Applescript? Often I want to click on an item in Spotlight results in Finder, and have that ...
10
votes
4answers
2k views

Why is extracting this tgz throwing an error on my Mac but not on Linux?

I'm experiencing a rather odd problem, and I can't figure out what's going on. I have a tgz file, scip-3.2.0.tgz, that is throwing an error when I attempt to unpack it. The error is only occurring on ...
1
vote
1answer
115 views

Shell script to rsync or if not mounted - mount and rsync

This is what I've got so far: !/bin/sh Storage Folder Backup Defines mount point LOCALMOUNTPOINT="/Volumes/thisisanetworkshare" Checks for mount if mount | grep "on $LOCALMOUNTPOINT" > ...
2
votes
1answer
169 views

Shell Script Commands Work Fine in Terminal But Not Via AppleScript

I have two commands that I need to run through the Terminal. They are cd /Users/[my name]/Desktop and curl 'www.google.com'>google.txt. When running these directly in Terminal they work just fine. ...
0
votes
1answer
78 views

How do I 'pause' in a .command-script?

I want to create a .command-script on Mac, to execute a series of commands on a remote server using SSH. My script looks something like this: ssh user@domain.com cd /var/www/website/ git pull ...
25
votes
5answers
4k views

Did `man ls > temp.txt`. Output textfile is corrupted

When I execute man ls > temp.txt the output text file is corrupted. By corrupted I mean that first and last letters in some words are overly repeated. Several first lines in temp.txt: LS(1) ...
2
votes
2answers
1k views

Update bash to version 4.0 on OSX

Is it possible to actually update bash to version 4.0 in OSX Yosemite? echo $BASH_VERSION 3.2.57(1)-release This article and this thread refer to the same question, but they install a new shell ...
0
votes
1answer
85 views

How to restore manually Saved State files of Terminal?

My MBR crashes quite often. Normally I've multiple terminal windows and usually they're restored after crash. However from some to time they're not restored, so for that reason I was doing the backup ...
1
vote
1answer
71 views

Launching Character Viewer (aka CharacterPalette) from command line

So, recently I have being using the Character and Keyboard Viewer a fair bit and set up simple Alfred keywords that toggle the launch/quitting of these apps so as not to have to leave the keyboard. ...
0
votes
1answer
64 views

how to run open -n applicaton name from command line?

I got these two lines that I want to run from a script file (on Yosemite 10.10.3). It works when running from terminal CX_LICENSE=LS open -n /Applications/Inspire\ Designer\ 10.0\ GA/Inspire\ ...
1
vote
1answer
86 views

Applescript Calculate Run Time of a Command

How would you calculate the time it took to run a command? Specifically, I want to know the time it takes to return a value in a Shell command. I wrote this up, would it work? (Psuedocode) ...
0
votes
1answer
27 views

How to minimise the terminal automatically when it is running a shell script?

I have a shell script which runs a Python Program. I created the shell script so that the users of my program may simply double click it to run my program. When the shell script is executed; the ...
0
votes
2answers
71 views

Command Line Tools Difference?

Is there a difference between the command line tools that come with xcode and the ones installed with xcode-select? If I install xcode and then run xcode-select --install will the ones installed with ...
0
votes
1answer
20 views

Unfortunate deleting binary command file [duplicate]

I deleted "chmod" by mistake using "sudo rm chmod". What is the way to recover the chmod command? Is it 'a no way to do it' operation? I'm using Mac OS X Yosemite.
0
votes
1answer
169 views

dtrace replacement for fseventer?

I think many of us have been disappointed with the effective demise of fseventer. What is a good dtrace shell based alternative to fseventer that will display all full paths of files being accessed ...
0
votes
0answers
73 views

Mac doesn't recognise simple commands like 'ls'

I installed Apache and tried to change the permissions for one of Apache's working directories. After that my machine keeps changing the default path. I can't access the simple commands unless I set ...
0
votes
1answer
43 views

Why BSD eval cannot run gtime?

I am considering this answer with GNU time which I installed by brew. data.txt hello amigo this line 3 and here we go 4 and 5 is here Code in BSD time time eval $(echo sed $(for i in 1 2 3 5; do ...
16
votes
4answers
10k views

How can I install the Command Line Tools completely from the command line?

I'd like to script the installation of the the Xcode Command Line Tools. On Mavericks, xcode-select --install will open a dialog prompting the user to install, but I'd like to trigger the install ...
31
votes
12answers
69k views

Password dialog appears when SSH private key permissions are set to 0600

I installed my SSH private key in ~/.ssh/id_rsa and set its permissions to 0600. When I connect to an SSH server which uses my private key in Terminal.app via ssh, a dialog pops up and asks me to ...
0
votes
0answers
38 views

Windows formatted disks owned by $USER, while Mac formatted disks owned by “root”, right?

I noticed that some disks were owned by $USER and some by root: $ ls -l /Volumes total 88 drwxrwxrwx@ 1 jdoe staff 8192 Jul 14 10:22 USBdrive drwxrwxrwx 0 root wheel 0 Jul 14 15:54 ...
1
vote
2answers
53 views

Command line app location? (OSX)

I wrote a small tool as a cmd tool. Where should it be placed? Which paths are automatically scanned for searching an app? I want to avoid absolute path, because I have to track it on every system.
3
votes
1answer
309 views

How can I obtain app energy impact data from the command line or applescript?

Does anyone know how to access the "Energy Impact" data used to determine "Apps Using Significant Energy" displayed in the battery menu bar? I'd like to use it in a shell-script/applescript.
1
vote
1answer
78 views

How can I change 'history' command output?

So by default .bash_history stores 500 last used commands. I changed that to 5000 by setting HISTFILESIZE=5000 in .bash_profile It seems to work. Now when I do history it still prints 500 commands, ...
1
vote
1answer
47 views

Where should a command line tool store cache files in OS X?

/var/cache is missing, ~/Library/Caches seems to be for full-fledged applications rather than command line tools, tools I've seen in the wild do horrible things (like use the user's home directory). ...
0
votes
0answers
48 views

launchagent logs warning/error into console

I have a launch agent that I created several years ago to set a random signature both in a .signature and in Mail.app. It does nothing complicated and has hummed along through several OS X versions. ...
0
votes
1answer
102 views

How can Finder empty Trash more quickly than “rm -rf /Volumes/Foo/.Trashes/501/*”?

The "Trash" of a 16-GB usb2 flash drive had 3.4-GB of data. I emptied it as such: $ cd /Volumes/FooDrive/.Trashes/501 $ rm -rf * This took over 5-seconds. That seemed pretty long. So, as a ...
0
votes
0answers
26 views

How do you change the default route to a VPN?

I'm connected to the internet via a public unsecured WiFi router with address 192.168.1.1. I have an OpenVPN connection to a remote router who's LAN address is 192.168.2.1. After I connect, I get ...
2
votes
1answer
185 views

MacBook Pro HDD corrupted files and bad blocks? Find command running for 4 days; Disk Utility reports no errors

Computer: Late 2011 MacBook Pro 13" Factory 500 GB serial ATA (5400 RPM) HDD Problem: A few days ago my computer started running extremely slow — could barely perform the most basic functions ...
2
votes
0answers
338 views

Get rid of the “Instruments wants permission to analyze” prompt, from command line, in Yosemite

In our jenkins build automation environment we have several OSX nodes, now all updated to Yosemite, where we run ios simulator tests. The problem is that on any newly introduced node simulator tests ...
0
votes
2answers
297 views

How to mount and name a volume if it's not already mounted with a startup script

I'm trying to do something I thought would be simple, but after researching it I feel like I'm half way towards shaving a yak, so I'm asking for advice. I want to create a script that lets me and my ...
2
votes
2answers
95 views

Is there a way to preserve terminal tab history across computer restarts?

I'm using Mac 10.9.5. When I run a terminal with multiple tabs (using bash shell), I've noticed that when my computer restarts, the terminal will open up with the same number of tabs that were open ...
8
votes
2answers
7k views

How to install CPAN modules from the command line on OS X?

Simple question: How to install CPAN modules on OS-X like normal Linux/Unix way? I just want to type in cpan something like install Perl6::Say for example.
1
vote
1answer
615 views

How can I echo shell script in Automator?

I have an Automator service which runs a shell script (ffmpeg command). I'm looking for a way to see the output of the terminal while ffmpeg does it's thing. Adding echo to the ffmpeg command doesn't ...
1
vote
1answer
257 views

Terminal Command Line to find corrupted files

I do have just one corrupted photo into my Photos Library. Is there is any UNIX command line that I can use in terminal in order to scan my Photos Library Folder and find out which file is corrupted? ...
0
votes
0answers
70 views

Script - Audio Files - Find, Count and Sort by type

I have a very large audio collection I have to sort. It's a mixture of M4A, FLAC, AIFF, WAV and MP3. It's the result of years of work by a now deceased person who sat in their garage ripping their own ...
1
vote
0answers
85 views

Command Line Tools update description of changes

When Apple provides updates for OS X and other software it typically also describes the changes introduced in that version, as displayed in the App Store application's Updates tab or in a separate ...
13
votes
2answers
17k views

How does 'stuck' (in results of 'top') relate to 'not responding' (in Activity Monitor), 'spin' or 'hang'?

In results of top commands, I sometimes see stuck. Apple's top(1) OS X Manual Page does not explain this use of the word. How, if it all, does stuck relate to the following? not responding – ...
1
vote
3answers
103 views

Problem: How to clear all remnants of random.py, random.pyc, and random.pyo that isn't part of Python's standard library?

I wrote an import random code, and unfortunately saved it as the module's name I was trying to call. eg. random.py I believe, but am not sure, that I created the random.py file twice and thus I ...