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
0 answers
25 views

application start from command shortcut

Hi I'm using grandma3 and for more options like soundcodes I'm required to start from the command line. which can become quite furstrating after a while. I'd wish it could be done in a press of a ...
user avatar
0 votes
3 answers
83 views

socat UDP multicast issue on WiFi interface

I have installed socat on macOs Montery thanks to homebrew. The command: socat UDP4-RECVFROM:8888,ip-add-membership=239.255.98.99:192.168.1.100,fork,reuseaddr - doesn't retrieve any datagram (same ...
user avatar
0 votes
1 answer
74 views

Programatically disconnecting/reconnecting Yubikey device

I have a: MacBookPro 16" OS 12.3 and I have a "YubiKey 5C Nano". each time my device goes to sleep the key stops responding, and disconnecting + reconnecting is a hassle found similar ...
user avatar
0 votes
1 answer
541 views

clang showing incorrect target on M1 Mac

When I run clang --version I get this result: Apple clang version 13.1.6 (clang-1316.0.21.2) Target: x86_64-apple-darwin21.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/...
user avatar
  • 1
1 vote
1 answer
75 views

Using Find, Execdir, and Grep all in one command

I'm trying to use a shell script to: return all .mov files in a given directory without path, file names only filtering out dot-underscore files from results separate each result by \n but haven't ...
user avatar
0 votes
0 answers
71 views

How can I run a script to add keyboard shortcuts on macOS?

See also: How to script a global keyboard shortcut in MacOS I like to maintain some scripts I use to set up new Macs the way I like them. One thing I would like to automate is the setting of some ...
user avatar
  • 563
1 vote
1 answer
109 views

cp seems to not allow --backup=numbered

I am trying a cp option that runs fine on Ubuntu: cp --backup=numbered src dest Is there some way to get this to work?
user avatar
1 vote
1 answer
97 views

Recursive ZIP won't work in zsh

Until catalina I used zip -r xmp.zip . -i *.xmp To add all xmp files from subdirectories to xmp.zip. Upgraded to mojave (zsh) and now it won't work anymore (return no matches found). How could I do ...
user avatar
  • 125
1 vote
1 answer
434 views

Installing Homebrew fails with "The unauthenticated git protocol on port 9418 is no longer supported"

I am trying to install homebrew to my mac with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" but, I keep getting this amaku@Davids-MacBook-...
user avatar
  • 51
0 votes
1 answer
53 views

Save output from a command to a file after the command is executed

I executed the command and it took quite a long time; now it is necessary to work with this output, but I realized it too late. Executing the command again is not a good idea. I know that can select ...
user avatar
  • 101
0 votes
0 answers
15 views

Open info panel from command line [duplicate]

The open command does the equivalent of double-clicking a file or directory but is there a command to do the equivalent of right-click > Get Info? GetFileInfo outputs info to the terminal, I want ...
user avatar
0 votes
2 answers
225 views

Parameterized ZSH alias

Hello I'm trying to make an alias in zsh for the following command: gcloud compute instances delete CONTAINER_NAME --zone=x --quiet How can I make an alias that would fit my parameter in the ...
user avatar
0 votes
0 answers
107 views

How to get the number of GPU cores using CLI

Is there a way to get the number of GPU cores on an Intel Mac? On a M1 ioreg -l | grep num_cores will display the number of GPU cores, but on my iMac 5K 2017 with an AMD GPU it does not. The same ...
user avatar
  • 241
0 votes
0 answers
55 views

Use chflags to lock files but not folders?

I want to recursively lock all the files within a hierarchy, using chflags; but I don't want to lock the folders themselves. If it helps, the files all start with "DSC", but the folders don'...
user avatar
  • 23.7k
2 votes
1 answer
35 views

How to fix incorrect command line mail user name on macOS?

On OSX 12.2.1 I am seeing a message that I have mail. But if I type mail I see the following: mail: /var/mail/Chris: Permission denied If I list the contents of /var/mail/ I see chris i.e. all lower ...
user avatar
  • 450
0 votes
2 answers
897 views

Convert SVG to PDF using command line in Mac OSX

I want to convert a SVG file to PDF from the command line on Mac OSX. Is there any way to do this?
user avatar
0 votes
1 answer
46 views

How to launch terminal session and run on launch. macOS

I want to launch two terminal sessions and run a command in each on launch in macOS. I want the graphical terminal to launch, I'm not after a launchagent that runs in the background. Is this possible? ...
user avatar
1 vote
1 answer
25 views

Why does `compress` behave differently depending on file types?

