0% found this document useful (0 votes)
53 views

Unix Intro

The document provides an introduction to the UNIX operating system. It describes UNIX as an operating system developed in 1969 that is used on servers and workstations. It provides powerful features like security, multi-user support, and interprocess communication. There are various versions of UNIX for different hardware, including Linux, Solaris, HP-UX, AIX, and IRIX. UNIX is used by large companies, small companies using Linux, universities, hospitals, and governments due to its stability in shared environments and critical applications. The document outlines the UNIX file system structure and basic commands like ls, pwd, cat, and rm.

Uploaded by

anupamatoppo
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

Unix Intro

The document provides an introduction to the UNIX operating system. It describes UNIX as an operating system developed in 1969 that is used on servers and workstations. It provides powerful features like security, multi-user support, and interprocess communication. There are various versions of UNIX for different hardware, including Linux, Solaris, HP-UX, AIX, and IRIX. UNIX is used by large companies, small companies using Linux, universities, hospitals, and governments due to its stability in shared environments and critical applications. The document outlines the UNIX file system structure and basic commands like ls, pwd, cat, and rm.

Uploaded by

anupamatoppo
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 59

Introduction to UNIX

What is UNIX?
• UNIX is an Operating System (OS).
• An operating system is a control program that helps the
user communicate with the computer hardware.
• The most popular operating systems: Windows -- from
Microsoft. (Windows is the “Big Mac” of operating systems
-- cheap and “billions served”.)
• UNIX was developed long before Windows, in 1969 by Ken
Thompson at AT&T Bell Labs in the US.
• Command Line Interpreter
• GUIs (Window systems) are now available
What is UNIX?
• UNIX is an operating system for experts,
used on high-end workstations, database
servers, and web servers.
• UNIX provides some powerful features:
– security - private and shared files
– multi-user support
– data sent to display, files, or printers in same
way
– interprocess communication
• Microsoft keeps trying to upgrade
Windows to try to replace UNIX as the “OS
for experts”.
UNIX Versions
• There are many different versions of
UNIX for different hardware:
– Linux for the PC, including
• Mandriva (running in CS Lab, some PG/faculty desktops, and
Linux CPU servers; used to be called Mandrake)
• Red Hat
• Fedora Core (free community version of Red Hat)
• Debian (freeware)
– Sun Microsystem’s Solaris
– Hewlett-Packard’s HP-UX
– IBM’s AIX
– SGI’s IRIX
Who Uses UNIX?
• Big companies. They especially use
UNIX servers, preferring its stability.
They can afford to hire employees with
UNIX experience.
– Computer manufacturers such as Sun,
SGI, IBM, and HP
– Computer chip manufacturers like
Motorola & Intel
– Software companies
– Banks
– Hong Kong Government
– Hospital Authority
– Universities
• Small companies that use Linux
– OS free
Most Important Feature of UNIX

• Most important feature of UNIX: STABILITY


– many years to get the bugs out
– Important in shared environments and critical applications
• Shared Environments Example: University
– Windows crashes 1-2 times/month in labs
– UNIX servers crash usually only when hard disk fails
– UNIX more reliable than Windows
• Critical Applications
– Bank – Don’t want to lose money in ATM transactions!
– Hospital - Don’t want to wait for reboot during operation!
– Airport - Air traffic control landing planes.
– PCW - Don’t want phone system going down!
Layer Architecture
The user
Shells and commands
compilers and interpreters
System libraries
System-call interface to the kernal
Signal Terminal File system CPU Scheduling
handling Swapping block Page replacement
I/O system
Character I/O systems Demand paging
terminal drivers Disk and tape
Virtual memory
drivers

Kernal interface to the hardware

Terminal controllers Device controllers Memory controllers


terminals Disks and tapes Physical memory
Overview of the layer architecture
Under Unix, the "operating system" consists of many of these
utilities along with the master control program, the kernel.

The kernel provides services to start and stop programs, handles


the file system and other common "low level" tasks that most
programs share, and, perhaps most importantly, schedules
access to hardware to avoid conflicts if two programs try to
access the same resource or device simultaneously.

To mediate such access, the kernel was given special rights on


