Add write permissions to the current user:
chmod u+w file
Add read permissions to users in the file group:chmod g+r file
Add execute permissions to other users:
chmod o+x file
Add read + write permissions to all users:
chmod a+rw file
Make executable files executable by all:
chmod a+rX *
Make the whole directory and its contents accessible by all users:
chmod -R a+rX dir (recursive)
Most Popular Articles
Commands for Handling files and directories
Create a directory: mkdir dir Create nested directories: mkdir -p dir1/dir2Changing...
Listing files
List all “regular” files (not starting with .) in the current directory:lsDisplay a long...
Displaying file contents
Concatenate and display file contents:cat file1 file2Display the contents of several files...
File name pattern matching
Concatenate all “regular” files: cat *Concatenate all “hidden” files: cat .*Concatenate all files...
Handling file contents
Show only the lines in a file containing a given substring: grep substring fileCase insensitive...