0% found this document useful (0 votes)
34 views10 pages

Unix Unit 1 Final

The document provides an introduction to the UNIX operating system. It discusses the history and development of UNIX from its origins in 1969 to modern versions. It also summarizes several common UNIX commands including echo, date, ls, who, passwd, cal, cat, tty, stty, and uname. These commands are used to display messages and system information, list and read files, view users logged in, set passwords, view calendars, clear screens, and get system details.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views10 pages

Unix Unit 1 Final

The document provides an introduction to the UNIX operating system. It discusses the history and development of UNIX from its origins in 1969 to modern versions. It also summarizes several common UNIX commands including echo, date, ls, who, passwd, cal, cat, tty, stty, and uname. These commands are used to display messages and system information, list and read files, view users logged in, set passwords, view calendars, clear screens, and get system details.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

MODULE 1 INTODUCTION OF UNIX

UNIT 1
INTRODUCTION OF UNIX
 History of Unix:
Unix is actually a very old operating system ,until unix came on the scene,operating systemswere
designed with a particular machine in mind.They were written in lowleval language.Programs designed
for one system simply wouldn’t run on another .so two personsnamed Ken Thompson and Dennis
Ritchie, of AT & T ,in 1969,started to build a flexibleoperating system that would run on any hardware.
they designed and built a elegant file system, command interpreter(shell) and a set of utilities. But this
system was once again hardwaredependent. In 1973, Dennis Ritchie rewrote the entire system in C –a
high level language andit was portable. This was the first version of unix. The University of California
Berkley(UCB),created a unix of its own. They calledit BSD UNIX.(Berkley software distribution).These
versions became quite popular worldwide.BSD Unix had a standard editor of the unix system(vi) and a
popular shell( cshell).Berkley also created a better file system, a more versatile mail feature and a better
methodof linking files. Later they also offered with their standard distribution a networking protocol
software(TCP/IP) that made the internet possible. UNIX Shell Programming Prof, MAMATHA M, Dept.
of CSE, BrCE, Bengaluru Page3Sun used the BSD unix as a foundation for developing their own brand
of unixcalledSunOS. Today their version of UNIX is known as solaries. Others had their own brands
suchas IBM had AIX,HP offered HP-UX. As each vendor modified and enhanced Unix to create their
own versions ,the original unix lost its identity as a separate product. There was no Standard version of
unix. HenceAT& T Released SVR4(system V Release 4), a standard unix. Even before the advent of
SVR4, big things were happening in the U.s DefenseDepartment .They created the first communication
network called ARPANETand it usedTCP/IP protocol and they tried to implement TCP/IP on BSD Unix.

 Unix Arcitecture /components: The UNIX architecture and command usage.

Dept of CSE,BrCE 1
MODULE 1 INTODUCTION OF UNIX

Some Basic Commands :


 echo Command : Displaying a message

echo command can be used to

 To display a message (like echo “cseise”)


 To evaluate shell variables (echo $PAGER)

Originally echo was an external command, but now all shells have echo as built in command.

Syntax: $echo [option] [string]

 printf Command : printf can be used as alternative command to echo. The difference is echo
command by default inserts ‘\n’ character at the end, but printf does not insert newline at the end.
Syntax : $printf [-v var] format [arguments]

 date Command : To display date and time


The Unix system maintains an internal clock meant to run perpetually. When the system is shut down a
battery backup keeps the clock ticking. Date command is used to display both time as follows

Syntax : $date [option]…[+format]


$date +%m: display the month of year.
$date +%h: display the locale’s abbreviated month name
$date “+%h%m”: display both month of year and month name.
$date +“%d-%h-%y”: display current date, month and year.
$date +”%H:%M:%S” : display current hour, minutes and second.

Dept of CSE,BrCE 2
MODULE 1 INTODUCTION OF UNIX

 ls command : listing files


It is possible to list the names of the files in the directory using ls command. The ls command with no
parameters or qualifiers, the command displays the files listed in your current working directory.

OPTIONS USED WITH ls :

 ls –a : displays all files including hidden files, current directory(.) and present directory(..)

Dept of CSE,BrCE 3
MODULE 1 INTODUCTION OF UNIX

 ls –d dirname : Searches for directory with name dirname, if found displays it, otherwise produces a
message directory not found.

 ls –i: displays file with inode.

 who command : Unix maintains an account of all users, who logged out to the system. “who”
command displays listing of these users.
Syntax : $who [option][filename]

Dept of CSE,BrCE 4
MODULE 1 INTODUCTION OF UNIX

Options used with who:

 $who –H: displays the header.

 $ who am i: to know who logged in the system.

 passwd Command : The passwd command sets and changes passwords for users.Use this command
to change your own password or another user’s password.

 cal Command : Using call command it is possible to see the calendar of specific month.
Syntax : $cal [[month]year]

Dept of CSE,BrCE 5
MODULE 1 INTODUCTION OF UNIX

 tput command : Clearing the screen.


The tput command allows shell scripts to do things like clear the screen, underline text, and enter text no
matter how wide the screen is. To do these things, it translate the terminal-independent name of a
terminal capability into its actual value for the terminal type being used.
Syntax : $tput[-Ttype ] capname[parms…] or tput –S<<

 cat command : The cat command is the most universal and powerful tool. It is considered to be one
of the most frequently used commands. It can be used to display the content from one file to another. So
cat command concatenates two files.

Dept of CSE,BrCE 6
MODULE 1 INTODUCTION OF UNIX

Options used with cat command:

 $cat –v : Displaying non printing characters.

 $cat –n : numbering lines.

 tty command : tty command displays information related to the terminal. The tty command of the
terminal basically prints the file name of the terminal connecter to standard input.
Syntax : tty[option]…

Options used with tty command :

 $tty --help: display the help message and exit.

Dept of CSE,BrCE 7
MODULE 1 INTODUCTION OF UNIX

 $tty version: print the version information.

 stty command : stty command in unix is used to change and print terminal line settings. Basically
this command shows or changes terminal characteristics.
Syntax : $stty[-F DEVICE\--file=DEVICE][SETTING]..

 uname Command : The command ‘uname’ displays the information about the system.
Syntax : uname [Option]

Dept of CSE,BrCE 8
MODULE 1 INTODUCTION OF UNIX

Options used with uname command :

 uname –a: prints all the system information in the following order. kernal name, network name,
network node, hostname, kernel release date, kernel version.
Syntax: $uname –a

 uname -s: prints the kernel name.


Syntax : $uname –s

 uname –n : prints the hostname of network node.


Syntax : $uname –n

 uname –r: prints the kernel release date.


Syntax: $uname –r

Dept of CSE,BrCE 9
MODULE 1 INTODUCTION OF UNIX

 uname –v: prints the version of the current kernel.


Syntax: $uname –v

 uname –m: prints the machine hardware name.


Syntax: $uname –m

Dept of CSE,BrCE 10

You might also like