Skip to main content

All Questions

Tagged with
0 votes
0 answers
158 views

MacOs equivalent of adding a user to the linux dialout group on for permissions setup for UART communication

I'm working on a project where I'm interfacing with some hardware and want to monitor the data from some sensors using a specific tool. The tool doesn't have official support for MacOS but I've ...
sobbingDev's user avatar
0 votes
0 answers
28 views

switching window keyboard shortcut with screen window management on MacOS

all I used to be a linux user, now I am accessing a server from MacOS, Ventura. I have remapped my Mac Keyboard by switching the ctrol and command keys. However, I came across some problems with the ...
FewKey's user avatar
  • 101
2 votes
1 answer
1k views

Command Line decryption of aes-256-gcm no-longer working after OpenSSL updated

Late last year (2022) I encrypted a file using OpenSSL using terminal on my Mac with a very simple openssl enc command and was able to decrypt using this command: openssl enc -d -aes-256-gcm -in ...
bakslaash's user avatar
0 votes
1 answer
45 views

running a multi-threaded script on a macPro to a smb-mount folder throws an error

We're trying to run a multi-threaded script from our macPro but we keep getting an error massage. The xml script contains parameters to run a specific tool, the paths to the raw data and other ...
Assa Yeroslaviz's user avatar
2 votes
0 answers
118 views

How to source from stdout for both Linux and macOS?

On Linux I can do: source <(cat .env | grep ANDROID_GRADLE_TASK) But on macOS, this doesn't do anything (no error, and no source) What can I use for macOS? Is there a command that works both on ...
Dimitri Kopriwa's user avatar
0 votes
1 answer
712 views

"echo $VAR | base64 -di > file" fail to execute on MacOS

On Linux I can do: echo ${ANDROID_KEYSTORE} | base64 -di > android/keystores/staging.keystore But on MacOS, the same commands gives: base64: option requires an argument -- i Usage: base64 [-hvDd] ...
Dimitri Kopriwa's user avatar
0 votes
1 answer
597 views

Open unity application via command line wih application's graphics off

On Unity documentation we can see there is a way to run a standalone player via command line without the graphics by typing -nographics I'm using the following command on a mac terminal, but it is ...
Jas's user avatar
  • 101
0 votes
0 answers
100 views

Unable to redirect `coproc` streams using FD 5 and 6, but not 3 and 4. Why?

On OSX, while attempting to expose a service implemented as a bash script, and started with coproc, to a client implemented as a bash script, by passing the IO streams of the service to the client, I ...
Christopher King's user avatar
0 votes
1 answer
2k views

What does this rm -r command do in following usecase on mac terminal?

First I'm directing to the destination folder by below command cd /Users/myname/MyFolder/ Now I'm using below command here, what does this command will do? rm -r ../build ../dist rm command is for ...
Devender Kumar's user avatar
5 votes
1 answer
3k views

What is the “-o” argument in find command?

