Unix environment [autosaved]
-
Upload
er-mittinpreet-singh -
Category
Education
-
view
176 -
download
0
Transcript of Unix environment [autosaved]
![Page 1: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/1.jpg)
UNIX ENVIRONMENT
DESIGNED BY :MITTINPREET SINGH NAYYARVIKAS K PRASAD
![Page 2: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/2.jpg)
Introduction to Unix History of Unix Salient features of Unix SHELL Distributions Installing VMware Basic Unix Commands Q&A References
Roadmap
![Page 3: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/3.jpg)
INTRODUCTION TO UNIX
A multi-tasking and multi-user Operating System Developed in 1969 at AT&T’s Bell Labs by
Ken Thompson (Unix) Dennis Ritchie (C) Peter Neumann suggested their project is given the name UNIX.
It is a portable operating system that is designed for both efficient multi-tasking and multi-user functions. Its portability allows it to run on different hardware platforms. It was written is C and lets user do processing and control under a shell.
Unix is case sensitive
![Page 4: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/4.jpg)
HISTORY OF UNIX
The history of UNIX starts from the project MULTICS (Multiplexed Information and Computing Service) in 1965 conducted by AT&T,GE & MIT funded by DOD(Dept. of Defense)USA.
The main aim to develop UNIX was to develop and operating system that could serve large Community of users and allow them to share data if needed be. This never to be enterprise called MULTICS
In 1969, ken Thompson and Dennis Ritchie released the first version of Multiuser System Called UNIX. At that time Unix was not portable. To remedy this Ken Thompson created a new language “B” but language lacked some aspects. So in 1973 UNIX was Rewritten in “C” Language by Ken Thompson. C Language was developed by Dennis Ritchie.
![Page 5: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/5.jpg)
SALIENT FEATURE OF UNIX
Multiuser Capability Multitasking Capability Communication Security Portability
![Page 6: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/6.jpg)
What is SHELL
A shell acts as an interface between the user and the system. As a command interpreter, the shell takes commands that we give interpret the command and then conveys them to the kernel which ultimate executes them. You can imagine kernel as a monarch who is the overall control of everything where as the shell as its emissary
![Page 7: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/7.jpg)
TYPES Of SHELLS BOURNE SHELL Steve Bourne Creation, known after him Bourne Shell is the most popular. It comes with every Unix System C SHELL This shell is a hit with those who are seriously into Unix programming, created by Bill Joy, it had two advantage over Bourne Shell. It allows aliasing of commands the other one is history feature. KORN SHELL it is not widely used but is a powerful and superset of Bourne shell, created by David Korn.OTHER SHELLS ZSHELL BASH SHELL
![Page 8: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/8.jpg)
SHELL Prompt of Ubuntu
To open the terminal in Ubuntu use can use the shortcut : ctrl + Alt + T
![Page 9: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/9.jpg)
DISTRIBUTIONS Linux
Minix FreeBSD OpenBSD NetBSD GNU Hurd Solaris SCO Unix
ConclusionThere are many free Unix like operating systems floating around out there and most if not all of them can be found quickly with a simple internet search. The OS's I have listed above are, in my opinion, the best. They are also all available to use for free unlike most of the others.
http://www.distrowatch.com
![Page 10: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/10.jpg)
Ubuntu Distribution
![Page 11: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/11.jpg)
BASIC COMMANDS
This command returns your username. Sounds useless, but isn't. You may need to find out who it is who forgot to log out somewhere, and make sure *you* have logged out.Example: whoami
whoami
![Page 12: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/12.jpg)
![Page 13: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/13.jpg)
Man - Manual
In unix online help has been available since the beginning. In order to access all the available help, you have to tell the shell where to look for online help pages. This information is specified using the MANPATH. A common setting is:MANPATH=/usr/man:/usr/share/manWhen you use the man command to request online help as follows, the man command searches every directory given in the MANPATH for an online help page corresponding to the topic you have requested.
$man whoIn this case it looks for the online help page corresponding to the who command
![Page 14: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/14.jpg)
A snapshot of $man who
![Page 15: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/15.jpg)
Passwd
To change the password of the user we use passwd command Which ever password we create Unix stores it in /etc/passwd file. The password actually stored in Shadow File which is located in
etc/shadow. We can even cat this file on the screen lets you change your password, which you should do regularly (at
least once a year).$cat /etc/passwd
![Page 16: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/16.jpg)
![Page 17: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/17.jpg)
![Page 18: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/18.jpg)
cal - Calender
Display a conveniently-formatted calendar from the command line.In general, if no options are given, cal displays the current month at the command line.
![Page 19: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/19.jpg)
![Page 20: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/20.jpg)
![Page 21: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/21.jpg)
Touch
With this command we will learn how to create files With this we can create many files without storing anything in
the files. The size of the file is ZERO Bytes Q Why do we use touch ?A when we want to create several files quickly we use touch command.
Example: touch dinesh heena siddhi jatin
![Page 22: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/22.jpg)
![Page 23: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/23.jpg)
cat- concatenate
If we want to store a few lines in a file while creating it we use cat command. One’s you are through with typing content press the keys : Ctrl + d . In Unix Ctrl + d indicates the EOF(End of File)
To display the content of file under DOS we use type command. To see content of file we use the following command Umask 0022Example : cat >dheeraj - for creating filecat < dheeraj or cat dheeraj - will show you the output
![Page 24: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/24.jpg)
![Page 25: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/25.jpg)
cp- copyCopies Files from one Directory or location to another file or directory.Cp command takes the liberty to overwrite the file to the destination it will not even give a warning.
Example:$cp abc.c xyz.c mycfile.txt$cp abc.c xyz.c $cp /usr/aa16/chapter1 /usr/aa16/newbook/chap1
The last command when executed it will copy the chapter1 file to /usr/aa16/newbook. When copied to this directory it would have the name chap1 instead of chapter1
![Page 26: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/26.jpg)
![Page 27: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/27.jpg)
rm - remove
Remove Files from directory. It is wise to use the option rm -i, which will ask you for confirmation before actually deleting anything.
![Page 28: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/28.jpg)
![Page 29: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/29.jpg)
Ls-list
ls --- lists your files ls -l --- lists your files in 'long format', which contains lots of useful information, e.g. the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified. ls -a --- lists all files, including the ones whose filenames begin in a dot, which you do not always want to see. There are many more options, for example to list files by size, by date, recursively etc.
![Page 30: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/30.jpg)
![Page 31: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/31.jpg)
![Page 32: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/32.jpg)
mv - move or rename
moves a file (i.e. gives it a different name, or moves it into a different directory
![Page 33: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/33.jpg)
![Page 34: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/34.jpg)
Chmod- change mode
![Page 35: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/35.jpg)
![Page 36: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/36.jpg)
mkdir – make directory
![Page 37: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/37.jpg)
![Page 38: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/38.jpg)
cd – change directory
![Page 39: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/39.jpg)
![Page 40: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/40.jpg)
Pwd- print working directory
![Page 41: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/41.jpg)
![Page 42: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/42.jpg)
rmdir – remove directory
![Page 43: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/43.jpg)
![Page 44: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/44.jpg)
logname
![Page 45: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/45.jpg)
![Page 46: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/46.jpg)
uname
![Page 47: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/47.jpg)
![Page 48: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/48.jpg)
who
![Page 49: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/49.jpg)
![Page 50: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/50.jpg)
tty – tele terminal
![Page 51: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/51.jpg)
ulimit
![Page 52: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/52.jpg)
![Page 53: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/53.jpg)
sort
![Page 54: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/54.jpg)
![Page 55: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/55.jpg)
wc
![Page 56: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/56.jpg)
![Page 57: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/57.jpg)
Head
![Page 58: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/58.jpg)
![Page 59: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/59.jpg)
tail
![Page 60: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/60.jpg)
![Page 61: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/61.jpg)
more
shows the first part of a file, just as much as will fit on one screen. Just hit the space bar to see more or q to quit. You can use /pattern to search for a pattern.
![Page 62: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/62.jpg)
![Page 63: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/63.jpg)
less
![Page 64: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/64.jpg)
![Page 65: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/65.jpg)
date
Shows the current date and time.
![Page 66: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/66.jpg)
![Page 67: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/67.jpg)
References
Unix Shell Programming By Yashavant Kanetkar. Unix Concept and Application by Sumitabha Das. http://www.tutorialspoint.com/unix https://
www.youtube.com/watch?v=nVt3Rst-2H8&list=PL7B7FA4E693D8E790
![Page 68: Unix environment [autosaved]](https://reader031.fdocuments.net/reader031/viewer/2022022123/589f99391a28ab1b198b6c51/html5/thumbnails/68.jpg)
Q&A SESSION