Questions tagged [macos]

macOS (previously "Mac OS X" and "OS X") is the Unix developed and distributed by Apple Inc. since 2001.

Filter by
Sorted by
Tagged with
0
votes
2answers
17 views

Proper way to trap in zsh script

I'm having trouble getting a trap function in a shell-script to work without exiting the shell. I have a simple countdown timer that I want to be able to interrupt using ^C, and when I do I want the ...
0
votes
0answers
9 views

DHCP connection times out during Debian Buster [armhf] Network Install in VirtualBox on Mac OSX

I'm trying to do a netins of Debian Buster (armhf version) on a virtual machine with a Mac OSX host. I'm using a bridged adapter on en0 (Ethernet). At boot time, the link-up works on net0 but hangs ...
0
votes
0answers
15 views

Updating to Python 3.7.6 on Mac Terminal, issue with setting path

I am new to bash and I was following this guide to update python to a specific version that I want (3.7.6). I followed the recommended section on the proper way to update; using pyenv. It was fine ...
0
votes
2answers
55 views

Unable to connect to Samba Share running in Linux Server from MacOS

Ladies and Gentlemen, I was hoping someone here could guide me in the right direction regarding the problem I am facing. I have literally tried all possible options in the internet forums with no ...
0
votes
1answer
37 views

bash alias that emulates Finder's archive with ditto?

So I find it useful to have a function defined in my shell such as the following: zip() { ditto -c -k --sequesterRsrc --keepParent "$1" "$1.zip" } How would I extend this to take any number of args ...
0
votes
1answer
16 views

curling ESP8265 status Is:no such file or directory

I'm on OSX Mojave 10.14.6 I'm a trying to flash a newer firmware via OTA on an ESP8265 SoC embedded on a smart switch. I created a network with specific SSID and PSW. The ESP is connected to the ...
0
votes
2answers
37 views

How to convert date string to milliseconds in mac os shell?

I have the following date string 2020-01-17T06:41:48.000Z. I would like to convert it to such as 15810232300 which is milliseconds type in mac os shell. How to achieve it?
1
vote
0answers
35 views

Why is zsh ignoring my -f switch when removing files? [duplicate]

I just moved to zsh from bash on my mac, i hope this is the right place to ask. Works great, although I've noticed that if I run rm, for example rm -rf my directory I always get a prompt asking me ...
0
votes
0answers
39 views

Zsh: complete the files in current directory no matter what command is

For example, when I just want to make cfiles without makefile: $ make a<tab> a1.c a2.c a3.c ... but seems that zsh would detect the command then completes nothing when I hit tab. It works ...
10
votes
6answers
4k views

How do I delete a directory that contains only '.' and '..', but rm says is not empty?

These two files are artefacts of Office 2011 that are preventing removal the 'Contents' directory. How do I delete these? sh-3.2# ls -l -a total 21496 drwx------+ 15 Beef staff 480 Jan 14 23:...
0
votes
1answer
25 views

How do I grep to a file without grepping the file that I am creating?

I've just run this command: grep "WindowsIdentity" -r . > windowsid.txt I was expecting it to grep and then output to a file. However what is happening is it's grabbing it recurrsively.
3
votes
6answers
193 views

Using awk to extract a string between different characters

I'm attempting to write a bash function that gets the UUID of a VirtualBox VM. I'm pretty new to awk so I'm trying to focus on learning how to solve the problem using it. I'm aware that I can use sed ...
1
vote
1answer
29 views

Upgrading from Python2.7.12 to Python 3.8.1 on macOS 10.15.2 Catalina in Wing IDE Shell

There are many threads online about making this upgrade. However, most people say not to remove the old Python2 - this can mess up the macOS on your system. I've thus installed Python3.8.1 (I needed ...
0
votes
1answer
54 views

How create a folder owned by specific username & groupname?

In mac groupadd command does not work: After $ sudo mkdir -p /a/b, a$ ls -l total 0 drwxr-xr-x 2 root wheel 64 12 Jan 09:46 b a$ pwd /a a$ a$ a$ uname -a Darwin user01vl 18.7.0 Darwin Kernel ...
0
votes
1answer
18 views

shared home with Mac OS

I have ubuntu (actually pop_os) and mac os on my laptop. To not get it too messy, some of my folders like documents, movie, music are used by both systems. The problem I encounter is due to the ...
0
votes
2answers
16 views

List of all interfaces in my mac laptop

Below is the machine: $ uname -a Darwin whatever 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec 1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64 $ In ubuntu, ip addr or ip a gives ...
0
votes
1answer
98 views