compress 1.pdf does not compress the file to 1.pdf.Z. But compress 1.sh compress the file to 1.sh.Z. (compress is /usr/bin/compress on macOS.) Does anybody know why is it so? How to make it compresses ...
user avatar
1 vote
1 answer
100 views

What do the "shiwat" and "rhiwat" columns mean in output of netstat -v?

The output of netstat -v includes the following column labels: Proto Recv-Q Send-Q Local Address Foreign Address (state) rhiwat shiwat pid epid state options man netstat does not explain ...
user avatar
1 vote
1 answer
50 views

Access previously run shell command in single user mode

The shell which opens in Single User Mode on my Mac doesn‘t allow to just use „Cursor up“ to access the previous command. How can easily do this without having to retype it?
user avatar
0 votes
0 answers
180 views

Open finder directory in terminal emulator of choice?

I'm using a launcher app called Raycast which lets me run script commands anywhere. On their github I found community Applescripts that have functionality I want (opening current finder folder), but ...
user avatar
  • 1
0 votes
0 answers
23 views

ACL different behavior between single 'chmod +a' vs many 'chmod +a'

About ACL on MacOS Having the /Volumnes/192.168.1.77 directory and applying: sudo chmod -R +a "group:developer allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,...
user avatar
4 votes
1 answer
939 views

Terminal ls command does not list complete contents of /Applications

In Terminal.app, I issue the following commands: cd /Applications ls It lists many, but not all, of the apps that the Finder sees. The ones it appears to omit are all Apple, but it doesn't omit all ...
user avatar
  • 1,080
9 votes
2 answers
2k views

"ls" works, but "ls -l" gives me "Operation not permitted"

There are several folders on my system (Monterey 12.2.1) on which I can successfully run ls, but if I run ls -l on the same folder I get "Operation not permitted". I am running these ...
user avatar
  • 201
1 vote
1 answer
156 views

follow an alias link to a directory, using zsh and ohmyzsh

Is it possible to follow an alias link in Terminal using zsh and ohmyzsh? My Terminal states: 'zsh: permission denied:' or 'cd: not a directory:' . The alias is of course a little file and not a ...
user avatar
  • 11
1 vote
0 answers
69 views

Is not possible create directories and files at /Volumes with permissions granted

In Linux Ubuntu for example within the /mnt directory I created two directories - for example: alpha and beta - it to be used to mount some remote directories later. For the same machine exists two ...
user avatar
1 vote
1 answer
231 views

How to access commands included with macOS from macOS Recovery?

Often, I boot to macOS Recovery only to find one of commands I wish to enter has not been included. For example, hexdump and nano are not included. However, if the volume containing macOS is mounted, ...
user avatar
1 vote
2 answers
80 views

tree command does not show hierarchical structure?

The following resources show tree should output hierarchical directory structure view directory structure So I did brew install tree. But the tree command does not print hierarchical output: (py367) ...
user avatar
0 votes
0 answers
26 views

How mount through a command a remote directory at /Volumes but within a specific path and directory? [duplicate]

In Mac - El Capitan - through: Finder -> Go -> Connect to Server Is possible do the connection with smb://hostname/documents Therefore the documents remote directory is mounted on /Volumes /...
user avatar
1 vote
1 answer
194 views

update/upgrade bash without homebrew

I have MacOS El Capitan - about bash it is: bash --version ... version: 3.2.57(1)-release ... I did realise the mapfile command is not available in that bash release. I already did do research and ...
user avatar
1 vote
1 answer
3k views

How can I run a script in Rosetta from terminal on M1 Mac? [duplicate]

How can I run a shell/bash/zsh script in Rosetta from Terminal without having the Terminal being opened in Rosetta?
user avatar
  • 224
0 votes
1 answer
63 views

How do I make a new terminal window use a new version of nano installed with homebrew?

MacBook Air M1, MacOs Monterey I have installed with homebrew the latest version (6.1) of the nano editor, which I can start with nano. However, in a new terminal window, nano launches the old, pre-...
user avatar
  • 141
0 votes
1 answer
26 views

'grep --color' only shows limited number of matches and duplicates input lines

I have a lengthy string on one line and want to highlight all occurrences of a character/substring using grep --color on the command-line. However, this only highlights matches in 'chunks' of 32. If ...
user avatar
  • 3
1 vote
1 answer
210 views

Deleting duplicate copy of cURL command line application and point the system to only one copy of it

I recently updated my copy of cURL via Homebrew, which it put in /usr/local/Cellar/curl (v7.80.0). I also have an older version of it (7.43.0), which is located at /usr/bin/curl. This is the version I ...
user avatar
4 votes
3 answers
2k views

