1. Ministry of communications and Information Technology
Information Technology Institute
UNIX Department
ISO 9001
Lab 4
1- List the available shells in your system.
2- List the environment variables in your current shell.
3- List all of the environment variables for the bash shell.
4- What are the commands that list the values of all the variables?
5- What are the commands that list the value of a specific variable?
6- Display your current shell.
7- What is the difference between startup files and initialization files?
8- State the startup files of: sh, ksh, csh, bash.
9- State the initialization files of: sh, ksh, csh, bash.
10- Edit in your profile to display date at login and change your prompt permanently.
11- Execute the following command :
echo then press enter
Notice the prompt what is that and how can you change it.
12- Create a bash shell alias named ls for the “ls –l” command
13- List the user commands and redirect the output to /tmp/commands.list
14- Count the number of user commands
15- Get all the users names whose first character in their login is ‘g’.
16- Get the logins name and full names (comment) of logins starts with “gu”.
17- Save the output of the last command sorted by their full names in a file.
18- Write two commands: first: to search for all files on the system that named .bash_profile.
Second: sorts the output of ls command on / recursively, Saving their output and error in 2
different files and sending them to the background.
19- Display the number of users who is logged now to the system.
20- Display lines 7 to line 10 of /etc/passwd file
21- What happens if you execute:
cat filename1 | cat filename2
ls | rm
ls /etc/passwd | wc –l
22- Issue the command sleep 100.
23- Stop the last command.
24- Resume the last command in the background
25- Issue the jobs command and see its output.
26- Send the sleep command to the foreground and send it again to the background.
27- Kill the sleep command.
28- Display your processes only
29- Display all processes except yours
30- Use the pgrep command to list your processes only
31- Kill your processes only.
Information Technology Institute
241 Alharam Street
Giza 12111, Egypt.