Author Archives: Patrick McGoohan

Changing ownership with chown

Need to CHange the OWNer of a file or directory? chown [new owner] [file or directory] If, for example, I wanted to change the owner of /var/www/vhosts/my_website/tmp to “root” I’d run this: chown root /var/www/vhosts/my_website/tmp If you want to apply the ownership change recursively — that is, to all subdirectories and/or files within — add […]

The Tar basics

Tar is a compression utility used to generate a single archive, known as a “tarball”, out of multiple files and subdirectories. It can also be used, inversely, to extract these same subdirectories and files out of the archive. I want to create a tarball: tar cvf [archive-name].tar [source-directory] Here’s what the options mean: c = […]

Removing a non-empty directory

It’s fine to use rmdir [dir name] for empty directories. But if you’re looking to remove a non-empty directory, you need recursion: rm -rf [dir name] Use with caution — you will not be prompted to verify!

Exporting an individual directory from a repository

If you find yourself needing to export either an individual directory from a repos (say, as part of placing a project under version control) SVN’s export command is the tool for the job. Here’s the standard export syntax: svn export /path/to/repos /target/directory If /target/directory doesn’t exist, SVN, ever accommodating, will create it for you before […]

Changing permissions with chmod

Here’s the syntax for CHanging permissions or MODe — also known as chmod — for files and directories: chmod [permissions] /path/to/file/or/directory The three possible users are: file owner group of authorized users everyone else (a.k.a. “the world”) The possible actions (and associated binary values) are: 4: read 2: write 1: execute Total the values for […]

Making links out of nothing at all

When assigning a click action in jQuery it’s important to communicate that potential to your user. The CSS property cursor makes this a snap. Here’s our boring old html element: <div class=”hey”> I’m not boring! </div> We add a little CSS: <style> .hey { cursor: pointer } </style> And suddenly it looks suspiciously like a […]