Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
35 views

Calculating sha256 returns also “-bash: <string> command not”

I'm trying to find a SHA256 hash of a string: $ fdsafdsa | shasum -a 256 While it returns a hash, it also throws an error: -bash: fdsafdsa: command not found ...
0
votes
2answers
80 views

Copy files from Folder A to Folder B based on Text File C with bash

How do I copy files from Folder A to Folder B based on Text File C with bash? folderA: source folder with image files only, e.g. image01.png, image02.png etc. There are no space in the image names, ...
2
votes
0answers
19 views

How to compile/install mplayer on MacOS with subtitle support?

In order to play video files with a sub title file on MacOS 10.13.6 on the command line: How to install mplayer so that I am able to use subtitles? I tried the following suggestion made in some ...
0
votes
1answer
22 views

Determine com.apple.Finder AppleShowAllFiles status using command line?

Is there a way that I can grab the status of com.apple.Finder AppleShowAllFiles in command line? I switch between AppleShowAllFiles yes & no frequently, I want to write a .command file to check ...
1
vote
3answers
34 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
1answer
39 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
68 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
92 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 ...
3
votes
1answer
189 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 ...
0
votes
1answer
19 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 ...
0
votes
0answers
26 views

Why can I not open/mount a .img file?

Earlier today, I was looking for a way to create a .img file either with Terminal or Disk Utility. I managed to find a way, but as the title says, I can't open or mount the .img file. So basically I ...
1
vote
2answers
50 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
32 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
52 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
22 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
267 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
16 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
18 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 ...
4
votes
1answer
36 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 ...
1
vote
2answers
35 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
63 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 ...
2
votes
1answer
50 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
31 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 ...
4
votes
0answers
85 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
45 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
86 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, ...
2
votes
2answers
195 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 ...
0
votes
0answers
13 views

tag program works when invoked directly; errors in find script

I'm using the tag program (https://github.com/jdberry/tag/) to copy tags from images in one directory to the same-named images in another directory. A command that works from the command line is this:...
0
votes
0answers
37 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 ...
21
votes
6answers
2k 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
117 views

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

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
52 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?...
1
vote
1answer
63 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
23 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 ...
0
votes
0answers
24 views

list all open terminals

I'd like to have a command to list all terminals and the tabs opened in them along with the current directory in each tab. Is there a scriptable command or an API for the terminal.app that ships ...
3
votes
2answers
32 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
13 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
33 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
79 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
332 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
1answer
39 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
149 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 ...
1
vote
1answer
46 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
129 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
129 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
206 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 ...
2
votes
0answers
116 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 ...
0
votes
0answers
80 views

I keep getting the error zip warning: zip file empty when using zip from command line

command i am running is zip -r /Users/NONAME/Documents/lumosign/ipastosign/Payload . -i /Users/NONAME/Documents/lumosign/ipastosign/spotify2.zip; And the zip file is ACTUALLY empty. This is getting ...
3
votes
1answer
2k 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
44 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 ...