Questions tagged [command-line]

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.

Filter by
Sorted by
Tagged with
1
vote
3answers
216 views

command line error “no volume specified”

Can't understand why I get this response when running this bless command, can someone please explain or suggest how to fix. Note: the volume syntax/path was copied exactly from the output after ...
0
votes
2answers
2k views

Reset admin password without the old password

I am trying to reset the admin password through command line. Below command used to work till High Sierra: sudo dscl . -passwd /Users/admin new_password But on Mojave it throws an error saying: ...
2
votes
3answers
74 views

Make shell script contents difficult to read

I am setting up an escape-room-esque experience for a group of 11 and 12 year olds. As part of the activity, I'm going to set up an old Mac (likely running Snow Leopard) with a specially-created user ...
3
votes
2answers
270 views

Mac Equivalent to Windows CMD f8

In Windows if I entered several commands and built up a little history, I could execute previous commands by typing a prefix at the command line and pressing F8 (Windows Keyboard shortcuts) to cycle ...
5
votes
1answer
453 views

What is the CTRL+x+e equivalent for MacOS's Terminal?

In Ubuntu's (and other Linux systems) terminal, CTRL+x+e, which opens an editor to allow you to edit your command at leisure, with multiline support, and once you save and exit, it would return to ...
1
vote
1answer
70 views

launchd is not passing arguments to my PHP script

I'm having a weird problem. I use launchd to run a bunch of shell scripts that update content on my site. It was working fine when it was just calling scripts normally. But now I made the script a ...
3
votes
2answers
62 views

Is there a way to disable a Messages account via command line?

I'd like to stop/start receiving SMS/iMessage via command line, to avoid having to go into system preferences. Is there a way I can manipulate settings for Messages to enable/disable an account?
2
votes
2answers
273 views

Why aren't my profile and bashrc files hidden?

I've been following tutorials to edit .profile, .bashrc and .bash_profile and I discovered that my computer has profile, bashrc and .bash_profile files instead. i.e. Only the .bash_profile file is ...
1
vote
0answers
128 views

Command line utility for browsing Apple's Photos.app database like a filesystem

Is there a command line utility to allow browsing and editing photos in the Apple's Photos.app database like you would browse a file system? The Photos app is really terrible when trying to perform ...
2
votes
2answers
156 views

Get per process user and system CPU time on OSX via command line?

I am familiar with pidstat command that gives separate user and system CPU per process on Linux: $ sudo pidstat -p 3162 Linux 4.18.0-13-generic (ubi) 26.12.2018 _x86_64_ (1 CPU) 11:26:13 ...
2
votes
1answer
284 views

Automator: `command not found` (Python script for command line) [duplicate]

I am trying to create an Automator application, which allows me to convert Python script files .py files to Jupyter Notebook files .ipynb using Python script for command line jupytext. However, the ...
4
votes
2answers
457 views

What is the purpose of “paste newlines as carriage returns” in the Terminal app?

In the settings of the Terminal app, in the advanced tab, there is an option to "Paste newlines as carriage returns" which is enabled by default. What is this good for?
1
vote
0answers
26 views

How can I be notified when I get a new connection with netcat?

So basically, when I am listening with netcat (nc -l 1337), how can I be notified when I get a new connection? Rather than looking back and forth at my terminal window.
1
vote
1answer
19 views

How can I get the “Look Up” option to find results?

How can I get the "Look Up" option to find results. In Terminal, if I select a command word then right click on it I want to use the Look Up option in the drop down menu. It is not grayed out. It ...
3
votes
1answer
82 views

Automator :: Remove 6 digit date from filename; append current date

I apologize in advance if this has been answered but have performed a lengthy search in hope of a solution. I have a working Automator app that appends the current six-digit date (YYMMDD) to the end ...
2
votes
2answers
75 views

Weird output from ls command in Terminal

I recently started customising my Mac terminal and adding Vim stuff. After some time I noticed that when executing ls command, I keep getting: )<CR>?vnoremap <Space> zf?? along-with ...
-2
votes
1answer
297 views

A script to shrink and compress DMG disk images does not seem to work well in my scenario

