Documente Academic
Documente Profesional
Documente Cultură
By
BALA KRISHNAN M
gdfdgdfdh fhfjdfhjgfh gfgjdfhgjd hffkkfjgkfj
11-1
Background on Linux
Version of UNIX Linus Torvalds Creator of Linux Open Source Operating System Free Software Source Code Available
11-2
Unix Architecture
11-3
What is Linux?
A Fully-networked 32/64 bit Unix-like Operating System A famous open source Version of UNIX Operating System Free to use, distribute, modify under a compatible licence Produced by a large developer and user community Multi-user, Multitasking, Multiprocessor Has the X Windows GUI Runs On Multiple Platforms Includes the Source Code
11-4
11-5
11-6
History of Linux
In 1969, A&T Employees at Bell Labs developed the unix operating system Features - Multi-threaded, multi-user - Extensibly Networkable (Support TCP/IP/IP) - Supported on Many systems (but not PCs) Was originally free and source code available By Late 1980s it was commercial, expensive, non available source and came in many flavors
11-7
Full operating system Works well on a variety of hardware, including older hardware You can adapt it to fit your needs Thousands of programs available Secure by design Supports a wide range of programming languages Scalable
11-8
75% of respondents were already using Linux and another 14% were evaluating it 43% of all web sites use Linux servers, running the Apache Web server
11-9
11-11
Linux kernel for free Kernel is central component Kernel can be customized to users needs
11-12
Linux Distributions/Flavors
Ubuntu CentOS Debian GNU/Linux Mandrake Linux Red Hat Linux Fedora Linux Slackware SUSE Linux TurboLinux ALT Linux Lycoris Linux
11-13
11-14
File system
.
the current directory .. the parent of the current directory So if I'm at /home/bala and wish to specify the path above in a relative fashion I could use: ../condron/source/xntp Every directory and file is listed in its parent directory. A directory is a file that contains a table listing the files contained within it, giving file names to the inode numbers in the list.
UFS UNIX EXT2, EXT3, EXt4 LINUX FILE SYSTEM SOLARIS UFS ..CURRENTLY ZFS UNDER PROCESS
11-15
11-16
Store drives Accessing data using folders Root directory: - beginning of file system
11-19
Subdirectories
Examples of Subdirectories /root /home /devDevice /etc /etc/init.d directory, starting point of the directory tree (private) directories of users files that represent hardware components Important files for system configuration Boot scripts/usr/binGenerally accessible programs
11-20
User Accounts
Add user # useradd -c des" -d /home/<name> -m -s "/usr/bin/ksh" <name> # change group for jsmith #chgrp <gname> <gname> # change <useraccount> password # passwd <accountname> # change <username> description usermod -c <username>" <username> User passwords are maintained in /etc/passwd
11-23
Linux Permissions
Permission sequence found at the beginning of a directory listing (first 10 characters): d rwx r-x r-x The first character represents whether the listing is a directory. If it is a directory, a d will appear in the first character; otherwise, you should normally see a dash (-). d rwx r-x r-x Read Permission 1st position in a triplet: r stands for Read; grants permission to view the contents of a file or directory (Value is r or -). Write Permission 2nd position in a triplet: w stands for Write; grants permission to modify a file or the contents of a directory (Value is w or -). Execute Permission 3rd position in a triplet: x stands for eXecute; grants permission to run an application or open a directory (Value is x or -).
11-24
Linux Permissions
Octal Value
4 -Read 2 Write 1- Execute
Permissions r r r r w w x x
Octal 4 5 6 7
Typically, directories and executable files are given 755 permissions While other files are given 644 permissions Unix permission Chmod -- To modify the file permission Chown -- To change the ownership Chgrp -- To change the group Examples: chmod 777 <filename> chgrp R <group> <folder name> chown <username> <filename>
11-25
Finding Files
How do we find a file with the name kernel ? $ find /usr/src name kernel How do we find files with extension mp3? $ find / -name *.mp3 How do we find which files in our home directory were changed in the past two days ? $ find ~ -mtime 2 How do we find files accessed in the last 2 hours? $ find ~ -amin -120 How do we find files with size greater than 1MB, but less than 2 MB ? $ find / -size +1024 size 2048 How do we find files in the current directory newer than a file test? $ find ~ -newer test
11-26
Disk free
me Tells how long the system has been up and running orming the above command would display something similar to the below example. 9:07 up 18 days, 4:15, 78 users, load average: 0.00, 0.06, 0.14 ent timeStatusDays upHours /min up em load averages for the past 1, 5, and 15 minutes.
Top is a tool that gives you a continual status on the processes running on system such as current uptime, memory usage, swap usage, system load age,CPU usage,processes.
11-27
Crontab
What is crontab ? cron is a unix, solaris utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon. These tasks are often termed as cron jobs in unix . Crontab Commands crontab -e Edit your crontab file, or create one if it doesn't already exist. crontab -l Display your crontab file. crontab -r Remove your crontab file. crontab -v Display the last time you edited your crontab file. (This option is only available on a few systems.) Crontab syntax :A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval. * * * * * command to be executed - - - - | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +------- month (1 - 12) | | +--------- day of month (1 - 31) | +----------- hour (0 - 23) +------------- min (0 - 59)
11-28
11-29
LINUX OS Monitoring
Where do you check for operating system error messages ? Linux Solaris AIX HP Unix /var/log/messages /var/adm/messages /var/adm/messages /var/adm/syslog/syslog.log
List all common used run levels and their differences Init 0 All the services , process,file system are properly unmounted and shutdown Init 1 Single user mode (Maintenance Mode) Init 2 Multi-user mode without NFS Init 3 Multi-user mode with NFS Init 4 Not used Init 5 Shutdown with power off Init 6 Reboot Init (s S) Single user mode #Who r will display the current run level.
11-30
11-31
LINUX VS WINDOWS
11-32
Financial Differences
COST
LINUX WINDOWS Online Downloads Retail Price, CD Free $50 Not Available $300
Cost for Businesses -Companies have to spend millions for licenses for ever individual windows computer -For Linux companies dont have to spend anything
11-33
Technical Differences
Open Source, users can edit its OS and design new OS Comes from Different Companies Flavors Red Hat, Suse, Mandrake, Ubuntu Keeping up to date - By Upgrading, Linux upgrades faster than Windows Compatibility - Linux upgrades faster than Windows - Linux is Backward Compatible unlike Windows Licensing Freedom On-line Peer Support Support Dynamic Caching and Multi-user Support
11-34
End-User Differences
Proprietary vs. Open Source Windows is a Proprietary Technology Applications will only work on Windows Linux Open Source Complete information needed for download Technical help Available on Internet (user must be comfortable with UNIX system)
11-35
11-36
11-37
Why is it Significant?
Growing Popularity Powerful - Runs on Multiple Hardware Platforms - Users like its speed and stability - No requirement for latest hardware Its Free - Licensed Under GNU-GPL - Vendors are distributors who package Linux
11-38
Conclusion
When is it best to use Linux and when should some other operating system be preferred? It all depends on the user
11-39
Questions?
11-40