the system, leading to the division between user-space and
kernel-space.
Kernel — source code in /usr/sys, composed of several
sub-components:
conf — configuration and machine-dependent parts,
including boot code
dev — device drivers for control of hardware (and some
pseudo-hardware)
sys — operating system "kernel", handling memory
management, process scheduling, system calls, etc.
h — header files, defining key structures within the
system and important system-specific invariables
• Unix was designed to be portable, multi-tasking and multi-user in
a time-sharing configuration.
• Unix systems are characterized by various concepts:
– the use of plain text for storing data;
– a hierarchical file system;
– treating devices and certain types of inter-process communication (IPC) as files;
– and the use of a large number of software tools, small programs that can be strung
together through a command line interpreter using pipes, as opposed to using a
single monolithic program that includes all of the same functionality.

These concepts are known as the Unix philosophy


The Unix philosophy is a set of cultural norms and philosophical approaches to developing
software based on the experience of leading developers of the Unix operating system.

Doug McIlroy, the inventor of Unix pipes


Unix philosophy: Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a universal interface.
Unix philosophy
• Small is beautiful.
• Make each program do one thing well.
• Build a prototype as soon as possible.
• Choose portability over efficiency.
• Store data in flat text files.
• Use software leverage to your advantage.
• Use shell scripts to increase leverage and portability.
• Avoid captive user interfaces.
• Make every program a filter.
• Allow the user to tailor the environment.
• Make operating system kernels small and lightweight.
• Use lowercase and keep it short.
• Save trees.
• Silence is golden.
• Think parallel.
• The sum of the parts is greater than the whole.
• Look for the 90-percent solution.
• Worse is better.
• Think hierarchically.
Unix File System
• The Filesystem Hierarchy Standard (FHS) defines the main
directories and their contents in UNIX operating systems.
• In the FHS all files and directories appear under the root
directory "/", even if they are stored on different physical
devices.

• The file system directory is as follows:

Microsoft Office
Word Document
Unix File System
• The arrangement of disk blocks in Unix is as shown in the figure below.

Figure : Disk arrangement

• The boot block contains the code to bootstrap the OS.

• The super block contains global information about the entire disk. It also maintains free list
of inodes and data blocks which can be allocated by the kernal when creating a file.

• The I-node which contains a table for every file of the file system. All attributes of the file
and directory are stored in this area except the name of the file or directory itself.

• data blocks contains the actual data in the form of directories and files.
The super block contains the following information, to keep
track of the entire file system.

• Size of the file system


• Number of free blocks on the system
• A list of free blocks
• Index to next free block on the list
• Size of the inode list
• Number of free the inodes
• A list of free inodes
• Index to next free inode on the list
• Lock fields for free block and free inode lists
• Flag to indicate modification of super block
Size of the file system represents the actual no of blocks
(used + unused) present in the file system. The super block
contains an array of free disk block numbers, one of which
points to the next entry in the list.
• The I-node list which contains the following entries.

• Owner: Owner indicates who owns the file(s) corresponding to this inode.
• Type: Type indicates whether inode represents a file, a directory, a FIFO, a
character device or a block device. If the type value is 0 then the inode is free.
• Last modified time , Last accessed time & Last inode modified time: The times
represent when, the file has been modified, when it was last accessed, or when the
inode has been modified last. Whenever the contents of the file is changed, the
"inode modified time" also changes. Moreover it changes when there are changes
for the inode like permission change, creating a link etc.
• Access Permissions: Each file will be having nine access permissions for read, write
and execute, for the owner, group and others in rwx rwx rwx format.
• No of links to the file: In Unix we can create links to some files or directories. So
we need to have a count of how many links are pointing to the same inode, so that
if we delete one of the links the actual data is not gone.
• Size of the file: Size of the file represents the actual size of the file.
• Data blocks owned : In Unix, we have a kind of indexing to access the actual data
blocks that contains data.
Assignment of new inodes
Inode Data Block representation

The data blocks contain the actual data contained in the files or
directories. In Unix, a directory is a special file. A directory file
contains names of the subdirectories and files present in that
directory and its corresponding inode number.
Basic UNIX commands

File Management commands.


cat,cd, cp, file,head,tail, ln,ls,mkdir ,more,mv, pwd,
rcp,rm, rmdir, wc.

• Pwd command: tells you where you currently are

pwd command will print your home directory on


screen, pwd means print working directory.

/u0/ssb/priya is output for the command when use


pwd in /u0/ssb/priya directory.
• Ls command
ls command is most widely used command and it displays the
contents of directory.

options
• ls will list all the files in your home directory, this command
has many options.
• ls -l will list all the file names, permissions, group, etc in long
format.
• ls -a will list all the files including hidden files that start with . .
• ls -lt will list all files names based on the time of creation,
newer files bring first.
• ls –Fx will list files and directory names will be followed by
slash.
• ls –R will lists all the files and files in the all the directories,
recursively.
• ls -R | more will list all the files and files in all the directories,
one page at a time.
• Mkdir command.

