

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The tasks for lab session 2 of the computer programming course at birla institute of technology & science, pilani, focusing on unix commands and the vi editor. Students are required to perform various tasks, such as navigating directories, creating files and directories, and using input/output redirection. The document also introduces the concept of absolute and relative paths.
Typology: Exercises
1 / 2
This page cannot be seen from the preview
Don't miss anything!


First Semester 2019- CS F111 Computer Programming
LAB SESSION # (Basic Unix Commands and vi Editor) Unix is a multi-user, multi-tasking operating system, and Linux is a variant of Unix that we shall be using throughout this course. Everything is treated as a file in Unix. One or more files are stored inside a directory (i.e., folder). As soon as you are logged in, Unix places you in a directory that will be your “home”
(tilde, found below the
Attempt each of the following tasks on the Linux machine, and write down the corresponding Linux commands you used for each task in your notebook:
Input and Output Redirection
Most Unix system commands take input from your keyboard and send the resulting output to your terminal. A command normally reads its input from the standard input, which happens to be your keyboard by default. Similarly, a command normally writes its output to standard output, which is again your terminal by default. However, these default streams can be changed using input/output redirection, for instance, an input taken from a file or the output that goes to a file.
The output from a command normally intended for standard output can be easily diverted to a
any command that normally writes its output to standard output, the output of that command will be written to file f1 instead of your terminal. This is output redirection. Just as the output of a command can be redirected to a file, so can the input of a command be redirected from a file.
to redirect the input of a command. This is input redirection.
Beginning to use the vi editor