chmod: cannot read directory `.’: Permission denied [closed]

Directories need the execute permission set in order to see their contents. From http://content.hccfl.edu/pollock/AUnix1/FilePermissions.htm You can think of read and execute on directories this way: directories are data files that hold two pieces of information for each file within, the file’s name and it’s inode number. Read permission is needed to access the names of … Read more

How do I use chmod with Node.js

According to its sourcecode /lib/fs.js on line 508: fs.chmodSync = function(path, mode) { return binding.chmod(pathModule._makeLong(path), modeNum(mode)); }; and line 203: function modeNum(m, def) { switch (typeof m) { case ‘number’: return m; case ‘string’: return parseInt(m, 8); default: if (def) { return modeNum(def); } else { return undefined; } } } it takes either an … Read more

Copy file permissions, but not files [closed]

You should have a look at the –reference option for chmod: chmod –reference version2/somefile version1/somefile Apply find and xargs in a fitting manner and you should be fine, i.e. something like ~/version2$ find . -type f | xargs -I {} chmod –reference {} ../version1/{} This even works recursively, and is robust against missing files in … Read more

Trying to get Postgres setup in my environment but can’t seem to get permissions to intidb

This should work just fine: # sudo mkdir /usr/local/var/postgres # sudo chmod 775 /usr/local/var/postgres # sudo chown construct /usr/local/var/postgres # initdb /usr/local/var/postgres use your username in place of construct. So, if your computer username is WDurant, the code will be: # sudo chown $(whoami) /usr/local/var/postgres