Overview of Linux - PowerPoint PPT Presentation

1 / 51
About This Presentation
Title:

Overview of Linux

Description:

– PowerPoint PPT presentation

Number of Views:70
Avg rating:3.0/5.0
Slides: 52
Provided by: hom4205
Category:
Tags: linux | overview

less

Transcript and Presenter's Notes

Title: Overview of Linux


1
Overview of Linux
  • Kernel
  • Core of the operating system
  • Its primary functions are
  • execution of processes
  • handling memory management
  • Provide a portable interface through which
    programs may communicate with hardware.
  • Current Linux kernel is 2.2.
  • Multi user system
  • True Multitasking
  • Its FREE.

2
ROOT
  • SUPERUSER
  • Similar to administrator in NT
  • All powerful user created first when Linux is
    installed.
  • Can read and write, from and to any file in the
    system
  • Can execute programs regular users can not
  • Not wise to experiment as ROOT in any Unix/Linux
    environment.

3
Logging in
  • At the login prompt Your user name
  • At the password Your password
  • Once you have logged in successfully, you are now
    in the SHELL.

4
SHELL
  • Simplistically, SHELL is the prompt and the
    environment that you see when you log in.
  • More importantly, it is a command interpreter
    that interfaces between the operating system and
    the user.
  • For example, you wanted to run a command ls to
    list the directory, command interprets the
    command and calls the ls program.
  • Linuxs default shell is BASH short for Bourne
    again shell.
  • Bourne again shells predecessor isyou guessed
    it, the Bourne shell.

5
SHELL
  • Some types of shells
  • BASH (enhanced Bourne Shell which is on eof the
    original UNIX shells)
  • C Shell and TCShell
  • Z Shell
  • Korn Shell
  • You are not bound by BASH. If you would like, you
    can run any shell of your liking.

6
SHELLS
  • Devices are in reality of Linux/Unix appear as
    files.
  • For example, your printer is a file in Shell.
  • Your disks are a file in Shell.
  • As a result, you can Input and Output can be
    redirected to or from any files appropriate.
  • It can also be used as a programming language.
  • You can write shell functions/programs of your
    choosing for your convenience.
  • Think of it as being similar to a batch file in
    the Windows world.

7
SHELL
  • Job Control
  • Shell allows the user to switch between multiple
    tasks. Its similar to when in windows, you can
    swap between multiple screens that you have
    opened up.

8
Login Process
  • Sequence of Logon Process-init first
    process when linux starts-getty init starts
    for each active terminal-login getty starts
    for each logon attempt-bash login starts a
    shell- D exit shell exits and spawns another
    getty process

9
Process
  • Creating a Process more .profile-userid
    student inherited-directory
    /home/student inherited-program more

10
Changing Password
  • Lets change your password once you have logged
    in for security purposes.
  • Type passwd
  • Make sure your password is at least 6 characters
    long.
  • Also your password should have have at least 2 of
    3 of these. Upper case letters, lower case
    letters and digits.
  • To Unix/Linux, U and u is different. It is case
    sensitive.
  • Also make sure you dont choose a password
    similar to your login.

11
Keystrokes to keep in mind
  • CONTROL-H, deletes a character at a time.
  • CONTROL-W, deletes a word at a time.
  • CONTROL-U, deletes a line at a time.
  • CONTROL-C, aborts program execution
  • CONTROL-R or L, Refreshes screen

12
Commands
  • MAN
  • Short for manual
  • Great utility to get the syntax of utilities.
  • To use, type man followed by the command.
  • For example, man ls

13
MAN
  • Organization of the man pages
  • Man pages are divided into sections
  • User-level commands and applications
  • System calls and kernel error codes
  • Library calls
  • Device drivers and network protocols
  • Standard file formats
  • Miscellaneous files and documentations
  • Games and demonstrations
  • System administration commands

14
Ask the man
  • Man k
  • Searches for keywords
  • Info keyboard based
  • Xman used under xwindows for GUI based
    manuals

