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)

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 ...
4
votes
4answers
7k views

How to open a new Terminal tab in current working directory?

I want to create and run a bash function that: cd into a project's directory Open a new tab in Terminal in the same directory Open my dev tools and start dev services Item #2 doesn't work as ...
0
votes
1answer
28 views

Deleting password from Keychain in terminal

I'm having trouble deleting the github credentials from Keychain Access. Keychain Access just freezes everytime I try. Is there a command to force deletion of an item in the Keychain from the ...
0
votes
1answer
36 views

Mac OSX equal to linux time command

What's binary that will give exact result for Linux's time command flags? alias tcmd='/usr/bin/time \-f\ "CPU: %Us\tReal: %es\tRAM: %MKB"' Current time in Mac OSX for command above is: ...
0
votes
0answers
50 views

LSOpenURLsWithRole() failed with error -600 when opening html file from terminal

I created a new test.htm file in my homedir, and when I type open test.htm it switches to Firefox, just opens an empty tab (my file does not appear), and the terminal says: LSOpenURLsWithRole() ...
9
votes
3answers
2k views

How to isolate processes that evoke insane mds_stores disk read activity?

I have an interesting situation where when I monitor my disk activity, I find that mds_store is continually running between 1 to 35 megabytes per second (averaging around 3-5 MB/s) on the read and ...
1
vote
3answers
97 views

How to run a shell script from an AppleScript?

I am using a Mac running OSX Yosemite v.10.10.5. When I try to run my shell script from my AppleScript, I get the following error message: Error message at AppleScript Script Editor error "sh: ...
1
vote
1answer
34 views

Terminal - Weird spaces included when typing fast

Whenever I want to use the pipe operator in the terminal, I get a weird kind of "bug": As is shown in the image above, I can type the exact same command twice and it will sometimes register it or ...
0
votes
3answers
79 views

How do I run a .sh or .command file in Terminal

I've always wanted to be able to run a script I've downloaded online directly from the Finder but just double clicking the file does not work.
0
votes
1answer
22 views

How to cd into my local git repo from an AppleScript?

I am running a Mac using OSX Yosemite v10.10.5. I want to push my local git repo to my remote using AppleScript. So the git code would be: shell git init git add README.md git commit -m "first ...
8
votes
1answer
314 views

Unhide invisible files from the command line

