Commands: $ logname  to check present working user. User2 $ clear



Download 122.5 Kb.
Page13/17
Date25.10.2023
Size122.5 Kb.
#62396
1   ...   9   10   11   12   13   14   15   16   17
Unix Commands
Directory permissions are:
Read: with this permission we can see the contents of the directory.
Write: with this permission we can create or delete files in the directory.
Execute: with this permission user can change into that directory. Without this permission user cannot change into that directory.
Note: To modify a file you should have both read and write permissions.
umask: Default file and directory permissions
To assign all the permissions to a regular file the notation is 666. Since a regular file will not have executable permission.
To assign all the permissions to a directory the notation is 777.
Initial permissions of the files and directories depends upon current umask value (when a file is created newly the default permissions are given depending on umask value)
To check the umask value, umask command is used.
$ umask
0022
Here first zero is the sticky bit value; second zero for users; 2 for group; another 2 for others
Umask value tells that not to grant specified permissions.
For example as above umask value is 022 it means
The default permissions of a file is 644 (666-022=644) and for directories 755 (777-022=755)
After that permissions of files and directories can be changed by using chmod command.

  • Filters

UNIX/LINUX provides following filters


Pipe, head, tail, tr, tee, grep commands


Working with pipe:
Pipe is used to communicate between two process called as “inter process communication”.
$ cmd1 | cmd2

Output Screen





Temp file


T he result of cmd1 will be return to pipe temporary file. From this file cmd2 will read data and send to output screen.
Note: multiple pipes can be used.



Output Screen





Download 122.5 Kb.

Share with your friends:
1   ...   9   10   11   12   13   14   15   16   17




The database is protected by copyright ©ininet.org 2024
send message

    Main page