I'm trying to resize the *.dmg of my MAC OS X installation file because I have only DVD of 4.7 GB and not dual layer disks,at the moment. The problem is that the dmg file is almost 7 GB large and I ...
3
votes
1answer
553 views

Turn on Location Services for an app via command line (macOS)

I am trying to enable Location Services for an individual app such as Weather.app etc via command line for High Sierra and Mojave macOS computers. I was able to enable Location Services at the top ...
3
votes
1answer
62 views

How can I make use of info from a `file-bookmark` entry in a plist?

I am trying to create a shell script, or less ideally some AppleScript, that interacts with the folders listed in the Finder’s Go → Recent Folders The contents of this list are stored as an array ...
5
votes
1answer
389 views

Why is it that I cannot open file in terminal when in root?

I have a file in MacOS that I want to change that is protected by permission restrictions. I cannot access it with my normal account. I use terminal to log in to root, and try to open the file as such:...
1
vote
2answers
2k views

trouble installing cmake

I need to install cmake for school. I have tried using the source code but don't really understand where I should unpack it and how to add it to my path. I also tried the .dmg file but the command ...
0
votes
2answers
267 views

AppleScript shell script

How can I run a shell script on multiple different computers with the same code? If I have it run from /users/'my name'/desktop/etc. then it won't work when I use it on a different computer, ...
1
vote
2answers
833 views

Change permisions on /usr and /usr/local to link Homebrew package

