|
IGNOU > IGNOU Assignments > MCA > MCA 2009 Assignments >Laboratory Course
IGNOU MCA Assignments
d) To change the command prompt from $ to *.
Ans.
$ PS1= “*”
echo $PS1
(e) To grant the permissions of read, write and execute to the user and read only to the group and others for all the files in a current directory.
Ans:
The permissions signify who all can access the file, and for what purpose. This is decided by the file permissions. A set of nine characters denote these permissions. There are three types of permissions to a file:
r read
w write
x execute
There are three entities to which any combination of these permissions are assigned. These entities are the owner, the group, and the rest. Of the nine characters, the first three characters decide the permissions held by the owner of the file. The next set of three characters specify the permissions for the other users in the group to which the file owner belongs, while the last set decides the permissions for the users outside the group. Out of the three characters belonging to each set the first character is for indicating the ‘read’ permission, the second character is for ‘write’ and the last is for ‘execute’ permission.
We know that directories too are treated by Unix as files. A directory, as Unix perceives, is a file which contains the names of the files present in the directory. So, if a owner has to be granted read, write and execute and group and others can only read the directory, the permission will be r w x r- - r - -
(f) To direct a standard output to any of the line printer.
Ans:
The lp command is used to send the user’s print job to the print queue. When we submit the job for printing using the lp command it returns a ‘request id’. This id can be used to keep track of our job or to cancel it if required. When we cancel the print request our job gets removed from the print queue The standard output can be redirected to a file or a printer. Unix provides redirection symbol for the purpose. The symbol > implies redirection of output. The > operator tells Unix, “Don’y display this output on screen instead, put it somewhere else”.
$ cat file1 > lp
This will send the content of file1 to lp
  
|