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
2answers
57 views

Running `nano` uses the old nano(2.0.6) even though nano 3.0 is installed

I installed nano 3.0 with brew install nano, but when I run nano --version, it shows version 2.0.6, which is what came with macOS. Screenshot: echo $PATH also shows that /usr/local/bin is listed ...
3
votes
2answers
105 views

Copy the first n files from one directory to another

Im looking to copy the first 'n' files from one directory to another directory preferably with only cli tools (no scripts). I've tried the following: find . -maxdepth 1 -type f | head -5 | ...
2
votes
1answer
34 views

Any way to open a URL in a script without having it open in a browser

The situation: My mobile carrier offers for free to send SMS notifications by following a URL. What I'd want: Include these URLs in various scripts to get notifications when I'm away from keyboard. ...
3
votes
2answers
62 views

Difference between filename and . filename in macOS terminal

I'm newbie to MacOS. (I'm using mac OS high sierra 10.13.6) I installed a software. They said to initialize the software by . /path/setsas.sh I give no thought to . and space, so I just ran path/...
3
votes
1answer
26 views

Command line to find bluetooth device's MAC address [duplicate]

Is there a way to get the MAC address of the Bluetooth device in my Mac? I am using a MacBook Pro running macOS High Sierra. I am looking mainly for macOS but the command could also be for another ...
2
votes
1answer
31 views

Save command line output to a file without any graphics or special characters

I want to save the command line output data in a text file. I am running macOS High Sierra 10.13.6. The problem is, it has some graphical output which I don't want to store. What I need is, only the ...
4
votes
2answers
63 views

Bash - Suppressing output to STDOUT

I've written a script for fresh macOS installs that installs Homebrew, Cask, and a bunch of apps I like, along with creating a .vimrc file. Thanks to an answer by daniel Azuelos (located here: Best ...
0
votes
0answers
14 views

Looking for an ios terminal/ssh app that supports jump hosts and agent forwarding

I stumbled upon Termius. They support agent forwarding. But support for jump hosts (or "host chaining" as they call it) only exists in the android version of the app. Is there an alternative to ...
0
votes
0answers
30 views

preventing a file from being changed or emailed

I have a file/programm on my computer which I woud like to remain offline. More specifically, I'd like to block myself from emailing it to myself, and then opening it on another computer. But I'd ...
0
votes
1answer
15 views

After installing wine with a .pkg, I get the error wine: command not found when running from the terminal but the app works fine

I have installed wine through a .pkg from here. Wine Stable.app works fine, but when I run any wine-related command from the terminal, I get command not found.
0
votes
0answers
22 views

Post-install step not completing while installing wine with homebrew

I'm trying to install wine with brew install wine, but it keeps on showing Warning: The post-install step did not complete successfully and when I try again with brew postinstall wine, it shows the ...
3
votes
1answer
126 views

How do you insert literal control chars in vim on Mac?

How do you insert literal control characters in vi on Mac? For example what is the Mac equivalent of Unix ^V^M Windows ^Q^M (in vim) to insert a \r into a substitution string?
3
votes
3answers
46 views

Make Time Machine use two drives from Terminal

My desire is to have two identical Time Machine backups on two different locally attached drives. My first thought was a clone via Carbon Copy Cloner, but it won't do it, because Apple won't let third ...
0
votes
1answer
25 views

How to get the Disk Image property using terminal?

Let's say I have the volume path. Normally I can right-click and 'Get info' to get its Disk image. I want to replicate the same on terminal (basically need to code it in objective C) mdls doesn't seem ...
0
votes
0answers
16 views

How to script a global keyboard shortcut in MacOS

