I know how to create a symbolic link but I don’t kow how to get largetst file in current directory. Please, help me! Answer You can do it with the following command: which breaks down as follows: find /path/to/dir-with-big-file/ -type f -printf “%st%pn” – find files and print %s files size and %p name. sort -n -r | head -n
Cross-Platform Installer paths
I’m writing an installer for a Python app I’m making, and needed to have paths for different file locations. These are what I have so far, and so wondered if these were correct of if I should change any of them (particularly the Linux/macOS ones) I have a path for: the actual binary for the config file the README the
How can I combine the commands leave and say?
Is there a way to make use of the command leave and the command say (MacOS) to be notified by the built in voice system? I can do echo hello | say on the command line. leave outputs Time to leave! how can this output be piped to say once it appears? When I issue this command it’s just hanging.
Why are PATH args to subprocess.run() not portable between Linux and MacOS?
I’m having difficulty with portability between Linux and MacOS with the subprocess.run() method. On Linux, a command like below works just fine as long as someCommand is in my PATH (set in ~/.bashrc). However, on MacOS, the same command does not run, even though someCommand is in my PATH. Instead, I get an error like: There are many other answers
npm ERR! code EACCES， npm install –global yarn met error
Mac mini (M1, 2020) Monterey Brownie v1.17.2 nodejs v16.13.4 I am learning solidity according to reference(https://www.youtube.com/watch?v=M576WGiDBdQ&t=25510s). Node.JS install is fine when I tried this the terminal give the error information I checked the owner of the file ,the owner is root ,should i use sudo? find this thread (Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’),changed the owner , stll one file
Prompt Expansion ZSH Remove Hostname if entire PROMPT is too long
Currently, my zshrc looks like this influenced by this question and my other question what is currently working as expected it truncates the hostname and the username to constant values it dynamically truncates the entire PROMPT based on widthHelper() which allows me to resize my terminal and dynamically truncate the PROMPT Currently, I have this line working but not in
How to adapt to Linux terminal back color in .NET 5/6?
We have a .NET 5 console application that runs on Windows/Linux/Mac. Our console application relies on the classic fore color scheme to highlight info/warning/error in console with fore colors gray/yellow/red. However we cannot gather the terminal back color as explained in Console.BackgroundColor documentation: Unix systems don’t provide any general mechanism to fetch the current console colors. Because of that, BackgroundColor
Cross-platform method to detect whether /dev/tty is available & functional
I have a bash script from which I want to access /dev/tty, but only when it’s available. When it’s not available (in my case: when running my script in GitHub Actions) then when I try to access it I get /dev/tty: No such device or address, and I’m trying to detect that in advance to avoid the error and provide
How to quickly rename my files on macOS or linux from CLI?
Here’re my source files. I need to figure it out a way to rename all the files to remove the first 36 characters up to _file or replacing as something else. I am expecting all the files are as below. Thanks in advance! Answer You can use rename like this: If you are on macOS, you can install rename with
How to check password on macOS?
The following C program can check the password of a user on Linux. But it does not work on macOS because some functions are Linux specific. Could anybody show me how to revise the program so that it works on macOS? Answer Both Linux and macOS use PAM for authentication; Linux uses Linux-PAM, and MacOS and BSDs OpenPAM. To authenticate