Empty Screen Launching Chromium-Browser Over X11 from Ubuntu 16 to OSX XQuartz

Empty Screen Launching Chromium-Browser Over X11 from Ubuntu 16 to OSX XQuartz When trying to launch chromium-browser over ssh -X X11 from an Ubuntu Server to an OSX XQuartz client, I get the below ...
-1
votes
1answer
33 views

rsync completed in both directions, but size of directories is different. How it's possible?

I want to sync 2 directories (/src & /dst) to mirror all the files in both of them. Here is a steps: sudo rsync -vaP --stats /src /dst -> completed without errors sudo rsync -vaP --stats /dst /...
1
vote
1answer
9 views

Getting error when using FILTERING in a Window on top command

Trying to filter results of top command by Filtering in a Window, pressing o then typing filter, like described in a tutorial here: http://man7.org/linux/man-pages/man1/top.1.html but when I typing ...
0
votes
1answer
22 views

what `foo=bar programname` means [duplicate]

While developing a React app, I needed to use some environment variables. The way to do it is by using this syntax: REACT_APP_NOT_SECRET_CODE=abcdef npm start see reference My first question is: ...
0
votes
1answer
34 views

How can I ran nmap script on a Mac OS X?

I've installed nmap in my Mac OS X tried. I'm not on Linux, I couldn't find the script directory. I ran sudo nmap -sV --script vulners 69.164.220.111 Password: I kept getting Starting Nmap 6....
1
vote
0answers
31 views

sudo: unable to initialize PAM: No such file or directory after editing pam.d

I was playing around with the pam.d file in nano and for some reason along the way I lost root access. Whenever I try to use the sudo command, I get an error like this: [redacted]@[redacted] ~ % sudo ...
2
votes
1answer
27 views

How to trace and print out all files that are accessed / used when bash starts?

I'm having a problem and need to print out to the console all files that are being access each time bash is executed on macOS. Is there a relatively easy method for doing this? Perhaps dtrace might ...
0
votes
1answer
64 views

Is there anything similar to CrystalDiskMark for UNIX?

If you're shopping for an SSD, you've surely seen one of those screenshots from CrystalDiskMark with a few green squares, and the 2x4 matrix with results of doing read/write tests for the given ...
1
vote
1answer
55 views

List files a command opens? lsof is too slow

Is there some utility, that I can run a certain command A "within", that lists all files A opens while executing? I run a utility (A) that changes some password requirements and something is broket. ...
6
votes
2answers
391 views

zsh: `source` command doesn't reload functions

(This is on MacOS with zsh 5.7.1) Here is how I load custom functions in zsh: # Custom functions fpath=($HOME/.zfunc $fpath) autoload -Uz mackupbackup autoload -Uz tac autoload -Uz airplane autoload ...
0
votes
0answers
32 views

How to run a Dockerfile with elevated privileges?

I have a Kafka instance running on my local machine (macOS Mojave) and I'm trying to have a Docker container see that. There are two files in the Java program that will be built as the Docker ...
0
votes
1answer
12 views

Configuring Sublime symlink

GOAL Invoke sublime from the OSX BASH command line with the same Ubuntu command: subl filename.txt shall open filename.txt in Sublime. DETAILS My instance of Sublime: /Applications/Sublime\ Text....
0
votes
1answer
45 views

On macOS, how do we remove the past commands history from Terminal > Shell > New Command?

We want to remove the list of commands that were run in the past in the New Command window. It is the AutoFill or AutoComplete history of commands. To see them, follow these steps: Launch Terminal ...
0
votes
0answers
41 views

rsync command not found

I am a total novice that is attempting to use rsync to back up my photos stored on my Macbook Pro. After following the instructions from some excellent Youtube videos, I finally had it up and ...
0
votes
1answer
59 views

Why does curl -n fail in one script but not others?

Why does curl -n fail in one script but not others? curl 7.67.0 running on MacOS High Sierra The following code in one script: host="ftp.xxxxxx.com/public_html/" /opt/local/bin/curl -n -T $file $...
0
votes
2answers
82 views

Can I remove all non-zsh related shell files on Catalina since bash is being deprecated in favor of zsh?

macOS will be using zsh moving forward and we can set zsh as the default shell in Catalina which I have done. With Catalina is it ok if I remove all traces of bash and oh-my-zsh since zsh is now the ...
0
votes
1answer
19 views

Cannot access ubuntu docker container