By default, a number of system directories (such as ~/Library) are hidden in OS X (ie. they don't appear in Finder): I know I can do this through the GUI but I would like to add a script to my ...
43
votes
2answers
71k views

Why doesn't Mac OS X source ~/.bashrc? [duplicate]

I found a lot of people figuring out why instruction similar to this : Put X to your ~/.bashrc and you can do Y don't work. It always turns out that Mac OS X's bash's startup files (or Mac's ...
4
votes
6answers
5k views

Monitor a folder for changes, and run a command when a change is detected

Is there a simple way to automatically run a (Terminal) command every time a file is changed in a specific folder? This should be possible via the command line, or a system built-in application, no ...
0
votes
1answer
56 views

curl not working in El Capitan

I receive this error message when trying to run curl from the terminal command line: /usr/local/bin/curl: line 61: /usr/local/bin/sed: No such file or directory /usr/local/bin/curl: line 65: ...
6
votes
1answer
131 views

How do I use non-“legacy” launchctl commands to load and unload plists?

I have some plist files in ~/Library/LaunchAgents. I have been happily using launchctl load -w and launchctl unload -w to turn these on and off for years. However, I notice that now load and unload ...
1
vote
0answers
31 views

Does rsync have issues with Unicode Characters in filenames?

I run rsync via a crontab every night to make an offsite backup of a directory's state, fairly trivial stuff really. While going through the logs, I noticed that in particular there were a set of ...
1
vote
2answers
265 views

Exiting/Starting the Terminal (El Capitan)

In the latest Mac OS X Terminal version I noticed that if I type exit and the press Enter, I get the following: Last login: Wed Jan 27 09:18:48 on ttys000 Ian-iMac:~ Ian$ exit logout Saving ...
1
vote
2answers
3k views

Disabling the trackpad from the command line

How can I disable the trackpad (without restarting my computer) from the command-line on OS X Mavericks?
0
votes
0answers
26 views

Converting to .PDF and keeping original name — what am I doing wrong?

I have been piecing together what little I have learned of Automator along with pieces I've found in tutorials, but cannot seem to get this to work! If I test this as a workflow using a file from "Get ...
0
votes
0answers
17 views

Where I can find BSD watch for snooping on another tty line?

In FreeBSD there is watch command which allows snoop on another tty line. Since OS X is based on FreeBSD, where I can find that command? Or it was removed for some reason (or never included)? To ...
0
votes
0answers
84 views

lshw or lspci for Mac OS X

What's the closest alternative to something like lshw or lspci on Mac OS X? The closest thing I know of is system_profiler but it spits out way too much unnecessary information.
0
votes
0answers
34 views

How to make identical rsync copy that passes manual MD5 checksum?

OSX Yosemite 10.10.5 rsync version 3.1.2 md5sha1sum installed Items that I’m trying to copy and verify is 10+ GB folder containing 5000 files and 800 subfolders. No system files. Not sure if the ...
0
votes
0answers
29 views

How to open current folder in ForkLift from command line?

I know how to open it in Finder: open . But, how can I open it in ForkLift?
0
votes
1answer
18 views

How create an identical timestamp format as used in ppp.log file in a shell script?

In the need to add custom logging messages to ppp.log, I see that the date and time are missing when outputting the command to >> /var/log/ppp.log. Other pppd related messages in ppp.log are ...
1
vote
1answer
86 views

Command-line tool to ask remote server for current date-time

On Mac OS X (such as 10.8 thru 10.11) is there a bundled command-line tool to ask a specific remote NTP time server for the current date-time? I found ntpdc but this queries the ntpd utility which I ...
0
votes
0answers
7 views

Is there a way to send the contents of a makdown file as the body of an email from terminal

I want to be able to white content in a makdown file and then send its (html converted) content to my own gmail. I have tried using the mail and mailx from the command line but whilst both of them ...
-1
votes
1answer
30 views

Which short command to only output the IPv4 routing table?

$ netstat -nr is great for outputting the Mac OS X IP routing tables. However its output is long as it contains both IPv4 and IP6 routing tables. Sometimes I wish to output only the IPv4 routing ...
0
votes
2answers
56 views

Recursively remove all invalid characters from text files in place

I have several thousand text files, some of which contain invalid UTF-8 characters. I want to recursively remove all invalid characters from these files in place. I am aware that many similar ...
1
vote
2answers
18 views

Which command to only output the IPv6 routing table?

$ netstat -nr is great for outputting the Mac OS X IP routing tables. However its output is long as it contains both IPv4 and IP6 routing tables. Sometimes I wish to output only the IPv6 routing ...
0
votes
2answers
62 views

How to send an email to myself with Applescript or Terminal automatically when my Mac reboots?

I wonder if there is a way to send an email to myself with Command Line or AppleScript service automatically when my Mac reboots? Thanks for your suggestions.
1
vote
1answer
41 views

All applications got paused after disk space usage got near 99% and back to normal. What's next?

Mac does some pretty fancy background stuff to try and keep enough disk space for whatever it needs. In my case, 512 gb ssd, it needs to have at least 20gb free to run smoothly, so I usually have 40. ...
1
vote
2answers
41 views

Why doesn't pbpaste return cursor at new line in bash?

I run the command pbpaste in Terminal (bash) to get the result of my clipboard, but unlike other commands which leave the cursor at a new line below the previous stdout, pbpaste leaves it to the right ...
4
votes
2answers
91 views

How can i track progress of dd

I am using the following command to create a bootable SD Card sudo dd bs=4m if=en_windows_10_enterprise_version_1511_x64_dvd_7224901.iso of=/dev/disk2 Is there a way to track the progress?
0
votes
0answers
99 views

Crontab task “LSOpenURLsWithRole() failed … with error -600 for the file …”

I just moved to a new MacBook with El Capitan and trying to set up my crontab to do backup tasks. Here is how I have it set up (via crontab -e) 40 7 * * * /Users/myusername/daily.sh "daily tasks run ...
1
vote
1answer
34 views

Local Forwarding does not work

I have tried to forward local ports over SSH to a remote host: $ cat .ssh/config host km4ayu.com LocalForward 29070 127.0.0.1:29070 I've tried a bunch of things, but how do I make this forwarding ...
0
votes
1answer
39 views

Is there a `watch` command native to Darwin/OS X?

I have a script that I'm trying to port from Linux to Darwin/OS X. The Linux version currently depends on the watch command, which doesn't appear to be installed on Darwin/OS X by default. What's the ...
0
votes
2answers
29 views

Macports force-activate all ports

When trying to install SciTE sudo port install scite port stops at Error: org.macports.activate for port gettext returned: Image error: /opt/local/bin/autopoint already exists and does not ...
4
votes
2answers
2k views

Using the -Bless Command on Multiboot Macs with 10.11 El Capitan

As part of our standard deployment, we tend to deploy multiple OSs on Macs, from 10.7 to 10.11. However, with the new SIP (System Integrity Protection), the -bless command no longer works properly. I ...
1
vote
1answer
92 views

Trouble running MySQL on OS X 10.9.5

So I ran over a lot of post treating of this specific problem but none of the answer seems to work for my case. So this is the process : I installed mysql via homebrew that lead me to this : ...
0
votes
0answers
22 views

pagestuff command error: Can't map file

I want to use pagestuff command line tool with my iphone application. It's working with Mac application but not with iphone application. used command pagestuff MetalMatrixMultiply.app -a Got ...
0
votes
0answers
11 views

How can I control Bluetooth using the CLI?

I would like to know how I could control the Bluetooth chip using the terminal. Is there any way to have equivalent commands as the one present on Linux? (Through XCode?)
0
votes
2answers
42 views

What happens if you used “rm -rf *” in /Users or /Users/someUser?

Note: Don't type rm or any variation of it into terminal under any circumstances if you are not experienced with the command line Does the Mac OS X block you from using rm in those directories to ...
2
votes
0answers
12 views

Get current time with/in milliseconds from OS X command line [duplicate]

I'm trying to get the current time from OS X command line to work with in AppleScript to output the elapsed time. Currently I'm using this script: set timea to do shell script "date +%s" ##something ...
1
vote
1answer
126 views

Mac OS X Terminal creates zero byte files

I'm a font developer. I want to merge a DSIG code into a TrueType format (TTF) font, which makes it compatible with Microsofts applications that use OpenType features. I have had this working before ...
22
votes
5answers
84k views

Why does OS X Mavericks block the purge command in Terminal?

When I try the purge command on my terminal, OS X Mavericks gives me the following message: Unable to purge disk buffers: Operation not permitted This hasn't been the default behavior until now. I ...
16
votes
3answers
13k views

Can I install or update Mac App Store apps through a command line using terminal? [duplicate]

Is there an official way provided by Apple or a workaround so that I can install or update Mac App Store apps through Terminal?
0
votes
2answers
66 views

How to type in Mac window?

I want to enter a simple adb shell command, so I navigated to ...\sdk\platform-tools\adb.exe, and opened it. However, I am unable to type in it! I am a new Mac user after recently moving from ...
1
vote
0answers
18 views

Can I list all programs that depend on a given framework?

I'm curious about what all on a stock OSX install uses the WebKit framework, since I keep seeing it pop up in crashlogs and it's supposedly a handy rendering swiss-army knife. What's a good way to ...
0
votes
1answer
880 views

How to batch download all files in a Volafile.io room?

Volafile.io Live Filesharing & Chat Example URL: https://volafile.io/r/$ID. There is Feature request: Download all the content of a room in a .zip file. #117. I don't wish to depend on that ...
0
votes
0answers
46 views

Problem accessing localhost under Apache while it's running

I reinstalled Apache on my Mac (brew uninstall\install httpd22), and now access to localhost is no longer available. sh-3.2# apachectl -v Server version: Apache/2.2.31 (Unix) Server built: Mar 28 ...