New answers tagged

1

The typical way to do this on Unix-based system is to combine find and touch find path/to/top/directory -type f -exec touch -t 0601120101 '{}' + path/to/top/directory: top directory to start search in, its content and all subdirectories will be searched. You can add several if required type -f: only find files. If you also want to touch directories, just ...


0

The app A Better Finder Attributes is the app you should try. It has a free trial so you can see if it works for you. Disclaimer: I have no financial or other ties with the developer of this application. I am a satisfied user.


0

On one of the articles I’ve mentioned shows a command (sudo rm -rf /private/var/log/asl/*). I ran this and reboot. It worked ! I'll update this if the problem returns! Thank you all!


1

scutil talks to the System Configuration daemon, configd. Some of the info it deals with isn't stored anywhere (except in RAM), because it relates to the live state of the computer. The part that does get stored is (at least mostly) in the /Library/Preferences/SystemConfiguration/ directory, especially the preferences.plist and NetworkInterfaces.plist files. ...


0

As a heads up to anyone, you must use full path names. This wasn't immediately clear to me, as I felt I could symlink relative paths in a folder that I was running the command inside. I could be wrong (I'm a macOS novice). For example, if I try to symlink my Pictures folder inside of my Downloads folder, while cd'd in my user home directory, this will not ...


11

Something like touch index.{js,css,html} should work. Which of course can then be turned into a shell function with miracle() { [[ "$1" ]] && touch -- "$1."{js,css,html} } The test ensures that the files only get created if a name is passed as an argument, the touch -- ensures that miracle -foo doesn't lead to an error. and ...


1

With the help of this answer I solved it using these commands curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash Then I edited the file by running vi ~/.zshrc and added following part to it if [ -f ~/.git-completion.bash ]; then . ~/.git-completion.bash fi Then I did run source ~/.zshrc ...


0

If you want to do this entirely in Finder, you can create an Automator service and run it as a Service through the right-click menu. open Automator.app New > Service Service receives selected "Image Files" in "Finder.app" add Utilities > Run Shell Script enter the script shown below (include the trailing newline) Save as "...


0

Typically this is a dot file causing the shell to hang. Make a new account and log out of the old one - log in to the new and open the shell. If it hangs, too - you have system level configuration files to blame in most cases. Reinstall the OS if you can’t Seuss that out. If that works fine, then su - hanguser to confirm it’s that one account. You can run ...


1

Backwards compatibility is the reason that these files are on the newest version of macOS. It is there to ensure that programs that expect this way of handling pseudo terminals still work. You can open the /dev/ptyX# files the same way you would open /dev/ttys### files. You seem to have reversed the slashes in your command - please ensure that you are using ...


0

Summing up the answer in advance: the folder simply might not exist on Windows. I found a description that explains the equivalent Windows and Mac folders at https://deciphertools.com/blog/how-to-backup-ibooks-pdfs/. Where are My iBooks PDFs Stored on my Computer? On Windows, the iBooks PDF files copied to your iTunes by doing Transfer Purchases are stored ...


2

If you open Terminal -> Services -> Services Preferences there are some options there for enabling/disabling global keyboard shortcuts. Then you can disable this at Keyboard -> Shortcuts -> Services -> Open man Page in Terminal


0

I ran into the same issue, tried the things in the link. Eventually this is what worked for me: Open Terminal.app Navigate to the `Maxima.app/contents/MacOS/ folder: % cd /Applications/Maxima.app/Contents/MacOS Run the applet binary: % ./applet This finally triggered the pop-up requesting access. Click to allow access.


0

smartctl outputs different results for different types of SSDs (NVMe vs SATA via AHCI). TL;DR NVMe - specific NVMe health info e.g. Data Units Written: 44,739,539 [22.9 TB] SATA / SATA Express (AHCI) For Mid 2015 MacBookPro11,5 (512GB PCI based SSD) 175 Host_Writes_MiB 0x0022 099 099 000 Old_age Always - ...


0

If I understand the setup properly, you're using the wrong option to control what port it makes the connection over. If the router is forwarding port 70 to port 22 of the internal ssh server you want to connect to, then from the outside you'd connect with something like: ssh -p 70 username@router_external_ip Note that I'm using -p 70 to control what port it ...


0

Create multiple forwarding rules in the router, one for each machine behind it that you want to SSH into. Use different high ports as the input for each.


1

You need to use a for loop for this (works in both zsh and bash): for target in "dir1" "dir2" "dir3"; do ditto -- "myfile.css" "testingdir/$target" done If the target directories are actually called dir1 etc you can use wildcard expansion for target in dir[1-3]; do ditto -- "myfile.css" &...


0

In other words, Terminal.app connects you to a certain shell, allowing you to access all sorts of them concurrently. Run cat /etc/shells to see what shells are on your system. I’m sure you’ve got Bash, ZSH, and a few others. Then read up on configuring the history for your chosen shell, and try to make it a habit to always know which shell you’re using. The ...


0

XQuartz settings or preferences are managed from the file ~/Library/Preferences/org.macosforge.xquartz.X11.plist and are managed by XQuartz to read and write them through the agent com.apple.cfprefsd.xpc.agent. The undocumented clean way I found to manage this file is: Quit XQuartz Stop com.apple.cfprefsd.xpc.agent: launchctl stop com.apple.cfprefsd.xpc....


0

Not exactly what OP wants but may still prove useful to people. say beep


2

Just in case it's needed; if you want to installer a .pkg without root access: installer -pkg myapp.pkg -target CurrentUserHomeDirectory will install the package in ~/Applications.


0

The unix command you used in terminal was the following: defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES This adds a key to the Finder user defaults — _FXShowPosixPathInTitle — and sets it to true, which enables showing the full posix path of the file in the title bar. To turn that feature off and return to the original behavior, delete ...


0

curl You can bypass setting up mail and use curl to talk directly to your SMTP server. See using curl to send email for more details: curl --ssl-reqd \ --url 'smtps://smtp.gmail.com:465' \ --user 'username@gmail.com:password' \ --mail-from 'username@gmail.com' \ --mail-rcpt 'john@example.com' \ --upload-file mail.txt mail.txt file contents: From: &...


3

You should be able to do the same as your were doing in Linux in macOS. As an example, if using bash, adding alias vscode="open -a 'Visual Studio Code'" to your .bash_profile file will let you just type vscode in Terminal to open Visual Studio Code. Note: If you are running macOS Catalina, or later, and have not installed a more recent version ...


0

You could write a series of 1 line scripts and make them executable. In your example, a script named vscode would contain the one line you describe above. then you could chmod +x vscode and then just type vscode and return to run it.


1

This worked for me Restart required defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode TwoButton defaults write com.apple.AppleMultitouchMouse.plist MouseButtonMode TwoButton to revert change TwoButton to OneButton


0

I don't have emacs either: I presume it's not installed by default. pip3 and python3 are in /usr/bin by default, though I believe they don't work until you've installed Xcode command line tools.


4

I've recently started learning shell scripting so I tried an answer to this as an exercise. Script uses diskutil list external to get all external disks then loops over the output to unmount them. I then created an alias in ~/.zshrc so I now only have to type eject in Terminal to eject all external disks attached to my Mac. (thanks to @nohillside for the ...


0

This took me a while, but for profile changes like making Homebrew your profile, double click the option as there is nowhere to 'save' on this on mac.


0

Service Station, on the Mac App Store, allows you to fully customize your right-click menu in Finder. One of the most popular actions is to open Terminal by right-clicking in the Finder: I'm the developer and would love if you gave it a try. https://servicestation.menu https://apps.apple.com/us/app/service-station/id1503136033 The app is fully sandboxed ...


0

I found the problem! on line 2 of start.command I was using [”] instead of ["]. mac OS likes to replace normal quotation marks with these when you copy/past them. java does not see [”] as a quotation mark, so you have to manually enter the quotation marks with your keyboard.


3

Some installers allow custom install locations in the install wizard. However, if not, you can use the excellent third-party installer app, Pacifist. Pacifist lets you browse the contents of installer packages, select components to install and choose install destinations. However, if an installer package contains files that rely on the app being in /...


1

The other answers didn't work for me when connecting over SSH to the Mac. I had to add the following lines to my ~/.zshrc to get Home and End to work: bindkey "^[[H" beginning-of-line bindkey "^[[F" end-of-line


1

...is using this command [rm -P] safe on Macs with an SSD, or can this cause damage since it is technically overwriting data on the SSD which causes wear leveling It’s perfectly safe. You couldn’t really write enough data for it to matter. It’s also completely unnecessary as whatever you’ve deleted is instantaneously “gone.” The block isn’t really ...


0

I reinstalled Catalina. Problem solved.


0

Check out SecureCRT: https://www.vandyke.com/products/securecrt/mac_osx.html They have a build for Windows, Mac, and Linux. I've used the Windows version for years, and started using the Mac version recently. Although the Mac version isn't as fancy as the Windows version, it is full featured for everything I've ever needed in a multiple terminal emulator. It ...


1

Read the shell script: /Library/Application Support/org.pqrs/Karabiner-Elements/uninstall_core.sh or https://github.com/pqrs-org/Karabiner-Elements/blob/master/src/scripts/uninstall_core.sh In summary: Unload the kernel extensions. Clear immutable flags nouchg,noschg from the apps. Remove the files from /Library and /Applications. Remember we used sudo ...


0

Urm, Karabiner Elements literally has an Uninstall button right within its interface.


1

That is a nice idea ! I have just seen that you can play sound with the program afplay, you can look how to use it here : https://osxdaily.com/2009/10/27/play-mp3s-and-other-music-from-the-command-line/ . One way to do it could be at startup at the first login screen, you can look how to do it here : https://superuser.com/questions/245713/whats-the-easiest-...


1

You can use any SSH app on iOS to access the command line on a Mac. On the Mac you want to open System Preferences => Sharing and enable Remote Login. On the iOS device you want to install an SSH app, such as for example Terminus from the App Store. You can then use Terminus to connect to the Mac using its IP address and your user name and password.


3

This is what you're looking for ? mv *.jpg Low-Resolution\ Pics/ Moves all '.jpg' files in current directory to low res folder. mv WashingtonDC00*/*.jpg ./High-Resolution\ Pics/ Moves all '.jpg' files in folders beginning with 'WashingtonDC00' into High res folder. Files before: . ├── High-Resolution\ Pics │   ├── WashingtonDC002.jpg │   └── image0.jpg ├─...


0

mv */*.jpg "High-Resolution Pics (Folder)" mv *.jpg "Low-Resolution Pics (Folder)"


-1

You can use the cp command on the terminal. cd to the folder you want to copy to. then type cp ../high_res_folder_name*.jpg * The other files you may have to do individually. You can also just drag and drop using the finder.


0

The problem was that, as of Mojave, you cannot stop/start the screen sharing daemon with kickstart unless "Screen sharing" is checked in System Preferences/Sharing. Probably the update just unchecked this preference for some reason, which made it impossible to restart the daemon remotely. Once I had physical access to the computer again and checked this ...


3

You can find the default version by looking in the manual: man clang It states: The default C++ language standard is gnu++14. This is basically the same as C++14, but with some GNU specific extensions. The way to change the default setting when used "standalone" (i.e. without an Xcode project, Makefile or similar) is actually to make a shell alias. ...


1

Here's an answer without using keystrokes (as I use Rectangle which uses the command + option + f keystroke). oinfs() { for app in "${@}" do # get application name (applicationName) from case insensitive input # activate application (delay while app opens. may need to be changed to delay 3) # set application to fullscreen ...


0

To sleep the display : pmset displaysleepnow To check status : pmset -g powerstate IODisplayWrangler|tail -1|grep -q USEABLE # exit 0 (success) if screen is on


0

In my case the dashes that results in indentation in tree rendering was replaced with some strange character 'a' with a hat. Either tree -A or LC_ALL= C tree would resolve the issue then.


Top 50 recent answers are included