Book Image

Fundamentals of Linux

By : Oliver Pelz
Book Image

Fundamentals of Linux

By: Oliver Pelz

Overview of this book

Linux is a Unix-like operating system assembled under the model of free and open source software development and distribution. Fundamentals of Linux will help you learn all the essentials of the Linux command line required to get you started. The book will start by teaching you how to work with virtualization software and install CentOS 7 Linux as a VM. Then, you will get to grips with the workings of various command line operations, such as cursor movement, commands, options, and arguments. As you make your way through the chapters, the book will not only focus on the most essential Linux commands but also give an introduction to Bash shell scripting. Finally, you will explore advanced topics, such as networking and troubleshooting your system, and you will get familiar with the advanced file permissions: ACL, setuid, and setgid. Fundamentals of Linux includes real-world tasks, use cases, and problems that, as a system administrator, you might encounter in your day-to-day activities.
Table of Contents (7 chapters)

Working with text files

In this section, we will learn all the important tools to print out text file content on the command line. We'll also learn how to view text files using a text file viewer. In Linux, there exists two different basic file types, text files and binary files. Text files are configuration files, while binary files can be image files or compressed data files. The files' encoding defines whether a file should be treated as a text file or binary file. Text files normally use UTFR. On Linux, text files normally are encoded using UTF-8 or ASCII. You can use the file command to detect the file type, like:

file /etc/passwd   
file ~file4.tar.gz  

To print out a text file's content, you can use the cat command. cat stands for concatenate, that's also the reason where the command has its name from. So, let's concatenate some files and put the...