Saturday, August 13, 2022

Bash/Unix/Mac - File permissions

File permissions - Bash/Unix/Mac


Format is 421

4 - read

2 - write 

1 - execute


The following table shows each permission is assigned a value.

NumberOctal Permission RepresentationRef
0No permission---
1Execute permission--x
2Write permission-w-
3Execute and write permission: 1 (execute) + 2 (write) = 3-wx
4Read permissionr--
5Read and execute permission: 4 (read) + 1 (execute) = 5r-x
6Read and write permission: 4 (read) + 2 (write) = 6rw-
7All permissions: 4 (read) + 2 (write) + 1 (execute) = 7rwx



$ chmod 755 filename.txt

$ chmod 622 filename2.txt

$ chmod 


Shows how much memory is free

$ watch free -h 

No comments:

Post a Comment