0% found this document useful (0 votes)
16 views

Os Record

The document discusses various commands used in the VI editor and UNIX operating system. It provides examples of commands to insert and delete text, navigate files, copy and move files between directories, rename files and directories, and remove files. It also discusses using variables and writing simple shell scripts.

Uploaded by

Mr. AKP
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Os Record

The document discusses various commands used in the VI editor and UNIX operating system. It provides examples of commands to insert and delete text, navigate files, copy and move files between directories, rename files and directories, and remove files. It also discusses using variables and writing simple shell scripts.

Uploaded by

Mr. AKP
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

EX NO:1 WORKING WITH VI EDITOR COMMANDS

DATE: 17.08.2023

- ‘i’: Enter insert mode before the cursor.


- ‘I’: Enter insert mode at the beginning of the current line.
- ‘a’: Enter insert mode after the cursor.
- ‘A’: Enter insert mode at the end of the current line.
- ‘o’: Open a new line below the current line and enter insert mode.
- ‘O’: Open a new line above the current line and enter insert mode.
- ‘x’: Delete the character under the cursor.
- ‘dd’: Delete the current line.
- ‘yy’: Yank (copy) the current line.
- ‘p’: Paste the text after the cursor.
- Press ‘Esc’ to return to normal mode.
- ‘:w’: Save changes (write).
- ‘:q’: Quit vi.
- ‘:q!’: Quit vi without saving changes.
- ‘:wq’ or ‘:x’: Save changes and quit vi.
- ‘h’: Move the cursor left.
- ‘j’: Move the cursor down.
- ‘k’: Move the cursor up.
- ‘l’: Move the cursor right.
- ‘w’: Move forward one word.
- ‘b’: Move backward one word.
- ‘0’ (zero): Move to the beginning of the current line.
- ‘$’: Move to the end of the current line.
- ‘G’: Move to the end of the file.
- ‘:n’: Move to line number 'n'.
- ‘v’: Enter visual mode to select text.
- ‘V’: Enter visual line mode to select whole lines.
- ‘y’: Yank (copy) the selected text.
- ‘p’: Paste the yanked text.
- ‘u’: Undo the last change.
- ‘Ctrl + r’: Redo the undone change.
EX NO: 2 WORKING WITH UNIX COMMANDS – 1
DATE: 17.08.2023

1. Display the name of your HOME directory on the screen:

COMMAND:
pwd

OUTPUT:
/home/edith

2. List out the names of all files in your HOME directory:

COMMAND:
ls

OUTPUT:
Desktop temp os

3. Change the working directory to the root directory:

COMMAND:
cd
pwd

OUTPUT:
/home/

4. Verify that the root directory is the current working directory:

COMMAND:
pwd

OUTPUT:
/home/Edith/os

5. Make your HOME directory the current working directory:

COMMAND:
cd

OUTPUT:
Path changed to home dir

6. From your HOME directory, list the contents of the directory ‘temp’ under your HOME directory:

COMMAND:
ls os

OUTPUT:
Ex1

7. Copy the file 'first-a' from the HOME directory to the directory ‘temp’:
COMMAND:
cp first-a os/copy

OUTPUT:
Copy created
8. Verify that the file has been copied:

COMMAND:
cd os
ls

OUTPUT:
copy

9. Copy the file 'first-a' to another file called 'First-a' under your HOME directory:

COMMAND:
cd
cp first-a First-a

OUTPUT:
First-a created and is a copy of first-a

10. List the contents of the files 'first-a' and 'first-b' through one command:

COMMAND:
cat first-a first-b

OUTPUT:
Contents of first-a and first-b displayed
EX NO: 3 WORKING WITH UNIX COMMANDS -2
DATE: 17.08.2023

1. Create a new directory called 'newdir' under the directory 'temp':

COMMAND:
mkdir $HOME/temp/newdir
ls

OUTPUT:
newdir

2. From your HOME directory, move all files from the directory 'temp' to the directory 'newdir':

