If you have one or more files that you need to send to a friend or store for a long time, compressing the files into a .zip archive is a good way to save on space and combine all files into a single object. If you need to keep the file contents private, for fear that they could be intercepted by the wrong party, or that someone could try to access them on your own system, then it is possible to add a password to your zip file. In this tutorial, you will learn how to zip files and add a password to your zip archive on a Linux system.
When you need to quickly or forcibly close a running process on a Linux system, many users will try to determine the process ID and then kill a process by its ID. While this works fine, it is sometimes easier or more convenient to kill a process by name. This way, we get to skip the step of looking up the process ID, and let our terminal do the work for us.
Everything that is currently running on your Linux system is a process. Some processes are meant to run in the background (application updates, for example), so you may not be readily aware of their existence. And other processes (a web browser, for example) are very apparent, and get started or stopped by the user on a constant basis. All of these processes are assigned an ID number, called PID or “Process ID”, and can be referenced in various situations, including killing a running process via the process ID.
Environment variables contain data about the current system configuration. These variables are mostly referenced by scripts and system programs that need some information on the current configuration in order to adapt to various scenarios. For example, a script might check an environment variable to see what language is set on the computer, and then output prompts in the target language. One of the most commonly accessed environment variables is the PATH environment variable.
When it comes to managing remote systems in Linux, the SSH protocol is the most used method. SSH is popular because it allows a user to securely log in to remote devices, including other Linux systems, firewalls, routers, etc. When you are done with your remote management, you can quit out of the SSH connection.
Most of us longtime Linux users have the
ifconfig command seared into our brain, after years of repetitive use. It comes as a shock to some when they type the command and are met with an error message (ifconfig command not found). Indeed, the command has become deprecated, but it’s still possible to install ifconfig command.
When working with text on the command line, it is sometimes useful to join multiple lines together. Rather than going through text files and manually shifting lines around to be on the same line, our Linux system provides us with multiple tools to simplify this task for us. Log files are a good example of text that is usually split up onto multiple lines, and sometimes it is easier to visualize the data when some lines are joined together. In this tutorial, we will show you several ways to join lines of a file together on a Linux system.
Have you ever been in the middle of using your command line terminal, and suddenly needed to open the file explorer? In some cases, it can be easier or more convenient to visualize the contents of a directory from a graphical file explorer, rather than using the ls command or others to sift through the files. Fortunately, Linux gives us an easy way to open a file explorer and have it navigate directly to the directory we are currently viewing in the terminal.
The telnet utility, a once common protocol that graced the terminal of every system administrator and power user, was a precursor for the SSH protocol. Since telnet sends all data, including usernames and passwords, over the network in clear text, it is not often used anymore. Despite the other protocols that have come to replace it, telnet remains an ideal utility to test the connection to a certain port of a device, and can be handy in other niche scenarios, or even send an email.
When using the Bash shell on a Linux system, we can send the output of a command to somewhere else, by passing it to another command or a file, for example. This is called Bash shell redirection. It is useful in many different scenarios, and is one of the most basic and essential components of learning to use the Bash shell and Bash scripting.
Linux is a multi user operating system, meaning that it supports having multiple simultaneous user accounts. Some Linux systems may have a few different accounts, and others could have hundreds, depending on the purpose of the system. Switching between user accounts is a common task for Linux administrators who are in charge of user account management, as it allows them to test permissions or troubleshoot problems.
Linux users will inevitably need to log into the root account, or use administrator privileges, quite frequently. Tasks like installing or removing software, configuring system settings, adjusting file permissions, and many others usually require access to the root user account in order to perform. The root account can be accessed either by logging directly into the account, or by using the
sudo Linux command to temporarily access root and execute a command with administrator privileges. In this tutorial, we will show you how to change to the root account on a Linux system, and how to use
sudo to execute commands with root privileges.