15
Shell Command LS
  • Displays the files and directories within the
    shell.
  • Lists alphabetically by default
  • -a displays information about all the files in
    the working directory
  • -F displays a slash /, after each directory, an
    after each executable.
  • -l displays in long seven column format
  • -t displays the list of files in the order by the
    time of last modification.

16
Wild cards
  • Called metacharacters
  • ? Good for one character
  • Ls test? Would list test0, test1, test2 and
    testa, but not testab
  • is covers all characters
  • Ls test would should show all test files
    including testab
  • matches any character within the .
  • Ls test1ab would list test1, testa, but not
    others
  • Ls test0-2 would also list test0, test1 and
    test2.
  • Ls testa-z. Test0-9 would list test a through
    z and test 0 through 9.

17
CAT
  • Joins or displays files
  • Cat myfile, would show the contents of a a file
    called myfile.
  • Cat myfile youtfile gt ourfile would join the
    other two files to create ourfile

18
RM
  • RM command is used to delete a file.
  • Rm i makes it interactive.
  • Rm r makes it so that when you delete a
    directory, all subdirectories within it gets
    deleted as well.

19
CP
  • Copies one or more files.
  • Cp p preserves each files owner, group,
    permissions and modification dates when copying
    it.
  • Cp r used when copying a directory. It copies
    the contents of a directory including the
    subdirectories.
  • Cp I Interactive
  • Cp b backs up a file that is going to be
    overwritten as a result of cp. The backed up file
    is noted with a .

20
MV
  • Moves or renames one or more files.
  • Mv u If move would overwrite an existing file
    but the target is newer than the source file,
    file is not overwritten.
  • Mv b makes a backup copy

21
MKDIR
  • Creates directories
  • Mkdir directory name

22
Cal
  • Calendar- cal month year (enter value)
    cal 02 2000 - Display calendar for Feb
    2000
  • Datedate ( no values) date - display
    current system date

23
Aliases
  • Creating your own set of commands
  • Shell differ in syntax
  • alias dir ls al (csh)
  • alias dirls al (bash ksh) The dir
    command now acts like ls alalias ( with no
    command list all the aliases)
  • Unalias (alias name)will undo the alias

24
redirection
  • I/O redirectionLinux commands require input and
    output
  • Stdin standard input (keyboard)
  • Stout standard output (montior)
  • Redirection allows other means for output
  • gt (redirect output to a file) command gt file
  • gtgt(redirect output and append to a file)
    command gtgt file

25
redirection
  • Redirection allows other means for input
  • lt (redirect input from a file) command lt file
  • Include sdterr (standard errors) in output file
  • gt (redirect output and errors to a file)
  • command gt file (used to debug shell
    scripts)

26
Pipelines
  • Redirects output to another process (commands)
  • send stdout to another process command-a
    command-b
  • Examplewho sort Display who is on
    the system, sorted
  • alphabetically
  • who sort gt users Display who is
    on the system, sorted
  • alphabeticaly, and redirects the
    output to a file

27
PASTE
  • Joins corresponding lines from files
  • Paste file1 file2 will join the two in columnar
    format in the output
  • Paste d any character file1 file2 will add the
    delimiters to separate the files.

28
TOUCH
  • Updates a file modification time.
  • Also useful for creating an empty file.
  • If file1 is dated Jan 11, 8am, if a command touch
    is used (touch file1), the modification time
    would be updated to the present date and time.

29
GREP
  • Searches for pattern for files
  • Grep pattern file would list the line in that
    file with that specific pattern.
  • Grep v pattern file will do the reverse of the
    above and list those lines without the pattern.
  • Grep pattern would search all files in the
    directory with that pattern.
  • Grep w pattern file would search only for whole
    words that fit this pattern.
  • Grep i pattern file would make the search case
    insensitive.

30
HEAD
  • Displays the beginning of a file
  • Default is it displays the first 10 lines of the
    eleven file.
  • -n where n is a number and it shows only up to
    specified.

