Important and frequently used linux commands

, , Leave a comment

In this post we will list out some of the important and frequently used linux commands that you may find useful in your software engineering journey.

1. Read, Write and Execute permission to owner and group on directories recursively

sudo find . -type d -exec chmod 2775 {} \;

Above command will give recursive read, write and execute permission to owner and group, while giving read and execute permission to other users to all directories under current directory.

2. Read and write permission to owner and group on files recursively

sudo find . -type f -exec chmod 0664 {} \;

Above command will give recursive read and write permission to owner and group, while giving read permission to other users to all files under current directory and subdirectories.

3. Changing ownership and group of files and directories

sudo chown -R user:group .

You can replace user and group as per your usecase. Above command will change ownership and group of files and directories under current directory recursively.

For eg:

sudo chown -R ftpuser:www-data .

Above command will change ownership and group of files and directories to ftpuser and www-data group recursively.