SlideShare a Scribd company logo
1 of 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.

More Related Content

What's hot

Project 2 - how to compile os161?
Project 2 - how to compile os161?Project 2 - how to compile os161?
Project 2 - how to compile os161?Xiao Qin
 
Project 2 How to modify os161: A Manual
Project 2 How to modify os161: A ManualProject 2 How to modify os161: A Manual
Project 2 How to modify os161: A ManualXiao Qin
 
Ansible - simple it automation
Ansible - simple it automationAnsible - simple it automation
Ansible - simple it automationLarry Nung
 
Project 2 how to modify OS/161
Project 2 how to modify OS/161Project 2 how to modify OS/161
Project 2 how to modify OS/161Xiao Qin
 
Using the command line on macOS
Using the command line on macOSUsing the command line on macOS
Using the command line on macOSAdamFallon4
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Linux shell env
Linux shell envLinux shell env
Linux shell envRahul Pola
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atdAcácio Oliveira
 
Yum server ( FTP Server )
Yum server ( FTP Server ) Yum server ( FTP Server )
Yum server ( FTP Server ) MOHSIN HASAN
 
Easiest way to start with Shell scripting
Easiest way to start with Shell scriptingEasiest way to start with Shell scripting
Easiest way to start with Shell scriptingAkshay Siwal
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scriptingVIKAS TIWARI
 
Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commandsHimani Singh
 
Nambafood bot - Food ordering
Nambafood bot - Food orderingNambafood bot - Food ordering
Nambafood bot - Food orderingAhmedAsadov
 
Cloning database using srdf copy
Cloning database using srdf copyCloning database using srdf copy
Cloning database using srdf copyAmit Vashishth
 

What's hot (20)

Project 2 - how to compile os161?
Project 2 - how to compile os161?Project 2 - how to compile os161?
Project 2 - how to compile os161?
 
Project 2 How to modify os161: A Manual
Project 2 How to modify os161: A ManualProject 2 How to modify os161: A Manual
Project 2 How to modify os161: A Manual
 
Autotools
AutotoolsAutotools
Autotools
 
Ansible - simple it automation
Ansible - simple it automationAnsible - simple it automation
Ansible - simple it automation
 
Project 2 how to modify OS/161
Project 2 how to modify OS/161Project 2 how to modify OS/161
Project 2 how to modify OS/161
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Using the command line on macOS
Using the command line on macOSUsing the command line on macOS
Using the command line on macOS
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Linux shell env
Linux shell envLinux shell env
Linux shell env
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atd
 
Yum server ( FTP Server )
Yum server ( FTP Server ) Yum server ( FTP Server )
Yum server ( FTP Server )
 
Easiest way to start with Shell scripting
Easiest way to start with Shell scriptingEasiest way to start with Shell scripting
Easiest way to start with Shell scripting
 
40 important command for linux
40 important command for linux40 important command for linux
40 important command for linux
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commands
 
Nambafood bot - Food ordering
Nambafood bot - Food orderingNambafood bot - Food ordering
Nambafood bot - Food ordering
 
Bot
BotBot
Bot
 
Cloning database using srdf copy
Cloning database using srdf copyCloning database using srdf copy
Cloning database using srdf copy
 
Bpce livraison
Bpce livraisonBpce livraison
Bpce livraison
 

Similar to unix-OS-Lab-4.doc (20)

intro unix/linux 02
intro unix/linux 02intro unix/linux 02
intro unix/linux 02
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linux Workshop , Day 3
Linux Workshop , Day 3Linux Workshop , Day 3
Linux Workshop , Day 3
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
 
Linux training
Linux trainingLinux training
Linux training
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
IntroCommandLine.ppt
IntroCommandLine.pptIntroCommandLine.ppt
IntroCommandLine.ppt
 
IntroCommandLine.ppt
IntroCommandLine.pptIntroCommandLine.ppt
IntroCommandLine.ppt
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linux
LinuxLinux
Linux
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Examples -partII
Examples -partIIExamples -partII
Examples -partII
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
UNIX Basics and Cluster Computing
UNIX Basics and Cluster ComputingUNIX Basics and Cluster Computing
UNIX Basics and Cluster Computing
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3
 

More from ismailaboshatra (20)

fatma.docx
fatma.docxfatma.docx
fatma.docx
 
Call+for+Papers+2011.pdf
Call+for+Papers+2011.pdfCall+for+Papers+2011.pdf
Call+for+Papers+2011.pdf
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
dt.docx
dt.docxdt.docx
dt.docx
 
dt.docx
dt.docxdt.docx
dt.docx
 
dt.docx
dt.docxdt.docx
dt.docx
 
Answers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docxAnswers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docx
 
Answers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docxAnswers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docx
 
lec1.docx
lec1.docxlec1.docx
lec1.docx
 
lec4.docx
lec4.docxlec4.docx
lec4.docx
 
QM17025+Rev0.1-05May2011.doc
QM17025+Rev0.1-05May2011.docQM17025+Rev0.1-05May2011.doc
QM17025+Rev0.1-05May2011.doc
 
lec2.docx
lec2.docxlec2.docx
lec2.docx
 
lec5+.docx
lec5+.docxlec5+.docx
lec5+.docx
 

unix-OS-Lab-4.doc

  • 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.