Categories
Linux

chown and chmod Command basics

Chown

# chown owner-user file 
# chown owner-user:owner-group file

Listing files with owner and group

# ls -la

Changing owner and owner group

# chown praison file.txt
# chown praison:praison file.txt

Change the owner for a folder

# chown praison:praison /folder

Change the owner for all subfiles of the folder

# chown -R praison:praison /folder

Chmod

# chmod options permissions file name

Change permission for a single file

# chmod 644 filename

Change permission for all files under a directory

# chmod -R 755 directory

Make your file executable

# sudo chmod +x filename