chmod

The Linux `chmod` command

Linux file permissions FAQ: Can you share some examples of the Unix/Linux chmod command? (Also written as, "How do I change permissions on Unix files and directories?")

The chmod command name stands for "change mode", and as that name implies, the chmod command is used to change the mode of Unix/Linux files.

I'll start with some simple examples, then add some more details as we go along.

Linux chmod command man page

This page shows the contents of the Linux chmod comamnd man page. This chmod command output was created on a CentOS Linux system.

You can see this same chmod command man page output by entering this command on your own Linux system:

Linux chmod - how to make a Perl script executable

Linux chmod FAQ: Can you share an example of how to make a shell script executable with the Unix/Linux chmod command?

A lot of times in the web world you're given a Perl script by someone, and they say, "Put this script on your server, make it executable, and yada yada yada." Skipping the yada-yada part, some times people gloss over the "Make this file executable" part. So, here's a quick lesson of how to use the Linux chmod command to make a Perl script (or any Unix file) executable.

Error message: mv cannot unlink remove file, operation not permitted

I got this Unix/Linux error message today "mv: cannot unlink '/tmp/forms-1.2.1.jar': Operation not permitted" when trying to move (mv) the file forms-1.2.1.jar from the /tmp directory to another directory. The full error output looked like this: