Linux is an operating system like windows. An operating system is software that manages all of the hardware resources associated with your desktop or laptop. Operating system communicates between hardware and software of your PC/Laptop. Linux is a clone of UNIX.
Linux is an idea of Linus Torvalds, he worked on unix and has an idea need to improve on unix. But his idea was rejected by the unix team. But he continuously work on it and have a thought to launch os with changes. So Linus devised a Kernel named Linux in 1991. Later he collaborated with other programmers of MIT and started Linux applications to appear. So around 1991, a working Linux operating system with some applications was officially launched and this was the start of one of the most loved and open-source OS options available today.
- The main advantage of Linux was that programmers were able to use the Linux Kernel in order to design their own custom operating systems.
- Now, Linux is one of most popular and widely used Kernel, and it is the backbone of popular operating systems like Debian, Knoppix, Ubuntu, and Fedora.
UNIX is called the mother of operating systems which laid out the foundation to Linux. Unix is designed mainly for mainframes and is in enterprises and universities .While Linux is fast becoming a household name for computer users , developers and server environment. You may have to pay for a Unix kernel while in Linux it is free
Unix and linux commands are similar. So learning Linux is same as Unix.
The Linux operating system contains :
- Boot Loader: The software that manages the boot process of your computer. For most users, this will simply be a splash screen that pops up and eventually goes away to boot into the operating system.
- Kernel : This is the one piece of the whole that is actually called “Linux”. The kernel is the core of the system and manages the CPU, memory, and peripheral devices. The kernel is the “lowest” level of the OS.
- Daemons : These are back ground services like printing, sound, scheduling, etc hat either start up during boot, or after you log into the desktop.
- Shell : This is a command line for linux. A shell is command process that allows you to control the computer via commands typed into a text interface.
- Graphical Server: This is sub system, that displays the graphics on your monitor. It is commonly referred to as the X server or just “X”.
- Desktop Environment : This is the piece of the puzzle that the users actually interact with. There are many desktop environments to choose from (Unity, GNOME, Cinnamon, Enlightenment, KDE, XFCE, etc). Each desktop environment includes built-in applications (such as file managers, configuration tools, web browsers, games, etc).
- Applications: Desktop environments do not offer the full array of apps. Just like Windows and Mac, Linux offers thousands upon thousands of high-quality software titles that can be easily found and installed.
Installation of Linux: Linux offers one of the easiest installations of all operating systems. Linux offer what is called a Live distribution – which means you run the operating system from either a CD/DVD or USB flash drive without making any changes to your hard drive. You get the full functionality without having to commit to the installation. Once you’ve tried it out, and decided you wanted to use it, you simply double-click the “Install” icon and walk through the simple installation wizard.
Basic Linux Commands for Beginner:
The Linux can be classified as :
- File Handling
- Text Processing
- Process management
- System management
- Network
- File systems
- Advanced commands
- Archival
By using man command in Linux we can learn.
Man <command name> – it gives the use of the given command.
Command – help -> also gives the usage of the command.
File handling Commands in Linux:
File handling Commands
Sno Command name Description
- ls It display directory list
- ls -al Formatted listing with hidden files
- ls -lt Sorting the Formatted listing by time modification
- cd <dir name> Change directory to dir
- cd Change to home directory
- pwd Show current working directory
- mkdir dir Creating a directory dir
- cat >file Places the standard input into the file
- more file Output the contents of the file
- head file Output the first 10 lines of the file
- tail file Output the last 10 lines of the file
- tail -f file Output the contents of file as it grows,starting with the last 10 lines
- touch file Create or update file
- rm file Deleting the file
- rm -r dir Deleting the directory
- rm -f file Force to remove the file
- rm -rf dir Force to remove the directory dir
- cp file1 file2 Copy the contents of file1 to file2
- cp -r dir1 dir2 Copy dir1 to dir2;create dir2 if not present
- ln -s file link Create a link for file with symbol.
- mv file1 file2 Rename or move file1 to file2,if file2 is an existing directory
Linux is a clone of UNIX, the multi-user operating system which can be accessed by many users simultaneously. Linux can also be used in mainframes and servers without any modifications.
Linux divides authorization into 2 levels
- Ownership
- Permission
So linux is very powerful and secure.
Ownership: Owner ship can be divided into three types group, other and user.
Group Ownership: A group has multiple users to handle files. All users belonging to a group will have the same access permissions to the file. Instead of manually assigning permissions to each user, you could add all users to a group, and assign group permission to file such that only this group members and no one else can read or modify the files.
User ownership: A man/woman who is created a file is the user/owner of the file. A user is the owner of the file.
Others: Other user means the person who is not belongs to group or user. Owner has set permissions for the others.
Permission in Linux :
Permissions are three types read, write and execute.
r = read permission
w = write permission
x = execute permission
– = no permission
Number | Permission | Symbol |
---|---|---|
0 | No Permission | — |
1 | Execute | –x |
2 | Write | -w- |
3 | Execute + Write | -wx |
4 | Read | r– |
5 | Read + Execute | r-x |
6 | Read +Write | rw- |
7 | Read + Write +Execute | rwx |
File permission commands in Linux:
10 bit format from ‘ls l’ command
1 | 2 3 4 | 5 6 7 | 8 9 10 |
File type | Owner | Group | Others |
See the below example:
drwxrwr means owner has all three permissions
group has read and write
others have only read permission
read permission – 4
write – 2
execute 1
read, write, and execute permission are 7 (4+2+1).
- rwxrwr = 764
673 = rwrwxwx
Process management Linux commands:
- ps To display the currently working processes
- top Display all running process
- kill pid Kill the process with given pid
- killall proc Kill all the process named proc
- pkill pattern Will kill all processes matching the pattern
- bg Make fore ground process into back ground
- fg Brings the most recent job to foreground
- fg n Brings job n to the foreground here n is the job id