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
8 votes
6 answers
2k views

How to help the jEdit application find java?

I installed jEdit on my new mac (Intel processor 11.3.1 Big Sur) but it gives me the message "This application requires that java 11 or later be installed on your computer." So I installed ...
0 votes
1 answer
76 views

Wipe iPhone data

Is it possible to completely wipe out iPhone data using dd tool? Something like this? sudo dd if=/dev/random of=/...
4 votes
3 answers
905 views

Apple Terminal startup errors (session save/restore)

Recently (possibly with the Sonoma update, but possibly even more recently than 14.0), Apple Terminal has been giving the following error on startup (when macOS is set to restore windows, i.e., when ...
1 vote
2 answers
60 views

Terminal | Shortcut for Automatically Saving Files Created Using "code"

I have a question regarding a shortcut use of "code". My Goal is to simultaneously: Open a new file in VS Code, and also: Automatically save that new file to my current working directory ...
6 votes
4 answers
11k views

How to display the full command history in terminal?

Since updating to Big Sur, the history command (terminal) shows only the last 16 commands. Do you have any ideas how to get the full history back?
0 votes
0 answers
23 views

How to play the audio of a .mkv file from a command line from a specific offset to another at different speeds

The first thing I tried was using VLC: /Applications/VLC.app/Contents/MacOS/VLC '{$movpath}' --start-time='{$ts}' --stop-time='{$te}' --no-video rate='0.5' 2> /dev/null; However, the player takes ...
21 votes
5 answers
53k views

Does macOS have equivalent command line tools like `lshw` or `lspci` for enumerating PCI hardware devices?

The closest thing I know of is system_profiler but it spits out way too much unnecessary information and I don't have a good way to filter / transform that output. What's the closest alternative to ...
2 votes
1 answer
408 views

Weird message (MacOS 14): "-macosx_version_min has been renamed to -macos_version_min"

I keep getting this: -macosx_version_min has been renamed to -macos_version_min anytime I compile anything. Any reason why? Can I prevent it?
-1 votes
0 answers
39 views

How to avoid duplicate commands in command line?

This seems to have been asked many times, but I just can't make it work. I want to make it so that when I use the same command two or more times in a row, it shows up only once when scrolling through ...
3 votes
1 answer
518 views

Why is Terminal.app weird about stealing keyboard focus on Monterey?

I use Due for reminders, and have it set up to use the keyboard shortcut Cmd+Opt+D to activate the Due window (which lives only in the Menu Bar, not the Dock). This works fine in most applications and ...
0 votes
0 answers
28 views

ISL Light macOS remote connection via SSH

I am trying to establish a new tunnel on ISL Light app from ISL Online. I have an account already and on when I log in, in the Computers window I can access a remote server that I am assigned to have ...
341 votes
6 answers
949k views

How can I list my open network ports with netstat?

I would like to list my open network ports in Terminal with built in commands. As what I know, netstat is the command to use. But I'm struggling to get any useful information out of it. How can I ...
14 votes
3 answers
21k views

How to delete (tmutil delete) all old backups from TimeMachine - keep only current full backup

How to delete (with CLI tmutil delete) all old backups from TimeMachine. I wish to keep only current backup. I wish to put that into crontab. Found How to Delete Old Backups from Time Machine on Mac ...
0 votes
1 answer
96 views

MacOS man pages out of date

I’ve caught a few POSIX options unavailable on a MacOS man page (but are supported — they compile). Is there a way to submit a patch to the kernel developers?
0 votes
1 answer
43 views

What does the 'ps -o cputime' show in the TIME column?

The macOS ps gives the TIME like this: UID PID PPID C STIME TTY TIME CMD 0 50769 80598 0 9:09pm ttys000 0:00.00 egrep 96222|PID 666 96222 95653 0 10:09pm ttys006 0:00....
0 votes
1 answer
120 views

Trying to execute shell commands opening multiple terminals

I have a shell command which I use to setup multiple servers (metro, laravel, ngrok). Each of these processes needs to be executed in its own Terminal window. The issue right now is that all I'm able ...
1 vote
2 answers
410 views

Terminal "history" command brings back different results

In OSX's terminal, I run the history command to find my recent commands. Often I notice recent commands will not show up, seemingly randomly. For example, I will log on one-day and notice my commands ...
1 vote
2 answers
77 views

zsh - Sort files expansion in MacOS Terminal like in Finder: numerically and case-insensitively

Is it possible in MacOS Terminal to have the sort order numerically and case-insensitively, almost like in Finder? I'm on MacOS 14 Sonoma, using Terminal app with zsh 5.9 and oh-my-zsh. I'm trying to ...
32 votes
15 answers
73k views

How to retrieve current wattage info on OS X?

Is there a way to retrieve the current watt usage info on OS X Snow Leopard? I'm using mid-2010 iMac, so I'm not looking for just battery-related apps. Does OS X even monitor power usage? Do I need to ...
2 votes
1 answer
353 views

How do I build and install libfsapfs?

I downloaded a tool from GitHub (libfsapfs) to help with an issue I’m having with an external HDD formatted in APFS. I have some familiarity with the terminal and know some basic Unix commands but ...
1 vote
1 answer
43 views

How do I disconnect clients on my Mac file server from the command line

I have use a Mac mini (running Ventura) with a connected Drobo as a file server. The file sharing is standard Mac file sharing to other Macs via SMB. I believe AFP is no longer supported, or no longer ...
10 votes
3 answers
6k views

How to launch TextMate (and probably other software) from the command line?

I am very new to Mac, coming from Linux. I am using TextMate, and I suddenly discovered I do not know how to launch TextMate from command line. Using completion, nothing looks like TextMate. Where ...
10 votes
2 answers
7k views

How to migrate aliases from bash to zsh

I want to start using zsh as recommended by Apple for Mac OS Catalina. How do I migrate my aliases that I have defined in the ~/.bash_profile to the new shell?
3 votes
1 answer
223 views

defaults delete domain is not working

I'm trying to clear out the defaults for an app I'm working on. defaults read com.mycompany.Foo That prints a bunch of stuff. defaults delete com.mycompany.Foo Silent. defaults read com.mycompany....
1 vote
1 answer
27 views

How can I specify the window size for Emacs on a Mac?

I used to be able to launch Emacs version 28.1 on macOS from the command line in XQuartz terminal window like so: /Applications/Emacs.app/Contents/MacOS/Emacs --geometry 109x65 & After upgrading ...
0 votes
0 answers
19 views

How do I use Zathura after Homebrew installation?

Command line newbie here. I was looking for a PDF/EPUB reader that didn't annihilate my retinas, and looked like Zathura was a good option since others didn't seem to have dark mode. I installed ...
3 votes
0 answers
119 views

.zsh_sessions producing an error [duplicate]

Each time I open Terminal, I get an error: /Users/myname/.zsh_sessions/SESSIONID.session:2: command not found: Saving in each of the windows I set to open by default. This seems to have appeared a ...
67 votes
8 answers
53k views

How can I install the Command Line Tools completely from the command line?

I'd like to script the installation of the Xcode Command Line Tools. On Mavericks, xcode-select --install will open a dialog prompting the user to install, but I'd like to trigger the install without ...
0 votes
2 answers
3k views

Use "startosinstall" to install macOS Catalina on External Drive

I want to use "startosinstall" so that I can install macOS Catalina onto an external hard drive in order to preload MacOS onto multiple SSD's quickly. I've researched into this and have ...
0 votes
1 answer
65 views

AWS Environment Variables - IDE

I use the IntelliJ IDE for my daily tasks. I set up my AWS environment variables, by executing a script. If I wish to use a plugin built into the IDE to query AWS K8S it will fail as it expects the ...
4 votes
1 answer
3k views

Mounting a single partition dd image in macOS?

Using testdisk, I have made what is apparently a dd image of a single HFS+ partition (what was originially /dev/disk1s2, I think). Now I try to mount this image file, but seemingly I cannot - even if ...
2 votes
1 answer
319 views

Using Terminal commands, how can I find the application associated with a given file?

Basically, what is the equivalent to what_is_associated call_diagram.dot.svg which would return some "pointer" back to the Vivaldi app on my system. See below for what does the job ...
6 votes
1 answer
2k views

macOS Terminal not using correct manpath

How to set $MANPATH or manpath for the macOS Terminal Help menu command: Open man Page for Selection? Having recently done a clean install of macOS Mojave (10.14.6), I am trying to get my macOS ...
1 vote
1 answer
43 views

One app, two dock icons, with separate command line arguments?

Is it possible to have two icons for Firefox in the dock (the app list at the bottom of the screen)? I'd like to have one icon to start one profile (say, "dad's Firefox profile") and another ...
0 votes
1 answer
21 views

Command-line gunzip on macOS 12.7 Monterey (M1 Mac mini) gives OK with gunzip -tv filename.gz and NOT OK with gunzip -ltv filename.gz

The situation: The file php-8.2.11.tar.gz is downloaded from https://www.php.net/downloads.php At the command line, running gunzip -tv php-8.2.11.tar.gz gives output which includes OK. However, ...
1 vote
2 answers
126 views

Command to format a raw floppy disk image with FAT12?

I'm new to OS Development, and I want to format a 1.44MB floppy image with the FAT12 file system. I created the disk using dd if=/dev/zero of=<my image> bs=512 count=2880, so it's just a raw ...
1 vote
1 answer
222 views

Automator application that asks me for a YouTube URL before running the command

I'm trying to make an Automator application that runs this command: youtube-dl -x --audio-format wav -o "~/Downloads/%(title)s.%(ext)s" 'youtube file url' but I’d like for it to ask me for ...
1 vote
1 answer
82 views

How to upload file to Google Drive using duck?

I usually access my Google Drive using Cyberduck. So far, no problem with creating folders, moving files, etc. Then I noticed it has a command line interface called duck. Should be handy since I work ...
4 votes
2 answers
896 views

Convert PS file to PDF using macOS Ventura?

I have created a .ps file using this command: man -t man > test.ps But what I want to do is convert the .ps file to a .pdf file. If someone could point me in the right direction I would appreciate ...
2 votes
1 answer
51 views

Relationship between binary and it's dependency dylib

With my understanding, if a binary(ex. rsync) refers(depends on) static library (libxxx.a) and the libxxx.a is updated, a binary have to be re-compiled to reflect libxxx.a's update. Is it correct? And ...
3 votes
2 answers
10k views

How to get a terminal general auto-complete function?

I'm new in macOS and I'm using macOS Sierra, In my Ubuntu and other Linux-based system, terminal has an auto-complete that helps to complete commands and their options. For example for wget and ...
14 votes
2 answers
4k views

Linking manuals from Homebrew

Whenever I install a software with Homebrew and I try to view the manual I get an error stating: No manual entry for <name of program>. As an example, wget: when I type $ man wget No ...
1 vote
1 answer
66 views

GUI File Manager to show line count for all files

Are there any GUI file managers like finder or any other file managers, which will show file row count? I can see the row count from cli, using wc but I don't want to use cli all the time. GUI is ...
1 vote
1 answer
2k 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 ...
30 votes
4 answers
93k views

How can I set the display settings using command line

I would like to configure the 'Scaled' property of my Macbook Pro display using the command line. How could I do that?
0 votes
0 answers
95 views

Calculate process memory usage as percentage

I want to calculate the memory usage as a percentage for some processes on the device. That is, how much percent of total memory a particular process is taking on the system. (Need it for reporting ...
1 vote
1 answer
86 views

Homebrew not installing correctly

I was installing homebrew through the .pkg to install GNU Emacs, and it did not run after installation. I ran brew help and it outputted zsh: command not found: brew. Command Line Developer Tools were ...
974 votes
11 answers
1.1m views

List of all packages installed using Homebrew

Is it possible to and how do I get a list of all the packages installed on my Mac using Homebrew? I am not interested in packages installed outside of Homebrew.
1 vote
2 answers
62 views

Creating a FAT32 SD card image (.img) out of a directory using command-line tools

I'm writing a program which is meant to be loaded and run exclusively from a FAT32 SD card. I need to create an SD card image for distribution as well as for testing the storage and retrieval of files ...
1 vote
1 answer
107 views

Merge missing disk partition on a Macbook

I tried to install a Linux distro on a partition in my macbook, but it didn't go well so i want that partition to merge it to my main partition of the OS, but in the disk utility doesn't appear. If i ...

1
2 3 4 5
61