Wazaterm » Linux Commands » chmod

How to use chmod Linux command

The chmod command changes the file mode bits of each given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new mode bits.

Usage

Add execute permission to foo.sh

$ chmod u+x foo.sh

Set permission to protects a file, foo.txt, against any access from other users, while the issuing user still has full access.

$ chmod 700 foo.txt