Stack Exchange Network

Stack Exchange network consists of 175 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 [osx]

The command line and other Unix-like aspects of Apple's macOS (Mac OS X)

-1
votes
1answer
22 views

Extracting one file from multiple tar files that are within one tar file

I have a '.tar' file that contains multiple '.tar.gz' files. Within each of these '.tar.gz' there is a '.faa' file that I need. I don't want to unpack everything else. I have been searching through ...
0
votes
1answer
26 views

Specific fields from macOS Command “diskutil apfs list”

would appreciate inputs on the subject. I have the output from the macOS (High Sierra;FileSystem :APFS) command - diskutil apfs list. Sample output is given below: +-- Container disk5 1B5FE22B-6F4F-...
0
votes
0answers
14 views

OSX SFTP with Sudo?

I have been given access to a server to help with some legacy development work. The server is running RedHat Enterprise Linux 6 as its OS. To access this server, I must first SSH in with my username/...
0
votes
1answer
38 views

Can't list directory even as root?

I'm running into an odd issue on my Mac (macOS 10.14.3). I ran sudo du -xk / to get detailed data on my disk usage, and ran into several errors: du: /Users/brx/Library/Application Support/MobileSync: ...
-1
votes
0answers
18 views

I want to run libvirt on a old PPC machine on X86, but libvirt exits with cpu error

I want to play some retrocomputing. And I know Qemu can run without problem under MacOS9. With this command line the vm starts OK: qemu-system-ppc -boot d -M mac99,via=pmu -m 512M -cpu G3 -prom-env '...
1
vote
1answer
73 views

Does Apple modify the GNU and BSD tools that comes with macOS? [duplicate]