• mkdir priya will create new directory, i.e. here priya


directory is created.

• Cd command.

cd priya will change directory from current directory


to priya directory.

Use pwd to check your current directory and ls to


see if priya directory is there or not.

You can then use cd priya to change the directory to


this new directory.
• Cat command: displays the content of file
Eg: cat cal.txt cat command displays the contents of a file
here cal.txt on screen (or standard out).

• Head command.
head filename by default will display the first 10 lines of a file.

If you want first 50 lines you can use head -50 filename or for
37 lines head -37 filename and so forth.

• Tail command.
tail filename by default will display the last 10 lines of a file.
If you want last 50 lines then you can use tail -50 filename.
• More command. more command will display a
page at a time and then wait for input which is
spacebar. For example if you have a file which
is 500 lines and you want to read it all. So you
can use
more filename

• File command: File command displays about


the contents of a given file, whether it is a text
(Ascii) or binary file.
file filename.
resume1.doc: data file
cal.txt : ascii text
• Cp command.
cp command copies a file. If you want to copy a file named
oldfile in a current directory to a file named newfile in a
current directory.
cp oldfile newfile
If I want to copy oldfile to other directory for example /tmp
then
cp oldfile /tmp/newfile. Useful options available with cp are
-p and -r .
• -p options preserves the modification time and permissions,
• -r recursively copy a directory and its files, duplicating the
tree structure.
• Mv command.
mv command is used to move a file from one
directory to another directory or to rename a
file.

• Some examples:
mv oldfile newfile will rename oldfile to newfile.
mv -i oldfile newfile for confirmation prompt.
mv -f oldfile newfile will force the rename even if
target file exists.
mv * /usr/priya/ will move all the files in current
directory to /usr/priya directory.
• Wc command
wc command counts the characters, words or lines in a file depending
upon the option.
Options
• wc -l filename will print total number of lines in a file.
• wc -w filename will print total number of words in a file.
• wc -c filename will print total number of characters in a file.

• Rcp command.
rcp command will copy files between two unix systems and works just like
cp command (-p and -i options too).
For example you are on a unix system that is called Cheetah and want to
copy a file which is in current directory to a system that is called lion in
/usr/john/ directory then you can use rcp command

rcp filename lion:/usr/john
You will also need permissions between the two machines.
• Ln command.
Instead of copying you can also make links to
existing files using ln command.
If you want to create a link to a file called
coolfile in /usr/local/bin directory then you
can enter this command.
ln mycoolfile /usr/local/bin/coolfile
Some examples:
• ln -s fileone filetwo will create a symbolic link
and can exist across machines.
• ln -n option will not overwrite existing files.
• ln -f will force the link to occur.
• Rm command.
To delete files use rm command.
Options:
• rm oldfile will delete file named oldfile.
• rm -f option will remove write-protected files
without prompting.
• rm -r option will delete the entire directory as
well as all the subdirectories, very dangerous
command.
• Rmdir command.
rmdir command will remove directory or
directories if a directory is empty.
Options:
• rm -r directory_name will remove all files
even if directory is not empty.
• rmdir priya is how you use it to remove priya
directory.
• rmdir -p will remove directories and any
parent directories that are empty.
Comparison and Searching
diff,dircmp, cmp, grep, find.
• Diff command.
diff command will compare the two files and print out the differences
between.

Contents of fileone are


• This is first file
• this is second line
• this is third line
• this is different as;
• lkdjf this is not different

filetwo contains
• This is first file
• this is second line
• this is third line
• this is different xxxxxxxas;lkdjf this is not different

• diff fileone filetwo will give following output


• this is different as;lkdjf --- > this is different xxxxxxxas;lkdjf
• Cmp command.
cmp command compares the two files. For exmaple I have
two different files fileone and filetwo.
cmp fileone filetwo will give

fileone filetwo differ: char 80, line 4

• if I run cmp command on similar files nothing is returned.

• -s command can be used to return exit codes. i.e. return 0 if


files are identical, 1 if files are different, 2 if files are
inaccessible.

• This following command prints a message 'no changes' if files


are same

cmp -s fileone file1 && echo 'no changes' . no changes


• Dircmp Command.
dircmp command compares two directories.

