Linux is an open-source operating system developed by Linus Torvalds in 1991 as an alternative to proprietary operating systems. It is widely used in servers, supercomputers, embedded devices, and has gained popularity among developers and normal users. Linux uses a kernel which controls processes and carries out operating system functions. It includes shells to accept commands and a variety of tools and applications. The source code is freely available and allows for modification, giving users freedom in how the operating system is used.
2. WHAT IS LINUX?
● Linux is an open-source operating system like other operating systems such
as Microsoft Windows, Apple Mac OS, iOS, Google android, etc.
● The Linux OS was developed by Linus Torvalds in 1991.
3. USE OF LINUX
● In mid-1990s NASA replaced it’s expensive machines with clusters of
cheap computers running Linux.
● Almost all supercomputers run some form of linux.
● Android is based on linux.
● In-Flight entertainment systems use linux.
● It is very much famous among developers and normal computer users.
4. FREE AND OPEN SOURCE OS
● Most OS come in a compiled format ie ,source code has run through a program
called a compiler that translates the source code into a language that is known to the
computer.
● On the other hand, open-source is completely different. The source code is included
with the compiled version and allows modification by anyone having some knowledge.
● It gives us the freedom to run the program, freedom to change the code according to
our use.
"for the people, by the people."
5. STRUCTURE OF LINUX SYSTEM
It consist of three parts:
● LINUX Kernel
● Shells
● Tools and applications
6. LINUX KERNEL
Kernel is the core of the UNIX OS. It controls all tasks, schedule all
Processes and carries out all the functions of OS.
SHELL
Shell is the command interpreter in the UNIX OS. It accepts command
from the user and analyses and interprets them.
8. 1. pwd
To find Present Working directory.
Example:
user@user:~$ pwd
/home/user
2. mkdir
Making a Directory in the terminal.
mkdir dirName - Creates a directory with name dirName.
Example:
mkdir temp
Creates the directory temp.
9. 3. rmdir
Removing a Directory
rmdir dirName - Removes a directory dirName.
Example:
rmdir temp
- Removes the directory temp.
10. 4.cd
Change your current working directory.
Example:
user@user:~$ cd Desktop
user@user:~/Desktop$
cd .. -Move to your parent directory.
•
Example:
user@user:~/Desktop/new$ cd ..
user@user:~/Desktop$
11. 5. cat
Sends file contents to standard output. This is a way to list the
contents of short files to the screen.
Example:
user@user:~$ cat > filename
Hi
How are you
user@user:~$ cat filename
Hi
How are you
12. 6. ls
Lists directory contents of files and directories.
Example:
user@user:~$ ls
Desktop Documents Downloads Music Pictures Public Templates Videos
•ls -a - Display the hidden files.
•ls -al - List all files in the current working directory in long list(rwx..)
•Example:
user@user:~$ls -al
drwxr-xr-x 21 user user 4096 Jan 30 06:57 .
-rw------- 1 user user 36 Jan 30 06:59 .bash_history
13. 7. cp
•This command is used to copy files or directory.
•cp source_file destination_file
Example:
user@user:~/Desktop/new$ cp oldfile.txt newfile.txt
8. Echo
•used to print the message on the screen.
Eg:$echo “text”
14. 9. mv
Move or rename files.
mv myfile yourfile
•Move the file from "myfile" to "yourfile". This effectively changes
the name of "myfile" to "yourfile" and ask the user whether we
want to overwrite or not.
10. uname
•Display linux information.
Example:
•$ uname -o
GNU/Linux
15. 11. History
history command is used to view the previously executed
command.
12. bc
•An arbitrary precision calculator language.
Example:
ccf@FISATPC0360:~$ bc
1+4
5
16. 13. who
•The command is used to get information about currently logged in user
on to the system.
14. date
•used to check the date and time
15. cal
•used to display the calendar Syn:$cal 2 2009
16. touch
used to create a blank file.
17. 17. grep
used to search a particular word or pattern related to that word from the file.
Syn:$grep search word filename
Eg:$grep hi student
18. wc
•wc–it counts the number of lines, words, character in a
specified file(s) with the options as –l,-w,-c
syn:$wc file.txt
$wc -w file.txt
18. 19. head
$head filename
Eg:$head student
To display the top two lines:
•$head -2 student
20. Tail
•displays last 10 lines of the file
•Syn:$tail filename Eg:$tail student
•To display the bottom two lines;
•Syn:$ tail -2 student
19. 16. chmod
–used to change the permissions of a file or directory.
$ch mod category operation permission file
Where, Category–is the user type
Operation–is used to assign or remove permission
Permission–is the type of permission
File– file used to assign or remove permission