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
0
votes
0answers
27 views

.command The file could not be executed because you do not have appropriate access privileges

I am trying to execute a terminal command by just double clicking a .command file. But I am getting this error. The file “myfile.command” could not be executed because you do not have appropriate ...
1
vote
1answer
34 views

Lock macOS with a password from bash

Is there a way to lock macOS so that waking it up requires the user’s password? (Even If normally the password won’t be requested if it is waked up in, say, 1 hour)
1
vote
1answer
227 views

Specific: effect of rm -r /./*

I was trying to delete files inside the current directory with rm -r /./* command. When executed it warned me about removing "...Siri..Application". I kind of panicked, thinking it's trying to delete ...
1
vote
2answers
24 views

Command Line for Final Cut Pro Import?

Is there a command that I can use for importation of files into Final Cut Pro? I tried this next command but Command-O is not the way to import files. open -g -a "/Applications/Final Cut Pro.app" /...
1
vote
1answer
34 views

Symbolic links are not working [closed]

when I create a symbolic link ln -s /source.txt destination.txt and then try to cat destination.txt, open destination.txt or simply drag that file onto TextEdit it gives me some machine code instead ...
1
vote
0answers
18 views

How do I make a new terminal window that is a child process of another one?

How do I make a new terminal window that is a child process of another one? for example, If I am in one terminal and I do export zzz=123 then a child process should have $zzz . If I do cmd-n ...
0
votes
0answers
48 views

Still looks bash

I've already changed shell to zsh, but my terminal still looks like bash. What I've done: Install Oh My ZSH via curl. Run cash -s /bin/zsh in terminal. They said once you restart the terminal you'...
0
votes
0answers
19 views

macOS: how to set a custom lock screen delay (from command-line)?

In MacOS, if I don't like the System Preference's provided options in the dropdown "Require password [...] after sleep or screen saver begins", is there a way to set it to a different value, ...
1
vote
0answers
19 views

Hide SSID from the list of available wifi networks in macOS?

Is there any way to hide particular SSID names from the list of available networks? Below command gives list of wifi networks, /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/...
1
vote
2answers
61 views

Using command line how to open a specific section of GUI System Preferences?

It is possible to open a specific section (sub section) of the GUI System Preferences via command line terminal? Example: If I want to open just the main System Preferences window, I just run open /...
0
votes
2answers
42 views

How do I write folder-agnostic shell script on Mac as I can do in Windows?

I would like to write a set of shell scripts which would execute smoothly on Mac disregarding where they are called from. I am currently struggling about how to implement this. On windows, I could ...
3
votes
1answer
64 views

Mac Terminal Padding

Is it possible to add window padding to Terminal.app? Here's how it looks currently ... and here's how I would like it to look ... iTerm2 with padding
8
votes
2answers
211 views

Pipe to mv command

I'm trying to move files from Terminal but only those from the results of a grep query. ls -l | grep -i s02 | mv What is the best way to complete the command above?
2
votes
1answer
14 views

Is there a way to suppress valid files beginning with dot (.) in a tar archive giving false errors and files?

I have a tar compressed archive created on a linux system that has valid files in a directory beginning with dot (.). When I extract that tar file on a Mac, tar thinks that the dotted file is a ...
3
votes
2answers
31 views

Homebrew uninstalling fails

I am trying to uninstall a cask using homebrew, but each time it fails due to (I believe) AppleScript failing to run. I believe this issue stems from my multiuser setup (I am a non admin). Error: ...
1
vote
0answers
13 views

How to restore Dock Icon Badges after killall Dock?

I need to run killall Dock in a script I use regularly, in order for it to work. Unfortunately all the badges in the Dock disappears when Dock is killed, and don't reappear until they're modified ...
4
votes
1answer
505 views

How can I make multiple directories in Mac OS terminal?

I'm trying to make multiple folders at once but when I press enter it says: mkdir: i/like: No such file or directory. I do this mkdir i/like/icecream I think I have the latest version of python. Any ...
1
vote
1answer
22 views

Disable dictation from command line

Is it possible to disable dictation from the command line, so that macOS never asks again if I want to enable it? I know that many such things can be done using defaults write but couldn't find the ...
6
votes
2answers
191 views

extract the top-level domain and the second-level domain from a URL

I'd like to extra the top-level domain and the second-level domain from a URL like "https://apple.stackexchange.com/questions/ask" Example URL with desired result below. https://apple.stackexchange....
0
votes
0answers
9 views

clang: error: unsupported option '-fopenmp'. Change default compiler? [migrated]

I am on a Mac (Mojave) but I am not a Mac user. I am doing this mostly blindly, since I do not have the basis of make commands, compilers, xcode, and so on. I need to run a make command (actually ...
1
vote
0answers
28 views

How to control iPhone “Personal Hotspot” via Terminal

I'm a recent convert to Alfred and want to build workflows to connect and disconnect my MacBook to my iPhone's Personal Hotspot. Are these commands easily available in Terminal please? I've looked ...
1
vote
0answers
32 views

How do I set the terminal tab title via command line?

I want to set the terminal tab name from the command line. I am using this command to update the name echo -en "\033]0; New Name \007". Here is what my terminal now looks like. When I use the ...
1
vote
1answer
90 views

Can I suppress the Setup Assistant When Creating New Users on macOS?

I wanted to create a new user using Terminal and managed to do so by finding answers on StackExchange, but I was not able to figure out how to skip the setup assistant that comes up when you login to ...
1
vote
0answers
30 views

Can a Terminal Mark be added via a shell command?

MacOS' Terminal's marks are an incredible feature. They allow you to add a "marker" to a line, which can be jumped between. Documentation about these commands is available in Apple's own documentation,...
10
votes
2answers
792 views

How to md5 a list of filepaths contained in a file?

I have a folder containing many folders containing many files. Thousands. I can do find . -type f > ./FILE-LISTING.TXT to create a file containing many thousands of file paths that looks like this:...
1
vote
2answers
80 views

Force eject a device

Because my drive will freeze occasionally, I would have to pull the cable out. (see the question below for more detail): Seagate Backup Plus 5 TB became unresponsive after long period of use I've ...
2
votes
0answers
59 views

How to check if any audio is currently playing via Terminal?

Sometimes I turn up the audio on my MacBook, but then forget to turn it back down. Is there a terminal command I could use to detect if audio is currently playing (sound coming from the speakers)? I ...
0
votes
2answers
77 views

Why so many shell in /bin

Here is the ls output of my /bin directory: [csh ksh zsh bash dash tcsh sh ...] Prior to catalina bash was the default and now zsh is default. What's the usage ...
0
votes
1answer
85 views

Command “istats” gives “-bash: istats: command not found” after “gem install iStats”

I wanted to use iStats in command line/terminal mode, so I did the following: I installed iStats with the command gem install iStats as per this answer to an AskDifferent question; However, when I ...
2
votes
1answer
56 views

Is it possible to query the current user's Apple ID from the command line?

Is it possible to query the current user's Apple ID from the command line? I want to create an AppleScript (run-only) app that will run only for a specific user (or at least for a user signed in with ...
3
votes
1answer
108 views

macOS: List apps authorized for full disk access

Is there a Terminal command to view a list of all macOS that are authorized and unauthorized but have asked for Full Access? I am looking for the list that is displayed under System Preferences → ...
-1
votes
1answer
61 views

How to script file for a Mac with several Terminal commands

I have few Terminal commands which i'm using so frequently,So i though to automate it to reduce the effort of copy-pasting the commands one by one in terminal and time. I created a .command file for ...
0
votes
0answers
35 views

iMac: How to disable display via terminal. Kernel_task issue CPU 70%

I have a Late 2015 iMac running macOS Mojave. I am looking to disable the main display and use an external display as the primary/default display. I am looking for a command-line that can do that. I ...
3
votes
0answers
55 views

How can I detect which button was clicked in the DMG EULA confirmation screen

I'm using the open command to automate (via bash) opening a dmg which has a EULA attached to it. When I run open my_app_distribution.dmg I get a screen that looks like this: The open commands uses ...
1
vote
1answer
113 views

cp command: Overwrite confirmation with file diff

When running cp command to copy files, I would like to be prompted for overwrite confirmation, and, if possible, view the file diff confirming. Is this possible? And if yes, how? Ideal example: $ ...
0
votes
1answer
80 views

What modifies the PATH variable on macOS? [duplicate]

echo $PATH returns a different result than the PATH variable I define in .bashrc. .profile is empty. What else could be modifying the PATHvariable? The directories listed are all things I would have ...
3
votes
1answer
251 views

Unable to mail from command-line - public/pickup: No such file or directory

Attempting to send mails using mail(1) from the macOS terminal shell results in the following message and the mail is not sent. postdrop: warning: unable to look up public/pickup: No such file or ...
0
votes
1answer
32 views

Command Line for Enable Dragging

In MacOS, in the Accessibility widget (in System Preferences) if you scroll all the way down to 'Mouse & Trackpad', and then click on the 'Trackpad Options' button, there is a by-default-unchecked ...
0
votes
2answers
77 views

Disk usage in Mac terminal not working with --max-depth

I want to see my disk usage for a specific folder with a pre-set maximum depth. On Linux, the command is $ du -h --max-depth 1 On macOS Mojave (10.14.5) with bash version 3.2.57(1)-release, this is ...
0
votes
1answer
41 views

How to find the process id for the app instance created by “open” command

When I programmerly do open -F -W -n -g -a /Applications/Safari.app/Contents/MacOS/Safari https://kernel.org, I got back the process of open and its pid 93930. But that's not the process (93931) of ...
2
votes
1answer
39 views

How to find the PID(s) of a hung app in macOS from the shell (Terminal)?

Within Activity Monitor.app it's easy to visually identify a hung app by seeing its name in red text: How can such hung app statuses be identified from the shell (Terminal.app) and the PID(s) of ...
1
vote
1answer
41 views

how to reset $SHELL variables in root from user space

I've switched my bash to zsh in root using chsh -s /usr/bin/zsh root After when I change back to bash, I type the wrong path: chsh -s /usr/bin/bash root Now I cannot enter root and I get this ...
0
votes
1answer
22 views

Unable to open a UDP port with nc

On ubuntu, I can open a UDP port: nc -lu 5555 Then in another terminal window, send a message: echo "hello" | nc -u localhost 5555 The message is received at the listener side, as expected. ...
2
votes
2answers
92 views

Change output format of “top” command in Mac OS for memory usage?

I am using the top command in Mac OS from this answer to grab memory usage: $ top -l 1 -s 0 | grep PhysMem PhysMem: 5490M used (2569M wired), 11G unused. Can I go from that to possibly printing out ...
0
votes
1answer
25 views

Convert .cda audio file to m4a [duplicate]

I wanted to use ffmpeg ffmpeg -i file.cda file.m4a but I get the error Invalid data found when processing input So how can I convert lots of cda files on macOS?
3
votes
1answer
182 views

How do I install beta command line tools using softwareupdate -l on 10.14.5?

On a clean install of 10.14.5: Multiple reports of the beta version not working using a headless install: https://github.com/Homebrew/install/issues/206 This lead me to trying to manually do a ...
1
vote
0answers
112 views

Uninstall Xcode 11 beta 1 Command Line Tools accidentally installed in public release of macOS Mojave? [duplicate]

Yesterday I ran the system update and mistakenly installed Command Line Tools for Xcode 11 beta 1 in a system running macOS Mojave. This update is breaking some of my dev applications. I would like ...
3
votes
1answer
39 views

Entering path containing spaces in Terminal

Working on my MacBook Pro, I want to change the location of my iPhone backup to an external drive, but when entering the command on the CLI I hadn't noticed that the destination drive has a space in ...
3
votes
3answers
340 views

Remove sudoers using script

At the moment I'm working on a solution to prevent all admins users (except one particular) from running sudo. I can add a specific user to sudoers by running: sudo -i echo '$username ALL=(ALL:ALL) ...
1
vote
0answers
66 views

updated os to mojave 10.14.5, now lsof is giving me errors with stat

I had a system update last Thursday and ever since I have been getting the errors below. I have tried reinstalling lsof via homebrew, upgrading bash, rebooting, but no luck. How do I even go about ...