Skip to main content

Posts

LPI E - vi or nano

LPI E - Scripting 3.3 Turning Commands into a Script  Review of Topics- Part 2 of 2 Part One: Scripting Editors to use with Linux Command Line Interface (CLI) Vi Editor  The Vi editor is a powerful and versatile text editor that is included with most Linux distributions. It can be accessed from the terminal by typing vi followed by the name of the file you want to edit. For example, to edit a file called "test.txt", you would enter the command $ vi test.txt Once you have opened a file in vi, you can begin editing it by pressing the "i" key to enter insert mode. In insert mode, you can type and edit text as you normally would in any other text editor. When you are finished editing, press the "Esc" key to return to command mode. From here, you can save your changes and exit the editor by typing :wq and pressing Enter. This command will save your changes and exit the editor. If you want to exit the editor without saving your changes, type :q! and press E...

LPI E - Scripting

LPI E - Scripting 3.3 Turning Commands into a Script  Review of Topics- Part 1 of 2 Part Two: Editors Linux Command Line Interface (CLI) is a powerful tool that allows users to execute commands in a text-based interface. One of the most useful features of the Linux CLI is the ability to turn a series of commands into a Bash script. This can be particularly useful when performing repetitive tasks or automating complex processes. In this blog post, we will provide in-depth instructions on how to use Linux Command Line Interface for turning commands into a Bash script.  We will cover topics such as using  "/bin/bash" variables arguments "for loops" echo the exit status.  We will also provide snippet examples to help illustrate each of these concepts. Using "/bin/bash" The first step in creating a Bash script is to define the interpreter that will be used to run the script. This is done using the shebang line at the beginning of the script. The shebang line co...

LPI E - Archiving

LPI E - Archiving 3.1 Review 3.1 Archiving Files on the Command Line      In this blog, we will discuss how Linux uses compression for files, directories, archives using tar, and other compression tools like gzip, bzip2, xz, zip, and unzip.          One of the unique features of Linux is its ability to compress and decompress files and directories to reduce their size. This feature is particularly useful when transferring or archiving large files, saving disk space, and improving system performance. Tar      Tar is an acronym for Tape Archive, and it is a command-line tool used for archiving files and directories. It allows you to ... create list extract compress      ... files in a single operation. The tar command is used to create a tar archive by grouping multiple files or directories into a single file. The syntax for creating an archive is as follows:     $ tar -cvf archive.tar file1 fi...

LPI E - netstat route

LPI E - Quick Review 4.4      Linux is an open-source operating system widely used for networking purposes. To ensure seamless communication between different devices, various tools are employed in Linux.    Some of the tools employed in Linux networking include Routers Querying DNS client configuration Querying network configuration route ip route show ifconfig ip addr show netstat ss /etc/resolv.conf /etc/hosts IPv4 IPv6 ping host In this quick review, we will delve into each of these tools to understand their role in Linux networking ...      Firstly, a network refers to a group of devices that are interconnected to share resources and data. A router , on the other hand, is a device that connects different networks. It determines the best path that data should take to reach its destination. In Linux, querying DNS client configuration is a crucial task since it enables users to know the IP address of a domain name. This can be achieved by usin...

LPI A - Path Challenges

LPI Certification Challenges The Linux Professional Institute (LPI) certification paths cover a wide range of topics related to Linux system administration and are designed to validate the knowledge and skills of professionals in various areas of Linux. Learners may find different areas more or less challenging depending on their backgrounds and experience. However, with dedicated study and practice, learners can develop the knowledge and skills needed to earn their LPI certifications and excel in Linux system administration. Here are a few areas more difficult than others. Networking Networking is a critical component of Linux system administration, and it can be a challenging area of knowledge to master. Networking topics covered in the LPI certification paths include Configuring network interfaces Routing   DNS   DHCP   Firewall configuration   Security Security is an increasingly important aspect of system administration, and the LPI certification...

LPI E - Shell Test

LPI E - Shell Command Test Answers are included at the end ... Basic shell commands Which command is used to display the contents of a file in the terminal? cat ls mkdir pwd What command can be used to create a new directory in the current working directory? cat ls mkdir pwd Command line syntax What is the syntax for using the "ls" command to display all files in a directory, including hidden files? ls -a ls -l ls -h ls -r Which symbol is used to redirect the output of a command to a file? > | < & Variables How do you declare a new variable in a shell script? $my_var="hello" my_var="hello" var my_var="hello" export my_var="hello" What is the value of the variable "my_var" in the following command: my_var="hello" && echo $my_var hello $my_var echo $my_var my_var="hello" Quoting What is the difference between using single quotes and double quotes to enclose a string in the shell? Single quot...