Cloude Devops Logo Free Clss Will start on Devops from July 15th
Cloud DevOps
Cloud DevOps




Wecome To Linux

Linux Kernel system (file system)

The files and systems in the Linux kernel system are where most of the users find difficulties, majorly because it is hard to tell which files are in which directories if you don’t have the knowledge. For this reason, we shall try to look at the organization of the file systems. We shall also learn how to create, delete, move, and rename directories. Additionally, we shall learn how to edit files and change permissions.

The file system layout

Azure DevOps The UNIX file system can aptly fit into a one-line description; “Everything on a UNIX system that is not a process is a file”. This statement holds true for files that are a little bit more than just files. Therefore, a Linux system does not differentiate between a file and directory mainly because the directory, in essence, is a file containing names of other files, services, texts, images, and programs. Additionally, a Linux system also treats input and output devices as files. The general understanding is that the files are a sort of in a tree structure on the main hard drive; this is for easy management and order. Most of the files on a Linux system are regular files, regardless of the data they hold, be it programs, executable files or normal data.

While we have already said that everything in a Linux system is a file, there is a general understanding that there are some exceptions. For instance:

(a) Directories: A file list of other files

(b) Special files: These are the mechanisms used for input and output. Special files are in /dev.

(c) Links: This is a system to make a file, including directory visible in various parts of the “system tree”.

(d) Domain (sockets): These are special types of files similar to the IP/TCP sockets. These files are protected by the file system access control and they provide inter-process networking.

(e) Named pipes: These types of files are the bridge between processes. They are more or less the same as sockets and enhance communication between processes without the use of networks or sockets semantics.

Remember that I had indicated that most computer users generalize that the file system is more or less like a tree, here is a good example of a Linux file system tree.

Linux file system tree. Azure DevOps It is important to note that depending on the UNIX system in use, the file system tree may change; some files and directories may change.

The file system tree starts at the slash or the trunk, which, if you look at our table is the (/) forward slash. This is what we call the root directory; it is the underlying directory for all files. Directories are one level below the slash or root directory often have the slash in their proceeding names to indicate their position and to prevent confusion with other files or directories with similar names.

A question that plagues most Linux users is where programs and program files are stored when they are installed on the system. Let us examine this for a minute. Linux uses two partitions: The data partition where the system data, including the root directories and all system resources required to start the system, are located, and the swap partition, which is an expansion of the physical memory on the computer. All files (including programs) are stored in this root directory in accordance with the Linux tree file system we have already looked at.

Manipulating files

To show file names, properties, date of creation, permission, type, size, link files and owners, the Is command is the easiest way.

Creating and deleting files and directories on your system is very important when you want to create new files or delete redundant directories to free up space. Because the graphical interface is much or less that of MS-DOS, creating files is not that difficult. Deleting files, on the other hand, is moderately difficult. There are some popular file managers for the GNU/Linux, with most of them being executable files that are accessible from the desktop manager, home directory icon or the command line using the following commands.

Managing files

Nautilus: This is the default file manager in the Gnome GNU desktop. There are very useful resources on how to use this tool online.

Konqueror: This file manager is typical in KDE desktops.

MC: Code named Midnight Commander is fashioned from the Norton Commander.

For easier file management, the above applications are worth the time of reading through the documentation and the effort. It is also important to note that there are many more file management applications, but these are the most popular and have a moderate difficulty level. Additionally, these tools optimize the UNIX commands in a specific manner.

To keep files and things in one place, you must allocate specific file default locations by creating directories and subdirectories for them. You can do this by using the mkdir command. For instance:

clouddevops:~> cd archive

clouddevops:~/archive> mkdir 2019 2020 2021

clouddevops:~/archive>ls

2019/ 2020/ 2021/

clouddevops:~/archive>mkdir 2021/DevOps/Cloud-DevOps/

mkdir: cannot create directory `2021/DevOps/Cloud-DevOps/':

Additionally, you can create subdirectories easily in one-step by using the – p option. For instance:

clouddevops:~> cd archive

clouddevops:~/archive> mkdir 2019 2020 2021

clouddevops:~/archive>ls

2019/ 2020/ 2021/

clouddevops:~/archive>mkdir 2021/DevOps/Cloud-DevOps/

mkdir: cannot create directory `2021/DevOps/Cloud-DevOps/'

No such file or directory

clouddevops:~/archive>mkdir -p 2021/DevOps/Cloud-DevOps/

clouddevops:~/archive>ls 2021/DevOps/

Cloud-DevOps/:

File permissions

In some instances, you will find that the file needs more or other permission not included in the file creation permission; this is called as an access right.

Access rights are set using the same mkdir command. It is important to note that there are rules on how to name a directory. For instance, in one directory, you cannot have two files with the same name. However, it is important to note that Linux as well as UNIX are case sensitive systems (you can have two file names with you and YOU in the same directory). Additionally, there are no limits to the length of a filename, so naming files should be a breeze. You can also use special characters in the file names as long as those characters do not hold a special meaning to the shell.

Moving files

Moving unclassified files uses the mv command.

1 clouddevops:~/archive> mv ../report[1-4].doc DevOps/Cloud-DevOps/

The same command is also in use when we are renaming files

The command can also come in handy, if you want to rename files:

In the above example, we can see that only the file name changes and all the other properties doesn’t change.

Copying files

The cp command is used to copy directories and files. There is also a very useful option of copying all underlying subdirectories and files (recursive copy) which uses the –R. Here is a look at the general syntax.

1 cp [-R] fromfile tofile

Removing or deleting files

The command rm comes into play when you want to remove single files, while the command rmdir plays its role in removing empty directories. It is important to note that some directories are undeletable (.dot and ..dot) because they are necessary for the proper ranking of a directory in the tree hierarchy. Like UNIX, Linux does not have a garbage can (recycle bin) and once you remove a file, that is it, it is gone and you cannot get it back unless you have a backup. To protect against this, sometimes “mistake delete”, you can activate the interactive behaviour of the cp, mv, and rm commands by using the -i option. When the –i option is active, the system does not execute a command such as delete immediately; instead, it prompts for confirmation, which needs that stroke of a key or an additional click to execute the command fully.

Conclusion

The Linux Kernel plays an important role in resource allocation to different applications. The kernel acts as a centralised place to connect the hardware and software and runs the applications in a system. Linux kernel has got more popularity due to its open-source nature. Users can customize this OS according to their requirements. Therefore, it’s been used by a wide variety of devices.

The modular characteristic of the Linux kernel allows a wide range of modifications without rebooting the system. The Flexibility of the kernel enables its users to perform their level best. Moreover, the monolithic nature of this kernel has greater computational power than the microkernel.












The DevOps seminar will help you to learn DevOps from scracth to deep knowledge of various DevOps tools such as fallowing List.

Linux, Git, Jenkins, Maven, Apache Tomcat, Nexus, Ansible, Chef, Docker, Nagios,   Kubernetes.




                                                                                                                                    

Learn Latest Technologies