Os - Experiment No - 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Experiment No 1

Aim: To study and implement various Linux Commands.

Theory:
Linux is not UNIX, as UNIX is a copyrighted piece of software that demands license fees when any part of
its source code is used. Linux was written from scratch to avoid license fees entirely, although the operation
of the Linux operating system is based entirely on UNIX. It shares UNIX's command set and look-and-feel,
so if you know either UNIX or Linux, you know the other, too. Linux is a freely distributable version of
UNIX developed primarily by Linus Torvalds at the University of Helsinki in Finland.

Linux can be installed on a wide variety of computer hardware, ranging from mobile phones, tablet
computers and video game consoles, to mainframes and supercomputers.

Text editors in Linux

Linux is just as well suited for word processing as any other operating system. There are several excellent
word processing programs for Linux like AbiWord, KWord, part of the Koffice suite and the
OpenOffice.org as well as StarOfficesuite's word processor.

Why use a text editor?

A text editor is just like a word processor without a lot of features. All operating systems come with a basic
text editor. Linux comes with several. The main use of a text editor is for writing something in plain text
with no formatting so that another program can read it. Based on the information it gets from that file, the
program will run one way or another.

The text editor "vi"

The most popular text editor for Linux is called 'vi'. This is a program that comes from UNIX. There is a
more recent version called 'vim' which means 'vi improved'. The problem with 'vi' or 'vim' is that a lot of
people don't like it. You have to remember a lot of key combinations to do stuff that other text editors will
do for you more easily.

Frequently Used Linux Commands

1) cd- This command is used to 'change directory'.


2) ls- Typing 'ls' will list the contents of a directory with just information about file names.
3) cp-'cp' is used for copying files from one place to another, or for making a duplicate of one file under a
different name.
4) mv-'mv' is used for moving files from one place to another. It cuts the file from one place and pastes it to
another.
5) mkdir-This command is used for making or creating directories.
6) rmdir-This is the opposite of 'mkdir'- which is used to delete the directories.
7) rm-This command is used for removing or deleting files.
8) grep-The grep command allows us to search one file or multiple files for lines that contain a pattern.

CLASS: SE(COMP) SUBJECT: OPERATING SYSTEM SUBJECT CODE: CSL403


9) "pipes" in Linux-To use the pipe command, we don't type: pipe. We press the '|' key.
10) who-This is used to find out who's working on our system.
11) whoami-It is a little program that tells us who we are, i.e. it prints effective user id.
12) pwd-(print working directory)The pwd command displays the full pathname of the current directory.
13) cat-The cat command reads one or more files and prints them to standard output.
14) wc-This command will give us the number of lines, words and letters (characters) in a file and in that
order.
15) ps-It gives us a list of the processes running on our system.
16) chmod-The chmod command changes the access mode of one file or multiple files.
17) Date- print or set system date & time
18) cal- displays a calendar and the date
19) echo- display a text
20) bc- An arbitrary precision calculator language.
21) man- an interface to the on-line reference manuals.
22) uptime- Tell how long the system has been running.
23) uname- print system information
24) hostname- show or set the system's host name
25) head- output the first part of files
26) tail- output the last part of files
27) sort- sort lines of text files
28) chown – change file owner and group

Conclusion: The shell acts as an interface between the user and the kernel. Thus shell is used to execute the
commands.

CLASS: SE(COMP) SUBJECT: OPERATING SYSTEM SUBJECT CODE: CSL403

You might also like