In: Computer Science
a) Observe the following Linux commands and work out what each command does:
1) $ ls –al
2) $ /etc/profile
3) $ chmod 200 final_assignment.txt
b) Consider a scenario where Bob has downloaded his messages to the local machine with an access of
POP3, he can create mail folders and move the downloaded messages into the folders. Bob can then
delete messages, move messages across folders, and search for messages (by sender name or subject).
But this paradigm—namely, folders and messages in the local machine—poses a problem for the nomadic
user, who would prefer to maintain a folder hierarchy on a remote server that can be accessed from any
computer. This is not possible with POP3—the POP3 protocol does not provide any means for a user to
create remote folders and assign messages to folders. Which protocol can be used in this given scenario
so that messages can be accessed from anywhere from the same inbox account? Justify your answer with
the aid of a diagram.
Solution:
a)
1. Command : ls -al
ls command is used to display the contents of the current working directory. when it is used with extra options the behaviour will be different.
-a : This option is used to display all the files in the directory including the hidden files. Hidden files are the ones which has names atarting with a period.
-l : This option is used to display the long list of the files. Using this command we can see the permissions, file owner , size , modification time and file name.
So, ls -al command is used to display a long listing of all the files ( including the files that starts with . ) .
2. Command : /etc/profile
The file /etc/profile contains the information about system wide environment variables and startup programs. This file is used by the shell programs like BASH ( Bourne Again Shell ) , KSH ( Korn Shell) and SH. It is generally used to setup environment variables like PATH , user limits ( we can limit the system resources used by user ) and settings for the user.
3. Command : chmod 200 final_assignment.txt
chmod command is used to change/modify the permisions of a file based on the given argument.
So, in the above command the argument is 200
when digits of 200 is represented in binary.
So the above table we can see that command sets the file permissions to -w- --- -- i.e only write permission for user.The table shows how the argument 200 is interpreted as permissions.
I hope this would help....................:-))