I want to configure a global keyboard shortcut in MacOS using a script. Specifically, I want to set the "Move focus to next window" to ⌘⇧§ (since I have a Swedish keyboard and the default ⌘⇧` has a ...
0
votes
1answer
18 views

Why isn't xargs running one command per line for this use case?

My overall task is to ping each EC2 server I happen to be connected to. I am using this command to do that: netstat -W | grep ec2 | cut -d " " -f 18 | sort -u | cut -d "." -f 1,2,3,4 | xargs -0 -p "...
-2
votes
1answer
52 views

Hacking via Terminal Shell Script [closed]

Is there a shell script that you can use to hack cell phones with just their number from your macOS? I ask because my phone was hacked with just the number and I am curious how it was done? This may ...
6
votes
4answers
2k views

Is it normal to have same user logged in twice but from another TTY?

I don't know if this is something that is in macOS, but in Linux I normally see only one user if I run the who and w command. Is it normal to have same user logged in twice but from another TTY? I ...
3
votes
2answers
36 views

Trigger the Creation of a Specific Preference List?

I have the following function: hardware_model () { local hardware_mod hardware_mod=$(defaults read ~/Library/Preferences/com.apple.SystemProfiler.plist 'CPU Names' \ | cut -sd '"' -f 4 \ | ...
1
vote
2answers
36 views

Set pmset to sleep in a specified time

I could set sleep as pmset sleep now I'd like the machine to sleep in 10 minutes later for example, (I am going to have lunch but desire Mac wait a process to be finished) I checked the "pmset" and ...
1
vote
0answers
35 views

Terminal Startup command not found

Whenever I open my terminal there is a line that reads, -bash: 6ee67d3f2005ceaf5266c966198b7f3c165bf5d7: command not found This is shown after the line that states my last login information. I am ...
6
votes
2answers
551 views

“bash -D” command doesn't seem to do anything useful

I'm finally getting around to getting more familiar with the shell after all these years. I was exploring the man page for bash and looking at the -D option, which, according to the manual: -D ...
0
votes
0answers
21 views

Change mouse speed in terminal without restarting

I used this link https://paulminors.com/how-to-speed-up-mouse-tracking-on-mac/ which has a bash line that updates your mouse speed (beyond the default maximum): defaults write -g com.apple.mouse....
2
votes
0answers
32 views

Rearrange Spaces via command line from the terminal emulator

TL;DR: I need to replace the dashboard with a terminal emulator. Hi. I need to 'rearrange spaces' so a terminal emulator gets first from the left before the desktop, where the dashboard used to be. ...
0
votes
0answers
44 views

Wi-Fi does not come on when I click the button

Right now I am connected via USB to my phone which is happy on main Wi-Fi. But my MacBook Pro (11,5 15" El Cap 10.11.6) will not power on the Wi-Fi hardware. This happened once before a year or more ...
1
vote
2answers
75 views

Spell check for macOS Terminal app?

Is there a spelling library or command line tool that can be installed to use on macOS command line Terminal app?
1
vote
0answers
35 views

Delete all backups of specific file/folder with tmutil

I am trying to delete all backups of specific items through the command line. I can accomplish this using the GUI through the following steps: Enter Time Machine Navigate to the file to be ...
2
votes
2answers
54 views

Can't open a PDF from Terminal on Mac because it ‘couldn't get a file descriptor referring to the console’

I tried to use the command: open <filename.pdf> but the message I got was Couldn't get a file descriptor referring to the console What can I do?
0
votes
1answer
117 views

How do I trigger a script when a second monitor is attached

I am on macOS El Captain (upgrading to High Sierra soon) and I'm looking for a tool which can trigger an AppleScript or shell script every time when the number of monitors/displays attached to the ...
3
votes
4answers
118 views

How can I find the “friendly name” of the operating system from the shell / Terminal / bash?

I know that I can use sw_ver to find this information: ProductName: Mac OS X ProductVersion: 10.14 BuildVersion: 18A353d …and I know I can find other things like uname can give me some types of ...
1
vote
0answers
16 views

Installing gcc twice on a Snow Leopard machine?

I have an old early 2008 Macbook that runs Snow Leopard and can't upgrade to anything better. I wanted to install a C++ compiler on it and finally stumbled across this: https://github.com/...
0
votes
1answer
24 views

bsdtar gives (Empty error message) when trying to extract an ISO

On High Sierra 10.13.6 (17G65), trying to bsdtar -xf something.iso fails with: bsdtar: (Empty error message) bsdtar: Error exit delayed from previous errors. I have plenty of disk space left and ...
4
votes
2answers
113 views

How to implement text editing features in terminal interface?

Sorry if the title is confusing but essentially what I want is to have standard text editor features like Command< to move to the beginning of the line or CommandShiftBackspace to erase a line. Is ...
1
vote
0answers
19 views

AirPort - How to put accessories on a network using command line instead of AirPort App

I have an application where my application device starts a WAC(Wi-Fi Accessory Configuration). I then use either my Mac or iPhone to put that application device on a network. In Mac, I see my ...
2
votes
0answers
34 views

mdls returns `(null)`

function ls-by-added() { # Doesn't work well for files having '(null)' as their DateAdded, which some do. mdls -name kMDItemFSName -name kMDItemDateAdded -raw -- *(D) | \ xargs -0 -I {}...
2
votes
2answers
29 views

How to check if file is in use?

I have c++ application and I need to know if one file is in use by anyone. I'm ok with running any shell command, but I don't want to run lsof command for this purpose, since I think I can't safely ...
3
votes
1answer
33 views

How to auto paste above return value on command line

I am trying to create a very simple script (.command) that will basically change my mac address.. i do know that the command: openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' will return me a ...
0
votes
0answers
41 views

How to disable CoreAnalytics (system diagnostics mechanism) used by forensics investigators

From I Know What You Did Last Month: A New Artifact of Execution on macOS 10.13 Analysts that perform macOS forensics have had few, if any, artifacts of program execution to rely on during ...
0
votes
1answer
22 views

Finding minimized apps through terminal

I would like to know how to find what apps are minimized in the dock but through the terminal? The idea is to make a script that pauses minimized apps in order to reduce memory usage but the first ...
0
votes
0answers
19 views

Make iTerm2 read profile from file, from the CLI?

I want to make iTerm have these values set: - Load preferences from a custom folder or URL - Save changes to folder when iTerm quits And I want to set them from a CLI command (no GUI, no clicks). ...
0
votes
1answer
43 views

Atom editor no longer opens from command line

I've been using the Atom editor on my iMac running High Sierra. I usually run it from the terminal by typing atom. I moved many of my apps to an external drive to free up disk space. I originally ...
1
vote
1answer
41 views

What is the equivalent of the 'gsettings' command on OS X?

Under Ubuntu it's possible to get various settings information via gsettings command in terminal. For instance, current wallpaper path can be obtained via $ gsettings get org.gnome.desktop.background ...
2
votes
1answer
604 views

Cannot run refind-install from Recovery because “/usr/bin/env: bad interpreter”

I have managed to change the present working directory to the folder containing downloaded rEFInd files. I have booted to Recovery Mode. The refind-bin-0.11.3 folder was downloaded to my Downloads ...
1
vote
0answers
22 views

Anaconda-Navigator no longer works by double clicking on icon

I use an iMac running High Sierra 10.13.5. I'm use the Anaconda distribution of Python 2.7 and 3.6. I normally opened Anaconda-Navigator by double-clicking on the application in my Applications Folder....
2
votes
1answer
66 views

Unable to launch app using “open” command in Terminal

I have recently started using Terminal.app a lot. I figured that open command will be helpful in opening files like HTML, CSS files etc. I have tried Visual Studio Code app from Microsoft. The app ...
1
vote
0answers
57 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 ...
1
vote
1answer
44 views

NTLM hash function in Terminal?

I'm aware there are a number of hash functions available in terminal such as echo "text" | openssl <hashname> or perl -MDigest::SHA -nle 'print Digest::SHA::sha224_hex($_), ":", $_'. However, I ...
1
vote
1answer
32 views

Preferences changes using “defaults” not applied

I'm a CLI enthusiast and, as such, I've been a extensive user of brew, cask, m, mas, softwareupdate and so on. I've even written some tutorials about them (check here and there). Right now, I'm ...
2
votes
0answers
282 views

brew install package asks to install command line tools from a path that doesn't exist

I messed up my command line tools. I already had them installed (and were working pretty great), I also installed the beta 2 macOS 10 version from the apple developers site because the command brew ...
0
votes
0answers
16 views

Import SSL Cert into Chrome via Command Line?

In MacOS (High Sierra), is it possible to import a custom Certificate Authority (.crt) using Terminal or over SSH?