macOS comes with bash (which is a GNU tool), macOS also comes with tools like ls and chmod (which are BSD tools, even though I don't know from which BSD flavor they come from). Now does the GNU and ...
1
vote
1answer
21 views

Using terminal to zip unknown amount of packages with dynamic names

I am trying to figure out a solution for unix based systems (maxOS, Linux) to zip unknown amount of packages, ideally without requiring users to install any additional third party software. I have ...
1
vote
2answers
80 views

Using Linux Find

I'd like to find the MAIN.TXT file in a directory folder. If it is older than 24hours then output YES to the MAIN.txt file. If it hasn't been modified in 24hours then leave the file alone. I got as ...
0
votes
0answers
15 views

How to screen share/vnc from Mac (10.11) to Linux desktop (Ubuntu 16.04)? + issues sshing

I'd like to use screen sharing/I'd like to VNC to a Linux OS desktop from my Mac (so I'd like to view the Linux desktop on the screen of my Mac). Mac OS version: OS X El Capitan, 10.11.15A2301. Ubuntu ...
-3
votes
1answer
42 views

Prevent user from creating and deleting user account from his login [closed]

I want to create a non root user and is there any way/command if we can disable only two commands(useradd and userdel) for any particular user. we don't want user to create and delete any user on the ...
4
votes
1answer
96 views

How to setup simple port forwarding on macOS with pf? “Rules must be in order: options, normalization, queueing, translation, filtering”

I am trying to pass traffic from Mac A port 5800 to Mac B on port 5900 using pf. This is the intended path of travel: Client to port 5800 → Router (Yes, port forwarding is setup here) → Mac with PF →...
0
votes
0answers
20 views

cannot permanently delete Xcode.app in trash, not even if with “sudo rm -rf” because directory is not empty?

I run on osx 10.14, and I was trying to delete and reinstall xcode. I have also tried the following in safe mode but have the exact same problems. I moved xcode.app to trash, right clicked and chose ...
0
votes
0answers
13 views

How to partition free space in a Mac SSD [migrated]

I have a Mac with a 250Go SSD. I used to have a Windows partition, but as I had no longer any use for it I wanted to free up its space. My error was here : instead of using BootCamp helper to delete ...
2
votes
2answers
76 views

Is App: /bin/rm a Friend or Foe in OSX?

Bitdefender Antivirus for Mac keeps notifying me that it has blocked App:/bin/rm with the following message: An app you previously chose to block attempted to access your protected files again. We ...
1
vote
2answers
48 views

ls won't display Cyrillic characters properly

I've got a problem with Cyrillic alphabet. My terminal will display Cyrillic normally as well most of my programs the only exception I've found so far is ls. Instead of normal Cyrillic it displays ????...
2
votes
0answers
41 views

perl: warning: Setting locale failed

I bought a VPS, Centos 7. However, I was able to understand what was going on with SSH and connected to my WHM. After connecting, I get a list of errors and there is something like this: perl: ...
0
votes
2answers
75 views

Why does Apple care if macOS is officially called UNIX? [closed]

Based on my understanding, if the owners of an OS want their OS to be officially called UNIX, they must get a certification from The Open Group. macOS version 10.14 Mojave, as well as some (or maybe ...
1
vote
1answer
35 views

MacOS's counterpart to Linux's unshare(2)

Does MacOS have a counterpart to Linux's unshare(2)? I'd like for the following to fail on both systems. #define _GNU_SOURCE #include <stdlib.h> #include <sched.h> int main() { #if ...
2
votes
2answers
118 views

dirname appears not to work with xargs

xargs and basename work together as I would expect: $ printf '%s\n' foo/index.js bar/index.js baz/index.js | xargs basename index.js index.js index.js xargs and dirname, though, appear not to work ...
4
votes
2answers
192 views

Does macOS and Solaris have “capabilities”?

Linux have capabilities, which are used to give a non-root process some privileges. Does macOS and Solaris also have capabilities? if not, do they have something similar to capabilities?
0
votes
0answers
30 views

x11 forwarding not working

I'm having trouble getting x11 forwarding when I ssh into two different linux machines from a MAC operating Mojave. When I do ssh -X username@serveraddress, I get the following error appearing after I ...
7
votes
0answers
71 views

Strange case of truly invisible file (?) and undeletable directory on macOS [migrated]

I'm having issues deleting a directory on my macOS Mojave 10.14.3 system. The filesystem is APFS and these are the symptoms: $ rm -rf strange/ rm: strange/: Directory not empty $ sudo rm -rf ...
3
votes
0answers
31 views

Valid values for LC_CTYPE?

I have found a number of questions on various forums where Mac users complain about locale errors when they log in to Linux systems over SSH which complain that the LC_CTYPE=UTF-8 setting is incorrect....
0
votes
0answers
25 views

Debugging android kernel goldifish emulator under Mac OS Mojave

I need to debug android kernel goldfish under MacOS Mojave. So i cloned android-goldfish-3.18 and android-aosp-9.0.0_r22. I built aosp under macos while the kernel under debian. Obviously I built ...
0
votes
0answers
11 views

How to backup Mac image to another local partition?

I’m trying to backup my entire Mac disk over SSH, I’ve specifically partitioned the “Machintosh HD” to reserve space for my Mac. There are several “answers” floating around the web, but it all seemed ...
0
votes
0answers
19 views

Inconsistent timestamp in exFAT volume on macOS and Linux

To read exFAT volumes on Fedora, I installed the fuse exFAT package from rpmfusion repository on my Fedora computer at work. I maintain a few webapps in my exFAT USB drive so that I can work on them ...
-1
votes
1answer
45 views

Can't see the contents of a data file in terminal

I have downloaded a number of input files from the NASDAQ website (for example ftp://emi.nasdaq.com/ITCH/01302018.NASDAQ_ITCH50.gz) After decompressing (I double click on a Mac) I can't see the file ...
0
votes
0answers
21 views

Different behaviours of sudo [duplicate]

I created a file with sudo like this: sudo touch abc.txt Which understandably set the owner to root. Now when I try to edit the file via vi using sudo, it works: sudo vi abc.txt #works But when I ...
0
votes
0answers
29 views

How to access localhost on virtualbox archlinux guest machine from macOS host?

I need to be able to access localhost from host machine (macOS) on Arch server (guest virtualbox machine). I was able to edit /etc/hosts to access localhost on guest machine via IP:port on browser ...
0
votes
1answer
60 views

tmux not working with Bash [closed]

I am using macOS with tmux downloaded from source and Homebrew. When starting tmux both times I installed it, it gives me a blank screen with the bar at the bottom. I can use tmux commands but a bash ...
2
votes
1answer
66 views

PID full path to executable in macOS Mojave

ps axww -o command This command gives me the "command" used to run the process. It also includes the "path" to the executable. I need ONLY the path. The problem is it also includes arguments with the ...
1
vote
3answers
40 views

“==” logical operator and zsh version 5.7.x (installed using Homebrew)

Been getting errors on my scripts when using this operator. I've some online documentation and double equals should supposedly work. Any ideas? Zsh reference guide: http://zsh.sourceforge.net/Doc/...
1
vote
3answers
43 views

move files from subdirectories to current level and rename if exist

since I'm on a mac, the mv is a bit different which doesn't support the --backup attribute, the best I can come up with is find . -mindepth 2 -type f -print -exec mv {} . \;
0
votes
1answer
18 views

Disable Ethernet connection on Mac terminal

I am trying to write an alias for disabling ethernet connection and use the wifi using a command line. I can't access stackoverflow.com and other sites using ethernet due to corporate policies. Is ...
0
votes
1answer
55 views

How can I set the default editor as nano on my Mac?

I have vim as default editor on my Mac and every time I run commands on Mac terminal, it automatically opens "vim". How can I set up "nano" instead and make sure the terminal will open "nano" every ...
0
votes
1answer
35 views

conversion of date into seconds in unix

I have a requirement where I will be give the time in below format 2019-02-08T19:24:30.220Z by this I need to output number of days between the given date and present date. given date = 2019-02-...
3
votes
1answer
81 views

Can bash read the “Date Added” of a file/directory?

With programs like stat you see access, modify and change, but with Finder on macOS there is a "Date Added" field. Can I get the "Date Added" for a file or directory displayed in the Terminal, like ...
1
vote
1answer
43 views

Bash and Sudo forking continuously, hidden fork bomb?

I am experiencing a frustrating problem where my bash and sudo programs seem to be replicating thousands of processes on Mac. I have searched for all kinds of ways to stop them. I don't know what to ...
0
votes
0answers
25 views

How do I extract only certain parts of ffmpeg's standard output as it processes a file?

I want to enter a command that only shows these two lines of ffmpeg's output and I want to see it as it processes a file: from 'input_file.mkv': frame=172534 fps=4622 q=-1.0 Lsize= 8319963kB time=01:...
0
votes
1answer
26 views

Add lines if they are missing from a data series

I have a data gathering device which records 5 attributes of data per second. The first column of the data is the time elapsed, in seconds, and is always sequential ie n+1. Data fields are comma ...
0
votes
1answer
38 views

Add a line if it's missing

I have a data gathering device which records per second. Sometimes, randomly it drops a second or more. For example 166,1.09424,240,76,132 168,1.10088,215,76,132 169,1.10765,213,78,131 170,1.11458,...
0
votes
2answers
26 views

delete folder for all users on Mac

I'm using below command to delete folder rm -rf /Users/*/Library/Group\ Containers/UBF8T346G9.Office/User\ Content.localized/Templates.localized/ The command is working only for single user. I want ...
1
vote
2answers
37 views

Redirect specific error in stderr

So I want to use an if statement to run a script to import some functions. $ cat functions.sh #!/bin/bash sampleFunction(){ if [[ ! "${fakeVariable}" == '2' ]] then read -n1 -r -p "...
0
votes
1answer
27 views

Use same compose keys of OSX on Arch

I use a apple keyboard and really like the way OSX handle insertion of special characters, for example: <Multi_key> + c then c gives ç <Multi_key> + e then e gives é <Multi_key> + ...
3
votes
3answers
472 views

How do I redirect output of command into ls? [duplicate]

I have a problem with redirections : $ which python3 gives me /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 and $ ls -l /Library/Frameworks/Python.framework/Versions/3.7/bin/...
6
votes
3answers
762 views

cp works differently on a Mac

I have the following code to copy an entire folder: #!/bin/bash B="H:\pdf2txt" DST_DIR="H:\Test_Folder" cp -r "$B" "$DST_DIR" This works as expected on a windows machine but when I change it to ...
1
vote
2answers
37 views

Get the SuperPage size

It appears that some BSD systems have a superpage size of 2MB while others have 4MB. I've not seen any others. Is there any way to tell what the available superpage size is? Ideally from the command ...
0
votes
1answer
19 views

Open pdf as tab in running instance of xpdf

I am really fond of xpdf but would like to have a tab-based workflow. If I open a pdf with xpdf file.pdf and then open another pdf with xpdf file2.pdf the scond file is opened in a new instance of ...
0
votes
1answer
65 views

Can openssl convert SSH public key to a PEM file without private key?

So I've seen many many posts on how to do the conversion with private key; but does anyone one know how I can do this with just only public key? As I'm trying to convert someone else's public key. Or ...
1
vote
3answers
100 views

Checking server is listening without telnet, from CLI?

Typically an easy diagnostic approach to checking an application server is running is to run telnet again the host and port: telnet somehost port The issue is that some operating systems, such as ...