I am currently running this command: find . \( -type d -name .git -prune \) -o -type f -name "*"` on my macos shell. I found the command in a Stack Overflow thread for another problem. I do not ...
Gaurav Srivastava's user avatar
0 votes
1 answer
235 views

Replace files recursively

I have a deeply nested directory called MyProject which contains dozens of git repositories. Each of those repositories contains, somewhere, a directory called utils which contains a file called ...
j_d's user avatar
  • 123
0 votes
1 answer
176 views

Moving files to matching folders on linux command line

I would like to copy or move files in to matching folders. these are my filenames: 1-filename-aa.txt 2-filename-aa.txt 3-filename-aa.txt 1-filename-bb.txt 2-filename-bb.txt 3-filename-bb.txt these ...
cnknv's user avatar
  • 1
0 votes
1 answer
209 views

Anaconda stopped working when added DYLD_LIBRARY_PATH to bashrc

I am using Anaconda Navigator version 1.9.7 on macOS Mojave 10.14.5. I found that most anaconda-navigator, pip, ... commands stopped working when I added the following command to .bashrc. export ...
Kernel's user avatar
  • 101
0 votes
3 answers
4k views

how can I get the yes command to force overwrite and to do so with new lines?

I would like cp to prompt before overwriting so I am using -i. (I might sometimes use an alias for cp, or similar, so cp always occurs with -i). I may want to say overwrite all. I know that's the ...
barlop's user avatar
  • 24.3k
1 vote
1 answer
580 views

How to copy a nix-env profile using nix-copy-closure?

I am using nix-env with multiple channels and local overrides to install packages on macOS and Nixos Linux on multiple computers. Sometimes I exclude packages from updates, because of problems. All ...
jmg's user avatar
  • 111
0 votes
1 answer
58 views

cp matching files in CLI on OSX with path slightly modified

I am trying to find a command that finds and copies files with a given name to a another folder but with a slightly different path. For e.g. there are 4 copies of PNG files named ic_arrow.png app/...
Bootstrapper's user avatar
1 vote
1 answer
409 views

Matching multiple path-components with `find`

Let's say I want to find all the node_modules folders in my Code directory: find ~/Code -name 'node_modules' -type d But what if I want to find all the setup folders, that themselves are inside test ...
ELLIOTTCABLE's user avatar
  • 2,535
2 votes
1 answer
3k views

Long form command line flags in Terminal?

I hope this is the right place to ask this question. So basically, I'm currently combing through some of the more commonly used Terminal commands, and I find it really hard to remember the short form ...
Baggio Wong's user avatar
1 vote
1 answer
382 views

Output of du command

I have a folder and it is 16.91GB in size(I checked in Finder). I tried to check the size by using du command. So, I tried du -sh ~/folder and I got 16G. I thought I will get the output in Bytes ...
SkrewEverything's user avatar
17 votes
3 answers
22k views

How to force ls terminal command to show results in Bytes while I have set the default to ls -h in bash profile?

I am following the snippet here to improve my terminal command in Mac OSX. It sets the default value of ls results to human-readable by exporting alias ls='ls -GFh' to bash profile file. This is very ...
cybergeek654's user avatar
9 votes
3 answers
78k views

How to run a bash script via absolute path?

I have a file: /Users/danylo.volokh/test/test_bash_script.sh Content is very simple: #!/usr/bin/env bash echo "-- print from script" I'm in folder "danylo.volokh" This command runs fine: Danilos-...
Danylo Volokh's user avatar
0 votes
1 answer
1k views

Alias command from terminal that opens a new terminal on a specific folder

I have this command already working in my .bash_profile: alias mysite='cd /Applications/sites/mysite;pwd; php artisan serve --port=9000 | open http://localhost:9000 | open -a Finder ./' So it: CD's ...
Francisco Caviano's user avatar
1 vote
1 answer
2k views

Command line for Application alias in Mac OS X

I’m working on an installer for a project and I’ve written a post-install script that runs the executable for my project after it’s done. I want to know the command line argument—or if there is a way—...
cb92's user avatar
  • 11
8 votes
3 answers
571 views

How to have a better view when typing out directories in terminal?

I am currently using a Mac and learning to use the terminal, but the question applies to Linux systems as well. I would like to ask, when typing out paths in the terminal/command line, is there a way ...
user1367903's user avatar
2 votes
3 answers
10k views

How to switch between command-line and GUI in VM on a Mac?

I have installed CentOS 7.1 in VMware Fusion of my Mac. I logged into the terminal (default runlevel 3) and started the GUI using the command "startx". I want to switch back to the terminal. Ctrl+Alt+...
user1897373's user avatar
0 votes
1 answer
88 views

diff style comparison of directory contents against line by line contents of text file

Unlike many of the file and directory comparison utilities out there, including diff, I've only seen literal file to file (sometime, more than two files) and directory to directory comparisons. I'm ...
TryTryAgain's user avatar
1 vote
1 answer
964 views

Terminal new window always shows -bash: Searching: command not found

When open terminal, it always shows -bash: Searching: command not found. It does not affect other functions, just each time, even though open a new terminal window, it still pops up at the top of the ...
CarolineGao's user avatar
2 votes
5 answers
406 views

How can I convert all “x”s to “y”s in filenames for a specific directory from the command line?

I have been naming files, of out habit as a programmer working on a server command line, with underscores “_” rather than spaces “"—because from the command line you have to escape spaces—but that is ...
J.Todd's user avatar
  • 159
1 vote
1 answer
360 views

How to get different prompt look for root and regular user

My .bash_profile has different styles of prompt for regular user and root but in order it to work the .bash_profile should be reloaded every time I switch users. How can I achieve this? Can I make ...
drew1kun's user avatar
  • 2,167
2 votes
2 answers
6k views

OSX bash command line countdown timer

I found here on superuser the following nice countdown script that I could include in my .bash_profile: function countdown(){ date1=$((`date +%s` + $1)); while [ "$date1" -ne `date +%s` ];...
Tim's user avatar
  • 175
3 votes
1 answer
4k views

Adding more than one image as album art to mp3 via command line

I want to add two images (front and back cover) to my converted mp3s. At this time I convert all my WAVs with lame, then I convert the ID3 tag version from 2.3 to 2.4 via eyeD3 and then I will add two ...
UsersUser's user avatar
  • 423
2 votes
1 answer
4k views

mac how to run a command in a different tab/window of a terminal

In Windows, I can run any program from the command prompt by typing c:> start startup.sh and windows will run the startup.sh in a different command prompt(terminal) window. How can I do the same ...
anjanbacchu's user avatar
  • 1,407
28 votes
7 answers
111k views

What is the terminal command other than ctrl + c to exit a running Node.js program in a macOS?

In Linux terminal if I run a command like: $ node httserver.js The command runs and by doing ctrl + c the program is terminated and new line comes in terminal for us to enter a command. I felt ctrl ...
Sagi_Avinash_Varma's user avatar
0 votes
1 answer
2k views

Direct errors in find to /dev/null by default

On my OSX command line, find directs errors to STDOUT. I find this very inconvenient, and I also find it annoying to add 2>/dev/null to the end of the command every time. This brings up several ...
cwallenpoole's user avatar
1 vote
1 answer
345 views

Unclear on making sense of all the command-line-interfaces (CLI)s out there, and when/why to use them

Some background, I am making the mental effort to start using command line interface for all my work, on Windows, Mac OSX, and LINUX systems. It is true that we have a lot more flexibility in the ...
TheGrapeBeyond's user avatar
0 votes
1 answer
428 views

Set ENV variable for all commands in current directory in mac os

Is there a way to run all commands in current directory with some ENV variables predefined? Example of what I need: I put some file, say .env in my directory, with: export SECRET='abcd123' Then I ...
mikdiet's user avatar
  • 101
0 votes
1 answer
38 views

Is there a way to determine the IP address from which a uri was served from a mac/linux box?

I have a few servers behind a load balancer and I want to know which one is servicing a particular request. $ ping website.com only tells me the ip address of the load balancer. Is there a way I can ...
user784637's user avatar
  • 2,065
0 votes
0 answers
88 views

list all the information of a process under commandline in osx or linux

Is there any command to list all the information associated with a process, include all parameters in PS command, open files and ports and so on? Thanks!
linjunhalida's user avatar
7 votes
1 answer
2k views

OS X terminal - put flags/options at end of command?

Is there a way on OS X to put flags at the end of a command instead of at the beginning? On my Ubuntu box, either of these will work, but OS X treats -la as a directory argument in the second example: ...
jjt's user avatar
  • 381
59 votes
3 answers
141k views

What is the equivalent of the Linux command "sudo fdisk -l" in MacOS?

In Linux, the command sudo fdisk -l produces an output that lists all the disks and partitions in the computer. Here is an example: If I try to use sudo fdisk -l in MacOS X 10.7.5, the output is the ...
Vito Gentile's user avatar
3 votes
0 answers
1k views

Gnome 3 copy/paste with a Mac keyboard

I want to use a Mac keyboard in Linux with Gnome 3. What I essentially want is to have Cmd/Ctrl keys behave like in Mac: do all copy/cut/paste, window switch and etc. using Cmd key but in Terminal ...
Tair's user avatar
  • 131
1 vote
1 answer
3k views

Map `php` at the command line to point to `/usr/bin/php`?

For some reason using php at the command line references /usr/local/bin/php instead of /usr/bin/php. How can I make $ php script.php the equivalent of running $ /usr/bin/php script.php? Current ...
Ryan's user avatar
  • 425
1 vote
3 answers
4k views

Rename recursively files, while keeping the extension

I have a bunch of directories that each hold one *.txt file in it (and other non *.txt files). I'd like to rename those files recursively from the command line, basically *.txt to info.txt. So all *....
Hanzaplastique's user avatar
8 votes
6 answers
3k views

In Bash (Mac/Linux terminal shell), can the up and down arrow keys be made to function as they do in text editors?

In text editors, if I press the up and down arrow keys, it moves the cursor between lines of text. In Bash, if I’m typing a long command that spans multiple lines and I press the up and down arrow ...
Frungi's user avatar
  • 215
4 votes
1 answer
4k views

OSX / Unix: move odd or even numbered files

I have a folder with a range of numbered files (camera images) and I'd like to move every other image into a different folder, so either all the odd numbered images, or all the even ones. How can I do ...
Jamie's user avatar
  • 143
5 votes
2 answers
14k views

How do I compress multiple files into one archive using lzma?

Looking at the options of xz and lzma, I can't for the life of me figure out how to compress multiple files into one archive. I know it is possible because I've uncompressed a .lzma file and it opened ...
jackcogdill's user avatar
3 votes
2 answers
6k views

Using ffmpeg with decimal wildcard

I have a folder with PNG images of the following naming scheme: IMG_0423.png IMG_0424.png ... IMG_0509.png I would like to make an MP4 movie from these images, but I get an error message that ffmpeg ...
Alex Reynolds's user avatar
33 votes
4 answers
16k views

Replace OS X's shell commands with the linux versions?

The commands available by default in the Terminal in OS X, don't seem to behave like their linux versions. How can I replace all of them with the actual GNU linux commands? For example sed -i ...
TheOne's user avatar
  • 1,395
3 votes
2 answers
2k views

Command-line interrupts in OS X vs Linux

Occasionally, when I'm developing on my Mac, I'll get a process that hangs. When that happens, I'll try the following: Ctrl + C in the active terminal window If nothing happens, I'll open a new ...
Yarin's user avatar
  • 406
24 votes
6 answers
32k views

Command line tool to identify audio file specs

I'm looking for an audio file equivalent to ImageMagick's identify command. For example, with identify, I can get brief information about a bunch of images: % identify b* banner1.jpg JPEG 134x614 ...
Doug Harris's user avatar

15 30 50 per page