Create a symbolic link in Linux to a file or a directory path

You wish you didn’t have to copy files and folders twice on your Linux web server, and consistently have to come up with a way to keep the duplicate files or directories synchronized?

A symbolic link in Linux or Unix is a virtual pointer to another directory or file. It acts in all ways as if it were the original file or folder. A symlink will appear in any directory listing (ls -al), and will indicate the original directory or file. All child directories of a symlink directory will inherit the symbolic link’s directory path when accessed through the symlink. Any changes made to the symbolically linked file or directory, will occur in the original actual file or directory, as the symbolic link just points straight to it. Continue Reading

Officer Symbolic Link saves the day from the criminal duplicate corrupt datum!

Officer Symbolic Link says he is “not the real hero”. Rather, Officer Symbolic Link said that Linux Torvald and Solaris were “the ones who [we] should be thanking” for the saving of Mr. Linux from almost certain data corruption and death.

The incident happened in the Down Town File Systems area known to town citizens as “EXT3″. An operator for Open Source Organization wishing to remain anonymous commented that he was “glad to see Linux safe and sound with as few shards of duplicates as possible”. Linux had been running stable in EXT3 for many months until yesterday evening, shortly after Peak Network Traffic Hour had passed, when he noticed someone copying him in every bit immediately behind him. Continue Reading

Guide to Chmod Permissions of Only Directories in Linux

The chmod command in Linux is a very valuable and often necessary function for fixing permissions of directories and their contents on a publicly accessible server.

When you are needing to change linx octet permissions for many folders and child folders and their contents, the -R recursive switch is of great value, as it saves you the trouble of having to switch directories and execute the chmod command time and time again.

Unfortunately, chmod is only able to execute commands on input parameters passed along to it specifying matches in the file name, and whether or not to chmod recursively or not. If your desire is to only chmod directories, but not the files, you have a problem.

To bypass the chmod command limitation, we will be utilizing stdin to stdout capability of the find and chmod commands.  Since find and chmod take advantage of  standard input / standard output capability, we are able to have them cross communicate sequentially in order to selectively pass along files to be chmod’ed which match our find query. Continue Reading

Recursively chmod permissions of only files in linux

So, you want to change the Linux permissions of all files in a directory and all sub directories, but not affect the permissions of the folders?

This simple guide will show you how to do a recursive chmod changing only the permissions of files, while leaving the permissions for all directories untouched.

The recursive chmod-files-only syntax:

The following shell command will chmod all files only (and ignore the directories) setting the permissions to 644. Continue Reading