How do I access a docker containers web interface. I pulled down the latest ubuntu container with docker pull ubuntu. I then did docker run -it ubuntu bash and installed the python dependencies to run ...
0
votes
1answer
78 views

How to install cgroups on Mac OS

How can I install on my ordinary MacOS (Darwin Kernel Version 19.2.0: Sat Nov 9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64 i386) the Control Groups tools (tools to control and ...
0
votes
0answers
27 views

How to change geometry and font of Terminal on macOS?

We can start xterm with specific size and font dynamically with xterm -geometry ... -font ... How can we do the same for Terminal on macOS?
0
votes
0answers
33 views

Unauthorized device is connected to my terminal [duplicate]

I connected my MacBook in a public cafe network at around 15:24 and when I opened terminal at 16:36 I saw that the terminal said "deniz@Galaxy-A70 - %" where it normally says "deniz@MacBook Pro - %". ...
1
vote
0answers
24 views

Starting a WM on login with a macOS

I'm new to Apple/macOS and come from Linux where if I wanted to start a different WM I would just drop into a terminal and change my .xinitrc, or change the config for the display manager. I'd like to ...
1
vote
2answers
45 views

Why does finder and terminal report different file sizes for files and folders?

Looking at a folder within Finder on macOS High Sierra, it is telling me that the size of the folder is 8.14GB, whereas running the command du -hsx Pictures/ it is saying that the size of the folder ...
0
votes
0answers
30 views

Hyphens being replaced by colons on folder names

We are currently experiencing an issue in our Freenas SMB server where some of the folders that contain hyphens are being renamed with colons on it. This causes the folder names to be random ...
0
votes
1answer
65 views

How to install Linux free command on Mac terminal?

As the title says, I need to use the 'free' Linux command on macOS. I installed Homebrew but I cannot figure out what package I need.
3
votes
0answers
22 views

How to replace osx with Linux

I tried searching for this answer but the only one I would was from 2012 and surely things have changed since then. Anyway, I inherented an iMac from my Dad when he upgraded to a MacBook Air. I'd ...
3
votes
1answer
50 views

Change directories verbosely?

I am logging every action performed in a bash script to a logfile. I would like to have cd verbosely change directories so I can record the output to the log. Kind of like this: iMac:~ leetbacoon$ ...
3
votes
1answer
144 views

When I create an account from command line, I cannot login to the account using the login command

I want to create some accounts on a macOS system that don't have a home directory or an icon on the login page sudo dscl . -create /Users/hiddenuser sudo dscl . -create /Users/hiddenuser UserShell /...
0
votes
1answer
67 views

Setting PS1 on macOS Catalina causes Terminal prompt to overlap itself when window is resized

I've set PS1 in my .bash_profile, and while the colors work I get awful word wrapping and weird line behavior when I resize my Terminal window size. Here is my .bash_profile: [[ -s ~/.bashrc ]] &...
0
votes
0answers
19 views

Call application in Javascript code - MacOs

The script below is a handler which will be embedded into an MacOS applescript script 1) I tried to add a call command in the below code, as I wanna have scrolling in a specific application. ('call' ...
0
votes
1answer
40 views

NTFS-3G cannot on macOS catalina: MFTMirr does not match $MFT (record 3)

I have upgraded my macOS from High Sierra to Catalina, which, I think, causes for me to have following error. Is there any way to fix this error? $ mkdir /Volumes/FOLDER $ sudo /usr/local/bin/ntfs-3g ...
0
votes
2answers
43 views

Find directory inside subdirectory using macOS terminal

I want to find a directory x inside a particular subdirectory y using the macOS terminal, but I do not know the directories preceding y. This command - find / -type d -name "x" works for finding x, ...
0
votes
0answers
95 views

Permission denied from “sudo rm -r FileDirectory/File” on MacOS

I'm using a managed Mac and want to remove certain directories and applications. I have tried to do it in the following way: sudo rm -r FileDirectory/File But this did not work. Here is the output: ...
1
vote
0answers
58 views

PATH setup in Zsh in OS X

I have the following in my notes from some research that I did in Zsh in OS X in the past. Between ~/.zshenv and ~/.zshrc, OSX seems to call /etc/.zprofile which calls path_helper, which itself ...
0
votes
1answer
54 views

rename fastq.gz file name

I have hundreds fast.gz files, and they have the same format of file name: 5809029_GWU_DNA_269_L001_R1_001.fastq.gz 5809030_GWU_DNA_269_L001_R1_001.fastq.gz How do I change the first and the second ...