EACCES, permission denied
That was the error message that I received when I was trying to update my Atom packages (I think it was linter-php). Basically, the updater was failing because it didn’t have permission to remove an old config file. The fix was simple enough. All I had to do was resign the permissions to my user by running the following command:
sudo chown -R `whoami` ~/.atom
Easy as that the permissions were fixed and the updater could do its thing again.
Recently I had a script that I needed to run about 100 times in a row. This little one liner came in super handy for that. Replace “COMMAND” with the command that you want to run. In this example, the command will run 100 times in a row!
for i in `seq 100`; do COMMAND; done
Recently I was presented with a problem where I had a directory of about 1000 graphic files of mixed formats (png, gif, bmp, jpg), and I needed to convert them all to jpg files.
I tried various solutions but I ended using the following command in my Mac’s terminal.
mkdir jpegs; sips -s format jpeg *.* --out jpgs
This command creates directory called “jpgs”, and converts all of the files in the current directory into .jpg format, and moves them into the newly created “jpgs” direcotry.
It truly saved the day.
“touch” is a handy unix utility to udate the time stamp on a file. Recenly I ran into a case on my mac book pro that required me to update all of the files and sub-directories of a project with the current date.
In terminal, I could have gone one by one an used this command on each file
But after a few moments of onterweb searching, I came across a perfect solution
find . -print0 | xargs -0 touch
This command will find all of the file in all sub-directories, even if they have spaces in their name, and set their last updated time to the current time.
Just a handy tip I thought I would share