Day 1 Assignment
Day 1 Assignment
DAY 1
INTRODUCTION TO LINUX
1. How different is LINUX when compared with Unix?
Linux is open source and is developed by Linux community of developers. Unix was
developed by AT&T Bell labs and is not open source.
Linux is used in wide varieties from desktop, servers, smartphones to mainframes. Unix is
mostly used on servers, workstations or PCs.
2. What are the run levels in Linux and how to change them?
Run Levels:
➢ Run Level 0 is shutdown position. Linux system is powered off. Linux systems run
levels transitioned to 0 to shut down.
➢ Run Level 1 is single-user mode there is no network and used rarely.
➢ Run Level 2 is multi-user mode but there is no network file system. This level is used
rarely too.
➢ Run Level 3 is the default mode for most of the Linux servers. There is no gui but all
other services and features are functional.
➢ Run Level 4 is user-defined.
➢ Run Level 5 is a multi-user GUI mode default for most of the user systems.
➢ Run Level 6 is used to reboot the system.
How To Change Run Level
Run levels can be changed easily. To change run level root privilege is required.
$ init 3
This will change the current run level to run level 3
Boot With Run Level 6
We can reboot Linux system by changing to run level 6 like below
$ init 6
This is the same as reboot command
Run Level With Systemctl
In the old days, init was the ruler of the run levels. But times have changed. Now systemctl is
the emperor. All most all run-level related operations are done with systemctl.
Get Current Run Level With Systemctl
We can get the current run level with systemctl like below
$ systemctl get-default
multi-user.target
• As you guess multi.user is equal to run level 3
Change Run Level With Systemctl
We can change run level with systemctl by providing systemctl targets like below
$ systemctl isolate graphical.target
• isolate parameters change the run level to graphical.target
Set Default Run Level With Systemctl
We can set default run level with systemctl. Default run level is start when the computer boot.
We want to not start GUI we can change the default run level to multi-user.target like below
$ systemctl set-default multi-user.target
3. what is the importance of the GNU project?
Its goal is to give computer users freedom and control in their use of their computers and
computing devices by collaboratively developing and publishing software that gives everyone
the rights to freely run the software, copy and distribute it, study it, and modify it. GNU
software grants these rights in its license.
4. What are file permission groups in linux? explain each of them?
All the three owners (user owner, group, others) in the Linux system have three types of
permissions defined. Nine characters denotes the three types of permissions.
1. Read (r) : The read permission allows you to open and read the content of a file. But
you can't do any editing or modification in the file.
2. Write (w) : The write permission allows you to edit, remove or rename a file. For
instance, if a file is present in a directory, and write permission is set on the file but not
on the directory, then you can edit the content of the file but can't remove, or rename it.
3. Execute (x): In Unix type system, you can't run or execute a program unless execute
permission is set.But in Windows, there is no such permission available.
TOOLS
VI EDITOR
1. How to encrypt files using vi editor in Linux ? explain and write a
syntax for it.
Open the file , type the content and set number to the content (eg: se nu)
Then type X and press enter
It will prompt for confirmation of the key, enter the same key again
The find command in UNIX is a command line utility for walking a file hierarchy. It can be
used to find files and directories and perform subsequent operations on them. Yet using it to
create ctags is done only in case of code navigation.
here the star can be interpreted as a wildcard. So enclosing the name in single -quotes so the
shell wont interpret.
GCC