• Grep Command
grep command is the most useful search command. You can use it to find
processes running on system, to find a pattern in a file, etc. It can be used
to search one or more files to match an expression.

• $ cat apple.txt
Core
worm seed
jewel
• $ grep jewel apple.txt
jewel
• $
Options:
• -b option will precede each line with its block number.
• -c option will only print the count of matched lines.
• -i ignores uppercase and lowercase distinctions.
• -l lists filenames but not matched lines.
• $ls -l | grep "Aug"
-rw-rw-rw- 1 john doc 11008 Aug 6 14:10 ch02
-rw-rw-rw- 1 john doc 8515 Aug 6 15:30 ch07
-rw-rw-r-- 1 john doc 2488 Aug 15 10:51 intro
-rw-rw-r-- 1 carol doc 1605 Aug 23 07:35 macros
• Find command.
Find command is a extremely useful command. you
can search for any file anywhere using this command
provided that file and directory you are searching

Some Examples:

find $HOME -print will lists all files in your home
directory.
find /work -name chapter1 -print will list all files
named chapter1 in /work directory.
find / -type d -name 'man*' -print will list all
manpage directories.
find / -size 0 -ok rm {} \; will remove all empty files
on system.
• -atime +n |-n| n will find files that were last accessed more
than n or less than -n days or n days.
• -ctime +n or -n will find that were changed +n -n or n days
ago.
• -depth descend the directory structure, working on actual
files first and then directories. You can use it with cpio
command.
• -exec commad {} \; run the Unix command on each file
matched by find. Very useful condition.
• -print print or list to standard output (screen).
• -size n find files that contain n blocks.
• -type c Find file whole type is c. C could be b or block, c
Character special file, d directory, p fifo or named pipe, l
symbolic link, or f plain file.

• Chgrp command.
chgrp command is used to change the group of a file
or directory.
You must own the file or be a super user.
chgrp [options] newgroup files is syntax of chgrp.
Newgroup is either a group Id or a group name
located in /etc/group .

• Chown command.
chown command to change ownership of a file or
directory to one or more users.
Syntax is
chown options newowner files
• Date command.
Date displays today’s date, to use it type date at prompt.

• Who command
who command displays information about the current status
of system.
who options file
Who as default prints login names of users currently logged
in.
Options
• -a use all options.
• -b Report information about last reboot.
• -d report expired processes.
• -H print headings.
• -p report previously spawned processes.
• -u report terminal usage.
• Write command will initiate an interactive
conversation with user. Syntax is
write user tty
The sort Command:
The sort command arranges lines of text alphabetically or
numerically. The example below sorts the lines in the food
file:
$sort food
• Afghani Cuisine
• Bangkok Wok
• Big Apple
• Deli Isle of Java
• Mandalay Sushi and Sashimi
• Sweet Tooth
• Tio Pepe's Peppers

The sort command arranges lines of text alphabetically by


default. There are many options that control the sorting:
Options:
• -b ignores leading spaces and tabs.
• -c checks whether files are already sorted.
• -d ignores punctuation.
• -i ignores non-printing characters.
• -n sorts in arithmetic order.
• -ofile put output in a file.
• +m[-m] skips n fields before sorting, and sort upto
field position m.
• -r reverse the order of sort.
• -u identical lines in input file appear only one time in
output.
• Chmod command.

• chmod command is used to change permissions on a file.


for example if I have a text file with calender in it called cal.txt.

• initially when this file will be created the permissions for this file
depends upon umask set in your profile files. As you can see this
file has 666 or -rw-rw-rw attributes.
ls -la cal.txt
• -rw-rw-rw- 1 ssb dxidev 135 Dec 3 16:14 cal.txt
• In this line above I have -rw-rw-rw- meaning respectively that
owner can read and write file, member of the owner's group
can read and write this file and anyone else connected to this
system can read and write this file.,
• ssb is owner of this file dxidev is the group of this file, there are
135 bytes in this file, this file was created on
• Banner command.
banner prints characters in a sort of ascii art poster

• Cal command
cal command will print the calendar on current
month by default. If you want to print calendar of
august of 1965. That's eighth month of 1965.
cal 8 1965

• Clear command
clear command clears the screen and puts cursor at
beginning of first line.
Pipes and Filters
• Unix commands alone are powerful, but when you combine them together, you
can accomplish complex tasks with ease. The way you combine Unix commands is
through using pipes and filters.
• Using a Pipe
• The symbol | is the Unix pipe symbol that is used on the command line. What it
means is that the standard output of the command to the left of the pipe gets sent
as standard input of the command to the right of the pipe. Note that this functions
a lot like the > symbol used to redirect the standard output of a command to a file.
However, the pipe is different because it is used to pass the output of a command
to another command, not a file.