How does one change permissions for /usr or /usr/local? I tried doing sudo chmod 775 /usr/local, but it says chmod: Unable to change file mode on /usr/local: Operation not permitted` so I ran ls -l ...
2
votes
0answers
191 views

How to prevent “Do you want the application foo to block incoming connections?” popup from command line

As a developer, I run a testsuite of some self-compiled binaries which try to listen on some ports on startup. This causes a barrage of popups "Do you want the application foo to block incoming ...
20
votes
6answers
3k views

Copy all the text of an entire `man` page from Terminal.app

I am reading a very long man page (man ssh). I want to save all of that text for more convenient reading in a text-editor. Unfortunately, choosing either of : Edit → Select All → Copy Shell → Export ...
6
votes
1answer
484 views

Is there a list of pre-installed command-line tools for macOS? [duplicate]

I'm currently in the process of developing some shell scripts but have run into a problem: whilst I am able to execute numerous commands on my Mac, when I try to run it on other people's computers I ...
3
votes
2answers
156 views

Terminal: how to use `at`?

Could someone provide some example usages for the at command? I'm finding the man super confusing. $ man at For example, if we wanted to run a command 10 minutes from now, can this be done using at?...
2
votes
1answer
971 views

date add command Terminal: How to add time using `date`? (illegal time format)

I'm trying to add minutes to the current time using date. This works for adding 5 minutes: $ date -v "+5M" But if I try using -v with a formatting argument, it fails and prints the help menu: $ ...
3
votes
0answers
45 views

Automatically send kill -STOP or similar to runaway processes when the lid is closed?

From time to time (maybe a couple of times a week) when I get to my computer (a Macbook Pro) expecting it to be asleep with the lid closed the fans are running Most of the time it is a Chrome process ...
3
votes
2answers
274 views

Top: how to view the full command path?

Is it possible, using top, to view the full path of the running processes/commands? I tried pressing C on my keyboard but it doesn't seem to work.
1
vote
0answers
21 views

Automator can't find bash command [duplicate]

I'm trying to make an action on Automator that recursively batch processes PNG images using bash shell script with pngquant I have done this on terminal and got no problem, but now I want to make a ...
2
votes
0answers
38 views

Determine if the original path of an alias is local or remote

I have a folder full of thousands of aliases and need to isolate the ones referencing a remote path on another computer on an AFP network. I can iterate all of the alias files over a terminal command ...
1
vote
1answer
470 views

Grant “Full Disk Access” to Workflows run via the Services menu

I have an Automator Workflow installed as a service, that I run via Finder → Services → My Automator Workflow. The workflow copies some files to a DOS formatted thumb drive, and them attempts to ...
0
votes
1answer
963 views

'tmutil listbackups' doesn't work with tmux in Mojave

I've tried to list past TM backups while running in a tmux session, but the solution described in this question doesn't seem to work on macOS Mojave any longer: root@nomi ~> tmutil listbackups The ...
2
votes
2answers
93 views

applicationDidFinishLaunching - anyway to get this using script/command?

Is there a way to detect when an app has finished launching after using open <path_to_app> in a shell? The prompt after issuing the command is immediate, but for apps that take a while to fully ...
4
votes
2answers
232 views

Anyway to obtain list of Application that can open a file via Terminal?

In the finder you can control click on a document to get the contextual menu, this has 'open with..' with a submenu of all apps that can open that document. Is there a way to get this list via ...
2
votes
1answer
340 views

What's the fish shell equivalent to `set -o vi` to get vi/vim key bindings to access command history and edit?

I'm one of the "cursed ones" that got their start in vi instead of emacs so the shell editing commands I am used to are set in bash with set -o vi but this doesn't work in the fish shell. How can I ...
2
votes
2answers
181 views

What baud rate should I set for bluetooth TTY to Xbox controllers?

I'm trying to do screen tty.Bluetooth-Incoming-Port 9600 on my mac, but I'm not sure about my baud rate. How can I determine this? It's just giving me a "Cannot open line" error. I'm trying to view ...
0
votes
2answers
873 views

How can I query the hardware UUID of a Mac programmatically from a command line?

The hardware universally unique identifier (UUID) can often be used by developers to associate information unique to a Mac. This identifier will usually persist through OS upgrades or reinstalls, as ...
3
votes
0answers
520 views

“Full Disk Access” for backup tool running as cron job [duplicate]

I'm running a command-line backup tool (duplicity) as a cron job. But in Mojave, there is a new user data protection feature called "Full Disk Access" (part of the TCC access control framework) that ...
1
vote
0answers
620 views

Query Spotlight indexing status from Terminal

Is there a way to get the indexing status of Spotlight using Terminal commands? I know that I can just press command+space and type anything to get a progress bar, but I would like to be able to get ...
2
votes
1answer
5k views

Mac OS Mojave 10.14.1 Trying to Install Old Command Line Tools

I've just installed Mac OS Mojave 10.14.1 and the latest XCode. ➜ ~ sw_vers ProductName: Mac OS X ProductVersion: 10.14.1 BuildVersion: 18B75 I was just running updates and noticed one of ...
0
votes
1answer
70 views

How to specify a startup folder in the open command to launch MacVim?

If I want to open a file in MacVim from the terminal. I use the following the command open -a MacVim --args filepath. It disregards my working dir so I need to always specify the full path when ...
3
votes
0answers
590 views

When installing command line tools using Terminal, I am getting “Software currently unavailable from Software Update server” error

I have downloaded Xcode on my Mac running macOS Mojave and trying to install the command line tools using the following command: xcode-select --install But it is giving me the following error: Why ...
-1
votes
1answer
196 views

How to skip 'Cancel' 'Continue' when running shell script with automator?

I'm trying to run pmset sleepnow linked to a keyboard shortcut with automator. When I use the shortcut, it's giving me a 'Cancel' or 'Continue' prompt. Anyway to skip this so the script just runs when ...
3
votes
1answer
508 views

Can a Mac's part number be determined with a Terminal Command?

I need to determine the Apple Part Number 'MXXXXXLL/A' and do not have the original packaging. Is there a way to do this from command line? I don't need model #, I specifically need the part #. ...
1
vote
0answers
26 views

How to “switch my Python” to pip update the package copy that my IDLE accesses?

I have an Anaconda installation of Python as well as an installation that comes when downloading Python and IDLE from Python.org and I use both of them. For my Anaconda python I can use pip install --...
2
votes
0answers
1k views

Apple Remove Dock Icon with a command line

I'm trying to find the terminal command which can remove an icon from the dock, but I can't find the solution. I tried the defaults read / defaults write command but it doesn't seem to have the ...
1
vote
0answers
66 views

Is it possible to use Python while in Recovery Mode?

Is it possible to access a Python terminal while in Recovery Mode? $ /Volumes/macOS/usr/bin/python python: posix_spawn: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python....
0
votes
1answer
34 views

Geektools Shell Problem

In order to monitor the filesystem activity on my computer, I found command "sudo fs_usage", which works very well in Terminal. Then I had the idea to display those system activities (written) on my ...