LInux: Basics & File System:The Unix operating system was conceived and implemented in 1969 at AT&T's Bell Laboratories in the United States by Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna. First released in 1971, Unix was written entirely in assembly language, as was common practice at the time. Later, in a key pioneering approach in 1973, it was rewritten in the C programming language by Dennis Ritchie (with exceptions to the kernel and I/O). The availability of a high-level language implementation of Unix made its porting to different computer platforms easier.
3. What is a shell?
⢠The user interface to the operating system
⢠Functionality:
â Execute other programs
â Manage files
â Manage processes
⢠A program like any other
⢠Executed when you log on
4. Most Commonly Used Shells
â /bin/sh The Bourne Shell / POSIX shell
â /bin/csh C shell
â /bin/tcsh Enhanced C Shell
â /bin/ksh Korn shell
â /bin/bash Free ksh clone
Basic form of shell:
while (read command) {
parse command
execute command
}
5. A simple example
⢠Execute a basic command
⢠Parsing into command in arguments is called
splitting
$ ls âl /bin
-rwxr-xr-x 1 root sys 43234 Sep 26 2001 date
$
prompt command arguments
7. Organizing of The File System
/ The root directory
/bin or /sbin Commands for basic
system operation
/dev Device entries
/etc Critical startup and
configuration files.
/lib Library for the C
compiler
/tmp Temporary files
/var/adm or
/var/log
Accounting file, log
files
8. Filenames
/
tmp etc bin
dmr wm4
foo who date
usr
.profile
foo
who
date
.profile
A sequence of characters other than slash.
Case sensitive.
9. Directory
/
tmp etc bin
dmr wm4
foo who date
usr
.profile
etc
usr
dmr
bin
Holds a set of files or other directories.
Case sensitive.
10. Pathname
/
tmp etc bin
dmr wm4
foo who date
usr
.profile /usr/wm4/.profile
A sequence of directory names followed by a simple
filename, each separated from the previous one by a /
11. Files and Directories
⢠Files are just a sequence of bytes
â No file types (data vs. executable)
â No sections
â Example of UNIX philosophy
⢠Directories are a list of files and status of the files:
â Creation date
â Attributes
â etc.
13. Common Utilities for Managing files and
directories
⢠pwd print process working dir
⢠ed, vi, emacs⌠create/edit files
⢠ls list contents of directory
⢠rm remove file
⢠mv rename file
⢠cp copy a file
⢠touch create an empty file or update
⢠mkdir and rmdir create and remove dir
⢠wc counts the words in a file
⢠file determine file contents
⢠du directory usage
14. File Permissions
⢠UNIX provides a way to protect files based on
users and groups.
⢠Three types of permissions:
⢠read, process may read contents of file
⢠write, process may write contents of file
⢠execute, process may execute file
⢠Three sets of permissions:
⢠permissions for owner
⢠permissions for group (1 group per file)
⢠permissions for other
15. Directory permissions
⢠Same types and sets of permissions as for
files:
â read: process may a read the directory contents
(i.e., list files)
â write: process may add/remove files in the
directory
â execute: process may open files in directory or
subdirectories
16. Summary
⢠All UNIX file system are very similar.
⢠All file system have this concept of file tree.
â Transparent to user even mount point is
mapped to a remote file system.
⢠To communicate with devices, special
device files are used.
⢠More information check out the man pages.