Mongod complains that there is no /data/db folder

You created the directory in the wrong place /data/db means that it’s directly under the “https://stackoverflow.com/” root directory, whereas you created ‘data/db’ (without the leading /) probably just inside another directory, such as the ‘/root’ homedirectory. You need to create this directory as root Either you need to use sudo , e.g. sudo mkdir -p … Read more

XAMPP permissions on Mac OS X?

Tried the above but the option to amend the permission was not available for the htdocs folder, My solution was: Open applications folder Locate XAMPP folder Right click, get info (as described above) In pop-up window locate the ‘sharing & permission’ section Click the ‘locked’ padlock symbol Enter admin password Change ‘Everyone’ permissions to read … Read more

In-place edits with sed on OS X

You can use the -i flag correctly by providing it with a suffix to add to the backed-up file. Extending your example: sed -i.bu ‘s/oldword/newword/’ file1.txt Will give you two files: one with the name file1.txt that contains the substitution, and one with the name file1.txt.bu that has the original content. Mildly dangerous If you … Read more