Professional Documents
Culture Documents
2-Introduction-25-04-2023
2-Introduction-25-04-2023
A Unix-like operating system is one that behaves in a manner similar to a Unix system.
Linux is a Unix-like computer operating system assembled under the model of free and
open source software development and distribution. The defining component of any
Linux system is the Linux kernel, an operating system kernel first released October 5,
1991 by Linus Torvalds. Linux runs on a wide variety of computer hardware, including
mobile phones, tablet computers, network routers, televisions, video game consoles,
desktop computers, mainframes and supercomputers. Linux is a leading server operating
system and runs the 10 fastest supercomputers in the world. In addition, more than 90%
of today's supercomputers run some variant of Linux.
The development of Linux is one of the most prominent examples of free and open
source software collaboration: the underlying source code may be used, modified, and
distributed—commercially or non-commercially—by anyone under licenses such as the
GNU General Public License. Typically Linux is packaged in a format known as a Linux
distribution for desktop and server use. Some popular mainstream Linux distributions in-
clude Debian (and its derivatives such as Ubuntu), Fedora and openSUSE. Linux distri-
butions include the Linux kernel, supporting utilities and libraries and usually a large
amount of application software to fulfill the distribution's intended use.
Bash (Bourne Again Shell), Csh (C shell), Ksh (Korn Shell)are widely used shells.
Contents:
a) Help Commands (man, info, whatis, whereis, which, apropos)
b) Genaral Commands (echo, who, whoami, su, clear, date, cat, pwd)
a) Help Commands
commands for keywords and displays the result on the standard output.)
( scanf - input format conversion )
Description : locate the binary, source and manual page files for
a command / function
( /usr/bin/man )
commands for keywords and displays the result on the standard output.)
b) General Commands
Syntax : who
Example : who
who am i
effective user id
Syntax : whoami
Example : whoami
Syntax : su
Syntax : clear
Example : clear
Syntax : date
Example : date
Command Name : compare (Compare tow files and dispalys the line and
byte difference
Syntax : pwd
Example : pwd
( /home/bce7001 )
Other commands
e.g w
e.g finger
e.g wc file1.c
4 5 45 file1.c
e.g wc –l file1.c
4 file1.c
e.g wc –w file1.c
5 file1.c
e.g wc –c file1.c
46 file1.c
The default editor that comes with the Linux operating system is called vi (visual editor).
[Alternate editors for Linux environments include pico and emacs.]
The UNIX vi editor is a full screen editor and has two modes of operation:
1. Command mode -commands which cause action to be taken on the file, and
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.
Note: Linux is case-sensitive. Be sure not to use a capital letter in place of a lowercase letter; the
results will not be what you expect.
The vi editor is a common editor which makes use of a regular keyboard with an escape key.
Complete documentation is available by typing
man vi
e.g vi first.c
To compile:
gcc first.c
(or)
g++ first.cpp
To Execute:
./a.out
o Opens new line below the current line for text insertion.
O Opens new line above the current line for text insertion.
DEL Overwrites last character during text insertion.
Exiting vi
:wq Writes changes to current file and quits vi.
:q! quit vi even though latest changes have not been saved for this vi call
Undo Command
u undo the last command.