• $ cat apple.txt
core
worm seed
jewel

• $ cat apple.txt | wc
Output 3 4 21 $
• $ cat apple.txt | wc | mail -s "The count" nobody@december.com
Using a Filter
• A filter is a Unix command that does some manipulation of the text of a file. Two of
the most powerful and popular Unix filters are the sed and awk commands. Both
of these commands are extremely powerful and complex.
• sed
• Here is a simple way to use the sed command to manipulate the contents of the
apple.txt file:

• $ cat apple.txt
core
worm seed
Jewel
• $ cat apple.txt | sed -e "s/e/WWW/“
corWWW
worm sWWWed
jWWWwel
• $ cat apple.txt | sed -e "s/e/J/g"
corJ
worm sJJd
jJwJl $
• awk
• The Unix command awk is another powerful filter. You can use awk to
manipulate the contents of a file. Here is an example:
$ cat basket.txt
• Layer1 = cloth
• Layer2 = strawberries
• Layer3 = fish
• Layer4 = chocolate
• Layer5 = punch cards
$ cat basket.txt | awk -F= '{print $1}‘
• Layer1
• Layer2
• Layer3
• Layer4
• Layer5
$ cat basket.txt | awk -F= '{print "HAS: " $2}'
• HAS: cloth
• HAS: strawberries
• HAS: fish
• HAS: chocolate
• HAS: punch cards $
• The pg and more Commands:
A long output would normally zip by you on
the screen, but if you run text through more
or pg as a filter, the display stops after each
screenful of text.
• Let's assume that you have a long directory
listing. To make it easier to read the sorted
listing, pipe the output through more as
follows:
System vi Editor
– The default editor. Other editors include pico, emacs

– The UNIX vi editor is a full screen editor and has two modes of operation:
– Command mode commands which cause action to be taken on
the file, and
– Insert mode in which entered text is inserted into the file.
– In the command mode, every character typed is a
command that does something to the text file being
edited; a character typed in the command mode may
even cause the vi editor to enter the insert mode. In
the insert mode, every character typed is added to
the text in the file; pressing the <Esc> (Escape) key
turns off the Insert mode.
• To Get Into and Out Of vi
• To Start vi
– To use vi on a file, type in vi filename. If the file named
f1 exists, then the first page (or screen) of the file will
be displayed; if the file does not exist, then an empty
file and screen are created into which you may enter
text.
• vi f1 edit f1 starting at line
• vi -r f1 recover filename that was being edited
when system crashed
• To Exit vi
– Usually the new or modified file is saved when you leave
vi. However, it is also possible to quit vi without saving the
file.

– Note: The cursor moves to bottom of screen whenever a


colon (:) is typed. This type of command is completed by
hitting the <Return> (or <Enter>) key.
• :x<Return> quit vi, writing out modified file to file
named in original invocation  
• :wq<Return> quit vi, writing out modified file to file
named in original invocation  
• :q<Return> quit (or exit) vi
• :q!<Return> quit vi even though latest changes have
not been saved for this vi call
• Moving the Cursor

– In the table below, the symbol ^ before a letter means that the <Ctrl> key
should be held down while the letter key is pressed.
• j or <Return>
  [or down-arrow] move cursor down one line
• k [or up-arrow] move cursor up one line
• h or <Backspace> [or left-arrow] move cursor left one character
• l or <Space> [or right-arrow] move cursor right one character
• 0 (zero) move cursor to start of current line (the one with the cursor)
• $ move cursor to end of current line  
• w move cursor to beginning of next word  
• b move cursor back to beginning of preceding word  
• :0<Return> or 1G move cursor to first line in file  
• :n<Return> or nG move cursor to line n
• :$<Return> or G move cursor to last line in file
• Screen Manipulation
– The following commands allow the vi editor screen (or
window) to move up or down several lines and to be
refreshed.
•   ^f move forward one screen  
• ^b move backward one screen  
• ^d move down (forward) one half screen  
• ^u move up (back) one half screen  
• ^l redraws the screen  
• ^r redraws the screen, removing deleted lines
• Adding, Changing, and Deleting Text
– Unlike PC editors, you cannot replace or delete text by
highlighting it with the mouse. Instead use the commands
in the following tables.