31
TAIL
  • Displays the last parts of the file
  • Default is 10 lines.
  • Tail 3 file would display from the bottom, last
    3 lines.

32
SORT
  • Sorts and merges files
  • -n sorts numerically
  • Default sorts alphabetically
  • -f option makes the sort case insensitive
  • 1 skips one field to sort
  • -b ignores a leading space

33
Compression Archiving Encoding
  • Compression To extract white-space from a file
  • Archiving to store multiple file into a single
    file
  • Encoding Encryption from Binary to Ascii
    scrammble file for security

34
Tar
  • Tar Tape archive and retrieval
  • -c create new archive
  • -x extract files in an archive
  • -t list files stored in an archive
  • -v run in verbose mode
  • -f next argument id the file or device to write
    to
  • -z compress files automatically (gzip)
  • -u add files to an existing archive
  • -M multi-volume floppies

35
Tar
  • Able to bundle files into an archive
  • Tar cvf /tmp/save.tar .- save the contents of a
    directory to a file
  • Tar cvfM /dev/fd0 .- save the contents of a
    directory to a multi-volume floppy
  • Tar cvf /dev/rmt0- save the contents of a
    directory into a tape archive

36
Tar
  • Extracts files from an archive
  • Tar xvf /tmp/save.tar-extracts the contents of
    a file archive into the current directory
  • Tar-xvfM /dev/fd0 .- extracts the contents of a
    file archive into the current directory
  • Tar xvf /dev/rmt0 .-extracts the contents of a
    tape archive into the current directory

37
Gzip
  • Gzipcompress a single file and add suffix gz
  • Gzip something.doc

38
GUNZIP
  • Uncompresses file compressed by gzip.
  • Gunzip test.gz uncompresses the file.
  • Gunzip r -recursively zip all files in a
    directory

39
ZCAT
  • Enables people to view a gzipped file.
  • Zcat test.gz would show what is contained in the
    test file.

40
Compress and uncompress
  • Compress compress a single file add suffix Z
  • Compress sometextfile.Z
  • Uncompress uncompress a single file and remove
    the suffix Z
  • Uncompress sometextfile

41
Putting everything togetherarchive and
compression
  • Archive and compress together
  • Tar cvzf /tmp/somefiles.tar.gztar and gzip a
    directory into a compressed-tar file
  • Gunzip c /tmp/somefiles.tar.gz tar xvf
    uncompress and extract a compressed tar-file

42
Uuencode and uudecode
  • Able to convert files from binary to ascii
  • Uuencode binaryfile.tar binaryfile.tar gt
    binaryfile.tar.uue begin 644 source.tar
  • Uudecode binaryfile.tar.uuedecodes the ascii
    file back into binary format

43
Uu - stuff
  • Uuencode can be used to encrypt ascii files
  • Uuencode private private gt private.uue
  • Tar cvf private/ uuencode mail
    secret_at_acme.com tar, encode, and mail private
    data to secret

44
PGP
  • PGP Pretty Good Privacy-http//web.mit.edu/netw
    ork/pgp-form.html

45
WHO
  • Displays the names of the users currently logged
    on.
  • Who am I gives the login name of the person
    logged in at the terminal.

46
FINGER
  • Displays detailed information about the user.
  • Finger will shows users that are currently
    online.
  • Finger _at_remote, lets the user finger a remote
    system.
  • Finger user would show detailed information about
    the user.

47
PINE
  • Used to send and receive e-mail.
  • 1989, developed by individuals at University of
    Washington with a purpose of creating a UNIX
    mailer that is easy to learn.
  • Type pine to start pine and lets play with its
    basic features.

48
Book Review Qs
  • Review Questions Page 65 (1-14)

49
Linux File System
  • A file system is the collection of files and the
    hierarchy of directories on a system

50
Linux Directory tree

51
Important Directories
  • /bin
  • Short for binaries or executables. Notice that in
    this directory, you see cp, ls and mv and other
    utilities that we use as commands under shell.
    This directory is where executables.
  • /dev
Write a Comment
User Comments (0)
About PowerShow.com