This article shows how to delete .DS_Store files from the current directory and all its subdirectories on macOS. 1. Delete “.DS_Store” files The below command will delete .DS_Store files from the current directory and all its subdirectories without asking for confirmation. Terminal find . -name ".DS_Store" -type f -delete The command breakdown: find . – […]

Read more How to delete .DS_Store files on macOS

This article shows how to fix VirtualBox 6.1.* running slow on macOS, MacBook Pro with retina display. Tested with VirtualBox 6.1.22 macOS Big Sur 11.1 MacBook Pro (16-inch, 2019) Kali Linux, Ubuntu, Debian 1. VirtualBox with more memory, CPU, etc In VirtualBox, clicks on the Settings icon. 1.1 Increase based memory. 1.2 Increase CPU processors. […]

Read more VirtualBox running slow and lag on macOS, MacBook Pro

By default, Homebrew will install all packages in the directory /usr/local/Cellar/, and also creates symbolic links at /usr/local/opt/ and /usr/local/bin/ (for executable files). Terminal /usr/local/Cellar/ /usr/local/opt/ /usr/local/bin/ Terminal % brew -v Homebrew 2.7.2 Homebrew/homebrew-core (git revision 3c379; last commit 2021-01-11) Homebrew/homebrew-cask (git revision 40d45; last commit 2021-01-11) P.S Tested with Homebrew 2.7.2 and macOS Big […]

Read more Where does Homebrew install packages on Mac?

Here is the .htaccess file. /Library/WebServer/Documents/.htaccess # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /mkyong/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /mkyong/index.php [L] </IfModule> # END WordPress Solution Find the Apache config file in /etc/apache2/httpd.conf, make sure the following settings are configured properly : 1. The mod_rewrite.so is loaded. […]

Read more Mac OSX – Redirect .htaccess is not working ?

On Mac OSX, the default localhost folder is located at /Library/WebServer/Documents P.S Tested with MacOS Sierra, 10.12.6 Find httpd.conf By default, Apache is enabled and installed in /etc/apache2/, inside httpd.conf file, find DocumentRoot to tell where is the default localhost folder. sudo vim /etc/apache2/httpd.conf # DocumentRoot: The directory out of which you will serve your […]

Read more Mac OSX – where is default localhost folder?

Edit this file /private/etc/hosts. Terminal $ sudo nano /private/etc/hosts ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost 127.0.0.1 mkyong-mac 198.x.x.x linode-bot1 1.2.3.4 www.google.com References What is the difference between […]

Read more How to edit hosts file on Mac OSX

By default, there is no wget on Mac OS X. $ wget http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz -bash: wget: command not found On Mac OS X, the equivalent of Linux’s wget is curl -O $ curl -O http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 49 9112k 49 […]

Read more wget on Mac OS X

See following scenario, create a file, add content, search and replace it. $ touch testing.txt $ echo "this is mkyong.com" > testing.txt $ cat testing.txt this is mkyong.com $ sed -i ‘s/mkyong/google/g’ testing.txt sed: 1: "testing.txt": undefined label ‘esting.txt’ This sed -i ‘s/mkyong/google/g’ testing.txt command is working properly in Linux, but hits “undefined label” error […]

Read more sed command hits “undefined label” error on Mac OS X