COMMAND:
mv $HOME/temp/* $HOME/temp/newdir/

OUTPUT:
All content copied

3. Rename the directory 'newdir' as 'olddir':

COMMAND:
mv $HOME/temp/newdir $HOME/temp/olddir
ls

OUTPUT:
olddir

4. Verify that the directory has been renamed:

COMMAND:
ls $HOME/temp

OUTPUT:
olddir

5. Remove the file 'first-a' from 'olddir' and check to see if it has been removed:

COMMAND:
rm $HOME/temp/olddir/first-a

OUTPUT:
first-a removed

6. Rename the file 'gold-words' under the directory 'olddir' as 'golden-words' and verify that the file
has been renamed:

COMMAND:
mv $HOME/temp/olddir/gold-words $HOME/temp/olddir/golden-words
ls
OUTPUT:
golden-words

7. Change the working directory to the parent directory of your HOME directory and display the name
of this directory:
COMMAND:
cd ..
pwd

OUTPUT:
home/edith

8. Change back to your HOME directory:

COMMAND:
cd $HOME
pwd

OUTPUT:
home/edith

9. Remove all the files under the 'olddir' under the 'temp' directory:

COMMAND:
rm $HOME/temp/olddir/*

OUTPUT:
All files removed

10. Display the contents of the file '9ABC':

COMMAND:
cat 9ABC

OUTPUT:
HELLO WORLD!!

11. List out the names of all files that end with '.c':

COMMAND:
ls * .c

OUTPUT:
ex1.c ex2.c
EX NO: 4 WORKING WITH UNIX COMMANDS -3
DATE: 17.08.2023

1. List out the names of all files that are 5 characters long:

COMMAND:
ls ?????

OUTPUT:
file1.c

2. Remove the files whose names are listed out by the command of (List out the names of all files that
end with ‘.c’.) (Exercise 3). Use only one command to do so:

COMMAND:
rm *.c
ls

OUTPUT:
No:’.c’ file in directory

3. Display the names of all files that start with a lowercase alphabet followed by a digit and ending
with '.c' or '.o':

COMMAND:
ls [a-z][0-9]*.c *.o

OUTPUT:
A1.c a2.o

4. Move all the files whose names end with '.c' or '.o' to the directory 'olddir':

COMMAND:
mv *.c *.o ~/olddir/

OUTPUT:
A1.c a2.o

5. In one command, remove all the files in 'olddir' and the directory itself:

COMMAND:
rm -r olddir

OUTPUT:
Directory deleted

6. Try displaying the contents of a file that does not exist:

COMMAND:
cat xyz

OUTPUT:
cat:xyz: No such file or directory

7. Type in PWD instead of pwd and note what happens:

COMMAND:
PWD

OUTPUT:
PWD: command not found

8. Try creating a directory that already exists and observe what happens:

COMMAND:
mkdir os

OUTPUT:
mkdir: cannot create directory 'os': File exists

9. Display the names of all files in your current directory:

COMMAND:
ls

OUTPUT:
temp newdir

10. List out the names of all files in your HOME directory in reverse order:

COMMAND:
cd
ls -r

OUTPUT:
newdir temp

11. Copy the file 'first-a' from the HOME directory to the directory 'temp' under your HOME
directory:

COMMAND:
mv first-a temp/
ls

OUTPUT:
first-a
12. Create a new directory 'letters' under the 'temp' directory:

COMMAND:
mkdir temp/letters
ls

OUTPUT:
first-a letters

13. From your HOME directory, move all files from the directory 'temp' to the directory 'letters':
COMMAND:
mv temp/* temp/letters/

OUTPUT:
Directory and files moved

14. List out the names of all filenames that start with the digit '9':

COMMAND:
ls 9*

OUTPUT:
9abc
EX NO: 5 WORKING WITH SHELL SCRIPTS FUNDAMENTALS
DATE: 22.08.2023

1. Give the command to display the message WARNING… and then sound the bell.

COMMAND:
echo -e "WARNING...\a"

OUTPUT:
WARNING… [and then bell sounds]

2. Give the command to display the message WARNING… followed by a blank line and then sound
the bell.

COMMAND:
echo -e "WARNING...\n\a"

OUTPUT:
WARNING…
[and then bell sounds]

3. Give the command to display the message WARNING… keep the cursor on the same line and then
sound the bell.

COMMAND:
echo -n "WARNING...\a"

OUTPUT:
WARNING…[and then bell sounds]

4. Write a shell script to display the following (blank line) (blank line) The echo command displays its
arguments on the VDU.

COMMAND:
#!/bin/bash
echo -e "\n\nThe echo command"
echo "displays its arguments"
echo "on the VDU."

OUTPUT:
The echo command
Displays its arguments
On the VDU

5. Point out errors


a. VERSION=UNIX Version 5.3
Incorrect: VERSION=UNIX Version 5.3
Correct: $VERSION=”UNIX Version 5.3”

b. echo {VERSION}
Incorrect: echo {VERSION}
Correct: echo ${VERSION}
6. What would happen if the following command is specified?

COMMAND:
echo “VERSION”

OUTPUT:
VERSION

7. Write a shell script called WELCOME that asks the user to enter his/her name and then displays the
message:

COMMAND:
#!/bin/bash
echo "Enter your name:"
read USERNAME
echo "Hello $USERNAME! Welcome to this UNIX session!"

OUTPUT:
Enter your name:
Edith
Hello Edith! Welcome to this UNIX session!

8. Point out the error in the following read command.

COMMAND:
read ${VERSION}

OUTPUT:
zsh: not an identifier : UNIX VERSION 5.3

9. Give the command to display the name of the HOME directory from any directory.

COMMAND:
echo $HOME

OUTPUT:
home/edith

10. What would the result of the cd command (without any arguments) be if the HOME variable is set
as follows:

COMMAND:
$HOME="/user/root"

OUTPUT:
No such file or directory

11. Give the command to display the contents of the variable PATH.

COMMAND:
echo $PATH

OUTPUT:
The whole path displayed
12. Give the command to set the PATH to the directories root(/), /usr/bin and /bin, in that order.

COMMAND:
PATH="/usr/bin:/bin:$PATH"

OUTPUT:
Path is set

13. How can a user set the UNIX prompt to the following? Enter Command:>

COMMAND:
PS1="Enter Command:>"

OUTPUT:
Enter Command:>

14. Reset the prompt back to "$"

COMMAND:
PS1="$"

OUTPUT:
$

15. What will be the output?

COMMAND:
echo "${LOGNAME}"

OUTPUT:
Edith

16. Write a shell script to display the following:

COMMAND:
#!/bin/bash
echo "Hello $USER!"
echo "Your HOME directory is $HOME"

OUTPUT:
Hello Edith!
Your HOME directory is home/Edith

17. Point out errors


Incorrect: LOGNAME=gopal
Correct: No Errors

18. What do the variables $0, $1, and $2 contain when the following command is given?
cat data.file

- ‘$0’ contains the name of the script or shell being executed.


- ‘$1’ and ‘$2’ would be empty since there are no command-line arguments passed to the ‘cat’
command.
19. What do the variables $0 to $3 contain when the following command is given?
rm file1 file2 file3

- ‘$0’ contains the name of the script or shell being executed.


- ‘$1’ contains "file1"
- ‘$2’ contains "file2"
- ‘$3’ contains "file3"

20. When the following command is executed, what will each positional parameter contain? What will
the variable $* and $# contain?

COMMAND:
mv data1 /user/ram/data2

PARAMETERS:
- ‘$0’ contains the name of the script or shell being executed.
- ‘$1’ contains "data1"
- ‘$2’ contains "/user/ram/data2"
- ‘$*’ contains "data1 /user/ram/data2"
- ‘$#’ contains 2 (number of arguments).
EX NO: 6 WORKING WITH SHELL SCRIPTS -1
DATE: 31.08.2023

1. Write a shell script called check-type which asks for the name of a file to be displayed, reads the
name of the file on the same line and displays the contents of the file if it is an ordinary file. If it is not
an ordinary file, then the script should display the message:

“File does not exist OR is not ordinary, cannot display”

CODE:

read -P "Enter the file name:" file


if [ -f "$Name" ]
then
cat "$Name"
else
echo “File does not exist OR is not ordinary, cannot display”
fi

COMMAND:
bash check.sh

OUTPUT 1:
Enter the file name: a1.sh
Contents of the file

OUTPUT 2:
Enter the file name: xyz
“File does not exist OR is not ordinary, cannot display”

2. Modify #1, so that the script checks to see if the file is an ordinary file and is readable.

CODE:

read -p "Enter the file name:" $file


if [ -f "$Name" ] && [ -r "$ Name " ]
then
cat "$ Name "
else
echo “File does not exist OR is not ordinary, cannot display”fi

COMMAND:
bash check.sh

OUTPUT:

Enter the file name: a1.sh


Contents of the file
3. Write a shell script which takes the name of a file as an argument, and checks to see if the file
exists in your home directory and is executable.

CODE:

if [$# -gt 0 ]
then
if [ -f $1 ] && [ -x $1 ]
then
cat "$file"
elif [ -f $1 ] && [ !-x $1 ];then
echo "File exist but can not be executed"
fi
else
echo "No arguments passed"
fi

COMMAND:
bash check.sh

OUTPUT 1:

No arguments passed

OUTPUT 2:
Enter the file name: a1.sh
Contents of the file
EX NO: 7 WORKING WITH SHELL SCRIPTS -2
DATE: 05.09.2023

1. Write a shell script which is to be executed with one argument and which will

a. Display an error message if an argument is not entered or more than one argument is
entered at the command line

b. Check if the argument is a directory file and display the message ”DIRECTORY FILE” if
it is

c. Check if the argument is an ordinary file and display the message ”ORDINARY FILE” if
it is

CODE:

#!/bin/bash
if [ $# -eq 0 ];then
echo "Enter the arguement"

else

if [ -d "$1" ];then
echo "Directory File"
elif [ -f "$1" ];then
echo "Odinary File"
else
echo"Invalid File"
fi
fi

COMMAND:
bash check.sh

OUTPUT:

Enter the file name: a1.sh

Odinary File

2. Write a shell script which will:

a. Ask the user to enter a filename

b. Check if the file is an ordinary file and is readable

c. In case the file is ordinary and readable, it should display the file

d. In case the file is not ordinary and/or not readable, then the script should display an error
message.
CODE:

#!/bin/bash

read -p "Enter the file name:" file

if [ -f "$file" ] && [ -r "$file" ]


then
cat "$file"
else
echo "File does not exist or not readable"
fi

COMMAND:
bash check.sh

OUTPUT:

Enter the file name:a1.sh


Contents of the file

3. Write a shell script called list-type which displays the following menu

a. Display long listing of files

b. Display long listing of files including hidden files

c. Display only names of directories

d. Exit

The shell script should be executed with one argument (make a check). Display appropriate
messages if invalid number of arguments are passed, if the file is not a directory, if invalid
option is entered, etc.

CODE:

#!/bin/bash
if [ $# -eq 1 ];then
if [ -d $1 ]
then
echo –e “Long listing\n”
ls –l “$1”
echo –e “Long listing all files\n”
ls –a “$1”
echo –e “Long listing directory\n”
ls –d “$1”
else
echo “File not a directory”
fi
else
echo “Invalid no of arguments”
fi

OUTPUT:

Long listing
List of all the files in the directory
Long listing all files
List of all the files in the directory
Long listing directory
List of all directory

4. Write a shell script which takes as argument either R, W or X and displays the names of all ordinary
files for which the user has read, write and execute permissions, respectively. If no arguments are
entered, then the script should display the message:

Enter either R, W or X:

And accept the argument. If an invalid argument is given, the script should ring the system
bell and display an error message.

CODE:

#!/bin/bash
if [ $# -eq 0 ] || [ $# -gt 1 ];then
echo "Enter valid number of arguements"
else
if [ "$1" != "w" ] && [ "$1" != "r" ] && [ "$1" != "x" ];then
echo "Enter a valid argument”
else
if [ "$1" == "x" ];then
echo "Executable files are:"
find -type f -executable
elif [ "$1" == "r" ];then
echo "Readable files are:"
find -type f -readable
else
echo "Writable files are:"
find -type f -writable
fi
fi
fi

OUTPUT:

Readable files are:


./a1.sh
./check.sh

5.Write a shell script which takes one argument. If this argument is an ordinary file, display the
following message:
is an ordinary file-display?
If the answer is ‘y’, the file should be displayed if it has read permission; otherwise, the script should
display the following message and abort:
Sorry, has no read permission
If the argument is a directory, display a long listing of all files in that directory after getting
confirmation from the user and checking for permissions as above.
If the argument is a special file, display an appropriate message, otherwise display an error message
and exit.

CODE:

#!/bin/bash
if [ $# -eq 0 ] || [ $# -gt 2 ];then
echo "Enter Valid arguement"
else
if [ -f "$1" ];then
read -p "$1 is an odinary file-display?" choice
if [ "$choice" == "y" ];then
if [ -r "$1" ];then
cat "$1"
else
echo "Sorry, $1 has no read permission"
fi
else
exit 1
fi
elif [ -d "$1" ];then
read -p "$1 is a directory. Do you want a long list?" choice
if [ "$choice" == "y" ];then
ls -al "$1"
else
exit 1
fi
elif [ -c "$1" -o -b "$1" -o -p "$1" -o -S "$1" -o -h "$1" ];then
echo "The file you have entered is a special file"
else
echo "Invalid file or directory"
fi
fi

OUTPUT:

A1.sh is an odinary file-display?y


//Contents of the file
EX NO: 8 WORKING WITH SHELL SCRIPTS -3
DATE: 12.09.2023

1. Write a shell script that checks if an argument string contains anything so that the script will stop
executing if the argument string is empty.

CODE:
If [ -n $1 ]
then
echo “String not empty”
else
echo “String empty”
fi

COMMAND:
bash ex8-1.sh

OUTPUT:
String empty

COMMAND:
bash ex8-1.sh a1.sh

OUTPUT:
String not empty

2. Write a shell script to find the length of a given string.

CODE:
read string
length=$(#string)
echo “Length: $length”

COMMAND:
bash ex8-2.sh

OUTPUT:
Edith
Length: 7

3. Write a shell script to reverse a string.

CODE:
if [ $# -gt 0 ]
then
var = $1
reverse = $(echo $var | rev)
echo “Reversed string: $reverse”
else
echo “Enter an argument”
fi
COMMAND:
bash ex8-3.sh edith

OUTPUT:
ahuG

4. Write a shell script to generate the following series:

1, 3, 2, 4, 3, 5, 4, 6, . . . , 100

CODE:
for ((i=1,j=3;i<=100,j<=100;i++,j++))
do
echo “$i,$j”
done

COMMAND:
bash ex8-4.sh

OUTPUT:
1, 3, 2, 4, 3, 5, 4, 6, . . . , 100

5. Write a shell script which will ask your full name (First name, Middle name, Last Name),
Year of Birth and Login name. The script should display the following
Welcome (Your full name)
Good Morning (Your first name)
Your Age is
Your user id is
Your home directory is
Number of Processes currently Running
Day of week is
Current time is
EX NO: 9 WORKING WITH SHELL SCRIPTS -4
DATE: 19.09.2023

1. Write a shell script to find the sum of digits of a number which is passed as a command line
argument.

CODE:

OUTPUT:

2. Write a shell script to reverse a given number which is passed as a command line argument.
CODE:

CODE:
EX NO: 10 WORKING WITH FILE COMMANDS
DATE: 20.09.2023

1. Under your current directory, display the names of all files and directories using the find command.
2. Create a data file called emp.dat which contains, empno,name,deptno,location and year of birth. Write a
shell script to display
3. the name, year of birth and location of the employee by accepting the employee
4. number as input. (Use While loop/For loop)

5. List the names of only the ordinary files in the directory subject and its subdirectories, under your
current working directory.

6. Find a count of the ordinary files in the directory subject.(use find command)

7. Using ls command, display the number of ordinary files in the directory subject and compare it with
the result of #3.
8. Display the names of all files and directories (and their files) in the parent directory of your HOME
directory.

9. List the names of all directory files in your HOME directory.

10. Display the names of all files starting with

jan.COMMAND:
find . –type f –name “jan*”

OUTPUT:
Jan.sh

11. Display the names of the files which end with 84 or

85.COMMAND:
Find . –type f –name “*84” –o –name “*85”

OUTPUT:
Ex84 ex385
12. List the files in the directory subject which have been modified in exactly 9 days.
13. List the files in the directory subject which have been modified in more than 7 days.

14. List the files in the directory subject which have not been modified for the past 7 days.

15. Give a command to display the content s of all ordinary files in the current directory and all its
subdirectories.

COMMAND:
find . –type f –exec cat {}\;
OUTPUT:
Contents of all files are displayed

16. Give a command to remove all ordinary files with names ending in ‘o’ from the subdirectory 2016
and its subdirectories.

COMMAND:
find 2016 –type f –name “*o” –exec rm {}\;

OUTPUT:
Files are removed
17. Give a command to copy all ordinary files with names ending in 16 from the directory 2016 to the
directory backup which is under your current working directory.

COMMAND:
cp –r 2016/*16 backup/

OUTPUT:
Files are copied

18. Give a command to remove all ordinary files from the directory 2015 (and from its subdirectories)
which have been modified 7 days from the current day, with confirmation from the user before
removal of each file.

COMMAND:
Find 2015 . –type f –ctime –T –exec rm –i {}\;

OUTPUT:
Files are removed

19. Using find command remove all .bak files under the directory subject and its subdirectories except
the file data.bak.

COMMAND:
find subject . –type f –name “*.bak” . –name “data.bak” –exec rm{}\;

OUTPUT:
data.bak alone present

20. Give the command to compare the files x.c and y.c

21. Identify the directories under your HOME directory in which the files whose names begin with
prog exist.

COMMAND:
Find ~/ . –type –name “prog*” –exec dirname {}\;

OUTPUT:
program

22. Locate the files prog3 under your HOME directory. (Assume the file is found in 2 directories)

23. Use the cmp command to find out if the two files are the same or differ. If they are same, delete
that file which has been modified in exactly 1 day.
COMMAND:
Cmp file1.txt file2.txt && find . –type f –name “file1.txt” –ctime -1 –exec rm {}\;

OUTPUT:
File removed

21.A file called empcodes contains a list of all Employee codes sorted in numeric order. Another file
called empinc contains a list of Employee Codes of all employees who are to receive incentives in the
current month. This file is sorted code-wise. How would you display a list of Employee codes of all
employees who are not receiving incentive in that month?

COMMAND:
Comm. -23 empcodes empinc

OUTPUT:
LIST OF EMPLOYEES DISPLAYED

22. Give a command to compare the file category with the Standard input.

COMMAND:
cmp category

OUTPUT:
comparission

23. Give a command to compare the file fruits.txt with the standard input and display the lines
common to both.

COMMAND:
cmp –fruits.txt

OUTPUT:
Common files displayed

24. Display the lines which are unique from the file trans.dat

COMMAND:
Sort trans.dat | uniq –u

OUTPUT:
File compared

25. Display duplicate lines from the file trans.dat

COMMAND:
sort trans.dat | uniq -d
OUTPUT:
Duplicate lines

26. Display the count of each line from the file trans.dat

COMMAND:
Sort trans.dat | uniq –c

OUTPUT: 5
EX NO: 11 WORKING WITH FILTERS- grep
DATE: 21.09.2023

1. Create a file called “empdata”, whose fields are


Employee last name
Employee first name
Employee code
Permanent Address
Department code
Grade
Years of experience
Date of birth
Basic Pay

~ is the field separator, insert sample records of your own, and perform the following
operations on it.

a. Give the command that would print records of all employees whose Last name begins
with S.

b. Give the command that would print out the records of all employees whose basic pay is
between Rs 15000 and Rs 20000

c. Give the command that would print out the records of all employees born in 1985.

d. Give the command to get the records of all employees in Grade S1 and S2.

e. Give the command that would print out the records of all employees in Accounts
department and in Grade E.
f. Give the command that would print out the records of all employees in RND department
with three years of experience.
g. Give command that would print out the records of all employees whose employee code is
between 3010 and 3059

h. Give the command that will display the records of all employees from Chennai.

i. Display the details of all employees whose first name is “Nirmala”

j. Give the command that will store the records of all employees from Bombay in a file
called Bombaydata.
EX NO: 12 WORKING WITH FILTERS- sort
DATE: 26.09.2023

1. Create a file called “emp.dat”, whose fields are

Employee last name


Employee first name
Employee code
Permanent Address
Department code
Grade
Years of experience
Date of birth
Basic Pay
Fields are separated by : character
Create another file called trans.dat whose fields are
Transaction number
Customer number
Customer code
Product code of product sold to customer
Number of units sold
Rate per unit
Fields are separated by: character, insert sample records of your own in both the databases,
and perform the following operations on them

a. Give the command to display the records of all employees born in the year 1980 in sequence
of employee code from emp.dat.

b. Give the command to display the records of all employees in the department RND with 3 to 7
years of experience in sequence of years of experience.

c. Give command to display records of all employees who are not in the department of MKT,
sorted by department code within which by Grade.

d. Give command to sort the file trans.dat by customer code and display the records for Product
numbers P01 to P09.

e. Give the command to sort and display the file trans.dat by Product number

f. Give the command to display the number of transactions for the Product number P02.

You might also like