– Perhaps the most important command is the one that


allows you to back up and undo your last action.
Unfortunately, this command acts like a toggle, undoing
and redoing your most recent action. You cannot go back
more than one step.
• u UNDO WHATEVER YOU JUST DID; a simple toggle
– The main purpose of an editor is to create, add, or modify
text for a file.
• Inserting or Adding Text
– The following commands allow you to insert and add text. Each of
these commands puts the vi editor into insert mode; thus, the <Esc>
key must be pressed to terminate the entry of text and to put the vi
editor back into command mode.

• i insert text before cursor, until <Esc> hit  


• I insert text at beginning of current line, until <Esc> hit
• a append text after cursor, until <Esc> hit  
• A append text to end of current line, until <Esc> hit
• o open and put text in a new line below current line, until
<Esc> hit
• O open and put text in a new line above current line, until
<Esc> hit
Changing Text
– The following commands allow you to modify text.

• r replace single character under cursor (no <Esc> needed)  


• R replace characters, starting with current cursor position,
until <Esc> hit  
• cw change the current word with new text,
starting with the character under cursor, until <Esc> hit  
• cNw change N words beginning with character under cursor,
until <Esc> hit;
  e.g., c5w changes 5 words  
• C change (replace) the characters in the current line, until
<Esc> hit  
• cc change (replace) the entire current line, stopping when
<Esc> is
• hit   Ncc or cNc change (replace) the next N lines, starting with
the current line, Stopping when <Esc> is hit
Deleting Text
– The following commands allow you to delete text.

• x delete single character under cursor  


• Nx delete N characters, starting with character under cursor  
• dw delete the single word beginning with character under cursor  
• dNw delete N words beginning with character under cursor;
  e.g., d5w deletes 5 words  
• D delete the remainder of the line, starting with current cursor position
• dd delete entire current line  
• Ndd or dNd delete N lines, beginning with the current line;
  e.g., 5dd deletes 5 lines

Cutting and Pasting Text


– The following commands allow you to copy and paste text.

•   yy copy the current line into the buffer  


• Nyy or yNy copy (yank, cut) the next N lines, including the current line, into the
buffer
•   p put (paste) the line(s) in the buffer into the text after the current line
Searching Text
– A common occurrence in text editing is to replace one word or phase by
another. To locate instances of particular sets of characters (or strings), use the
following commands.

•   /string search forward for occurrence of string in text  


• ?string search backward for occurrence of string in text
•   n move to next occurrence of search string  
• N move to next occurrence of search string in opposite direction

Determining Line Numbers

– Being able to determine the line number of the current line or the total
number of lines in the file being edited is sometimes useful.

•  :.= returns line number of current line at bottom of screen   := returns


the total number of lines at bottom of screen   ^g provides the current
line number, along with the total number of lines,
in the file at the bottom of the screen
Saving and Reading Files
• These commands permit you to input and output files
other than the named file with which you are currently
working.
• :r filename<Return> read file named filename and insert
after current line
(the line with cursor)
• :w<Return> write current contents to file named in original
vi call  
• :w newfile<Return> write current contents to a new file
named newfile  
• :12,35w smallfile<Return> write the contents of the lines
numbered 12 through 35 to a new file named smallfile  
• :w! prevfile<Return> write current contents over a pre-
existing file named prevfile
System administrator
• A system administrator, systems administrator, or sysadmin, is a person
employed to maintain and operate a computer system and/or network.
System administrators may be members of an information technology
department.

• Sysadmins are usually charged with installing, supporting, and maintaining


servers or other computer systems, and planning for and responding to
service outages and other problems.

• He also does scripting or light programming, project management for


systems-related projects, supervising or training computer operators, and
being the consultant for computer problems beyond the knowledge of
technical support staff.

• A system administrator must demonstrate a blend of technical skills and


responsibility in order to perform their job well
Duties of a system administrator

• A system administrator's responsibilities might include:


• Analyzing system logs and identifying potential issues with computer systems.
• Introducing and integrating new technologies into existing data center environments.
• Performing routine audits of systems and software.
• Performing backups.
• Applying operating system updates, patches, and configuration changes.
• Installing and configuring new hardware and software.
• Adding, removing, or updating user account information, resetting passwords, etc.
• Answering technical queries.
• Responsibility for security.
• Responsibility for documenting the configuration of the system.
• Troubleshooting any reported problems.
• System performance tuning.
• Ensuring that the network infrastructure is up and running.

You might also like