Can anyone tell me how to set a directory only in read/write mode as below?
I tried with 640,644 but I am able to achieve...
r - 4 w - 2 x - 1
For setting it as -rw-rw-r--, you need to run,
$ chmod 0664 <dir-name>
If you need
-rw-rw-r--try to set mode
Here, you can use this technique to change the access mode of directory/file.
4 - read 2 - write 1 - execute
So, if you want only read and write permission the you can go for 4+2 = 6 (read/write) According to you question the command is
# chmod 664 <file/directory-name>