M Hassan Bin Adeel
M Hassan Bin Adeel
CS-11-B
386269
LAB-01
2. Open Firefox browser and terminate the firefox process using the terminal by
finding its pid and killing the process.
4. Compress dir1 and dir2 into a zip file using the terminal. Name the zipped file
zipped_directories.
Hint: use text files that contain strings like "aad(bbb)c c" for testing
Make this script file executable using the command chmod u=rwx commands.sh and run
using ./command.sh
7. What do the cat, touch and echo commands do? Show how they work using an
example.
The cat command is a utility command in Linux. One of its most common usages is to print the content of
a file onto the standard output stream. Other than that, the cat command also allows us to write some
texts into a file.
“ cat file1.txt”
The touch command is a standard command used in UNIX/Linux operating system which is
used to create, change and modify timestamps of a file. It creates the file without any content
echo command in linux is used to display line of text/string that are passed as an argument .
This is a built in command that is mostly used in shell scripts and batch files to output status
text to the screen or a file.
“ echo –e “hassan\bis\bhere” ”
8. Transform the above C code “hello.c” into C++, compile it, and then execute the
program. hint: use appropriate compiler for compiling C++ code.
#include <iostream>
using namespace std;
/* Hello World program */
#include<stdio.h>
int main() {
cout<<"Hello World"<<endl;
return 0;
}