How to use terminal to visit a site and take screenshot?

I am aware curl on Mac lets you visit a site from the command line. Is there a way to visit that site then take a screenshot and download it?
user avatar
  • 205
0 votes
0 answers
68 views

Determine MTU of an IPv6 path

For IPv4, MTU can be found with sweep-ping: ping -g 1464 -G 1508 -c 2 -h 1 -D 1.1.1.1 or by manually decreasing ping after a huge ping: ping -c1 -D -s 1472 1.1.1.1 For IPv6, the easiest method I'm ...
user avatar
  • 207
1 vote
2 answers
742 views

What's the correct file to store environmental variables for zsh?

I'm a bit confused as to how all of this works. Seemingly every tutorial tells me something different. So far there's about 4 different files I can add environmental variables to: .zshrc .profile ....
user avatar
0 votes
0 answers
57 views

How do I correct incorrect output from diff on Unix

I have 2 similar files that I'm comparing. There is only 1 incorrect value on the first line but I get output in this pattern 1c1 contents of 4th line \ No newline at end of file The contents of the ...
user avatar
  • 101
0 votes
1 answer
135 views

Find ports used by a specific process on macOS

There are dozens of answers here and elsewhere on how to find what process is using a specific port, but so far I haven't found a better way to find what ports are being used by a process other than ...
user avatar
0 votes
1 answer
533 views

oh-my-zsh startup failure: __git_prompt_git status blocks

I have been installed iTerm2 and brew. In the process, I have some problems with my terminal. It doesn't show anything whatever I command it. That's all I can do is /bin/bash to return to bash. There ...
user avatar
  • 1
0 votes
1 answer
619 views

Xcode constantly asks for command-line tools

Homebrew requires the XCode command-line tools to work. It never complains they are missing. But every time I do anything else that launches XCode, XCode itself asks me to install the command-line ...
user avatar
  • 3,428
0 votes
1 answer
20 views

Interaction between `od -xc` and Terminal color change

If I list the ID3 tags of an MP3 file with eyeD3, the full file name/path is shown in green, and the file size spaced over to the right edge of the Terminal window.  Before and after, a line of ...
user avatar
  • 3,428
0 votes
0 answers
19 views

Extract Finder tags for multiple files? [duplicate]

I have hundreds of videos that have been tagged in Finder with various keywords. I'm moving to a proper Media Asset Management system now so I'm looking to mass extract these tags into a text or csv ...
user avatar
1 vote
2 answers
1k views

ZSH shell setting up paths

I'm trying to install and set up the following program on my Mac Big Sur. https://bondxray.org/software/aline.html I unpacked it on /Applications. However, my knowledge is quite limited and I can't ...
user avatar
  • 11
0 votes
0 answers
36 views

AppleScript; How do I run tell command when a specific text within a folder exists?

I just learned how this coding thing works today so bare with me if I go all noob on you & feel free to put me in my place for which I'm misinformed; tell me what's up ;) I have made a .app that ...
user avatar
2 votes
0 answers
76 views

What does Command + ("Bigger") actually alter in OS X Terminal?

At first glance issuing Command+ (View -> Bigger) in OS X Terminal simply increases the font size, and increases the window size while keeping the number of rows/columns the same. However, I can't ...
user avatar
  • 71
0 votes
1 answer
144 views

How to recover deleted directory (rm -rf *)

I have deleted a directory accidentally from terminal by using "rm -rf *" on Mac (Mac 11.6 big Sur). I don't have it backed up on other devices and Time Machine wasn't on. Is there any way ...
user avatar
  • 1
0 votes
1 answer
168 views

Meaning of when a process in "ps -el" output does not show full path to executable?

On Catalina v10.15.7, I am using: ps -el to investigate all running processes. I have 430 running processes. Ignoring those associated with open terminals, I'd like to understand why these 6 ...
user avatar
  • 115
0 votes
1 answer
29 views

"cpan install" trying to use /sw/bin/tar (instead of /usr/bin/tar)

I'm having no luck getting CPAN modules to install on my M1 Mac running Big Sur. They all seem to be trying to use /sw/bin/tar to untar the archives, but there is nothing there; tar is in /usr/bin/...
user avatar
  • 103
0 votes
0 answers
17 views

Can I get a battery percentage for a non-Apple BT device from the command line in Catalina? [duplicate]

I used ioreg and the only one of my connected devices that seems to report its battery level is the Trackpad: ╰─➤ ioreg -l | grep -B 20 BatteryPercent\" | | | | | | | "...
user avatar
  • 748

1 2
3
4 5
56