Author Archives: Sandra Henry-Stocker
Author Archives: Sandra Henry-Stocker
Linux systems provide many ways to look at disk partitions. In this post, we'll look at a series of commands, each which shows useful information but in a different format and with a different focus. Maybe one will make your favorites list.lsblk One of the most useful commands is the lsblk (list block devices) command that provides a very nicely formatted display of block devices and disk partitions. In the example below, we can see that the system has two disks (sda and sdb) and that sdb has both a very small (500M) partition and a large one (465.3G). Disks and partitions (part) are clearly labeled, and the relationship between the disks and partitions is quite obvious. We also see that the system has a cdrom (sr0).To read this article in full, please click here
Not everyone thinks in binary or wants to mentally insert commas into large numbers to come to grips with the sizes of their files. So it's not surprising that Linux commands have evolved over several decades to incorporate more human-friendly ways of displaying information to its users. In today’s post, we’re going to look at some of the options provided by various commands that make digesting data just a little easier.Why not default to friendly? If you’re wondering why human-friendliness isn’t the default –- we humans are, after all, the default users of computers -- you might be asking yourself “Why do we have to go out of our way to get command responses that will make sense to everyone?” The answer is primarily that changing the default output of commands would likely interfere with numerous other processes that were built to expect the default responses. Other tools as well as scripts that have been developed over the decades might break in some very ugly ways if they were suddenly fed output in a very different format than what they were built to expect. It’s probably also true that some of us might prefer to see all of Continue reading
Not everyone thinks in binary or wants to mentally insert commas into large numbers to come to grips with the sizes of their files. So, it's not surprising that Linux commands have evolved over several decades to incorporate more human-friendly ways of displaying information to its users. In today’s post, we look at some of the options provided by various commands that make digesting data just a little easier.Why not default to friendly? If you’re wondering why human-friendliness isn’t the default –- we humans are, after all, the default users of computers — you might be asking yourself, “Why do we have to go out of our way to get command responses that will make sense to everyone?” The answer is primarily that changing the default output of commands would likely interfere with numerous other processes that were built to expect the default responses. Other tools, as well as scripts, that have been developed over the decades might break in some very ugly ways if they were suddenly fed output in a very different format than what they were built to expect.To read this article in full, please click here
How much can your Linux system tell you about the kernel it's running and what commands are available to help you ask? Let's run through some of them.uname The simplest and most straight-forward command for providing information on your kernel is the uname -r command. It provides a succinct answer to your question but in a format that also includes a number of fields each which provides a particular piece of information.$ uname -r 4.15.0-30-generic ^ ^ ^ ^ ^ | | | | | | | | | | | | | | +-- the distribution-specific string | | | +------- the latest bug fix | | +---------- the minor revision | +------------ the major revision +--------------- the kernel version Add an "s" and your output will include the kernel's name:To read this article in full, please click here
There are many reasons to encrypt files — even on a system that is well maintained and comparatively secure. The files may highly sensitive, contain personal information that you don't want to share with anyone, or be backed up to some variety of online storage where you'd prefer it be extra secure.Fortunately, commands for reliably encrypting files on Linux systems are easy to come by and quite versatile. One of the most popular is gpg.gpg vs pgp and OpenPGP Used both to encrypt files in place and prepare them to be sent securely over the Internet, gpg is related to, but not the same as, pgp and OpenPGP. While gpg is based on the OpenPGP standards established by the IETF, it is — unlike pgp — open source. Here's the rundown:To read this article in full, please click here
Kubernetes is one of the most important innovations to hit Linux in decades — and one that's making big changes in how critical services are being deployed. It’s not an operating system, an app, or a container, but a container-specific management environment — and it's making applications and services remarkably more manageable.You can think of Kubernetes as a portable cloud platform, as a container platform, or as a microservices platform that takes advantage of both the simplicity of Platform as a Service (PaaS) and the flexibility of Infrastructure as a Service (IaaS). Regardless of how you define it, what you get by investing your time and technology in Kubernetes will be some very impressive options for:To read this article in full, please click here
Want to do a quick performance check on your Linux system? You might want to take a look at the dstat command. Dstat provides valuable insights into Linux system performance, pretty much replacing a collection of older tools such as vmstat, netstat, iostat, and ifstat with a flexible and powerful command that combines their features.With this one command, you can look at virtual memory, network connections and interfaces, CPU activity, input/output devices and more. In today's post, we'll examine some dstat commands and see what they can show you about your systems. [ Two-Minute Linux Tips: Learn how to master a host of Linux commands in these 2-minute video tutorials ] Dstat options and defaults First, let's start with a fairly simple command. With the dstat -c (CPU) option, dstat displays CPU stats. In the example below, we're asking for two-second intervals and six reports.To read this article in full, please click here
Most of us probably know how wonderful a tool Gimp is for editing images, but have you ever thought about manipulating image files on the command line? If not, let me introduce you to the convert command. It easily coverts files from one image format to another and allows you to perform many other image manipulation tasks as well -- and in a lot less time than it would take to make these changes uses desktop tools. Let's look at some simple examples of how you can make it work for you.Converting files by image type Coverting an image from one format to another is extremely easy with the convert command. Just use a convert command like the one in this example:To read this article in full, please click here
Gentoo GitHub hack: What happened? Late last month (June 28), the Gentoo GitHub repository was attacked after someone gained control of an admin account. All access to the repositories was soon removed from Gentoo developers. Repository and page content were altered. But within 10 minutes of the attacker gaining access, someone noticed something was going on, 7 minutes later a report was sent, and within 70 minutes the attack was over. Legitimate Gentoo developers were shut out for 5 days while the dust settled and repairs and analysis were completed.The attackers also attempted to add "rm -rf" commands to some repositories to cause user data to be recursively removed. As it turns out, this code was unlikely to be run because of technical precautions that were in place, but this wouldn't have been obvious to the attacker.To read this article in full, please click here
Gentoo GitHub hack: What happened? Late last month (June 28), the Gentoo GitHub repository was attacked after someone gained control of an admin account. All access to the repositories was soon removed from Gentoo developers. Repository and page content were altered. But within 10 minutes of the attacker gaining access, someone noticed something was going on, 7 minutes later a report was sent, and within 70 minutes the attack was over. Legitimate Gentoo developers were shut out for 5 days while the dust settled and repairs and analysis were completed.The attackers also attempted to add "rm -rf" commands to some repositories to cause user data to be recursively removed. As it turns out, this code was unlikely to be run because of technical precautions that were in place, but this wouldn't have been obvious to the attacker.To read this article in full, please click here
Quick to install, safe to run, easy to update, and dramatically easier to maintain and support, snaps represent a big step forward in Linux software development and distribution. Starting with Ubuntu and now available for Arch Linux, Debian, Fedora, Gentoo Linux and openSUSE, snaps offer a number of significant advantages over traditional application packaging. Compared to traditional packages, snaps are: easier for developers to build faster to install automatically updated autonomous isolated from other apps more secure non-disruptive (they don't interfere with other applications) So what are snaps? Snaps were originally designed and built by Canonical for use on Ubuntu. The service might be referred to as “snappy”, the technology “snapcraft”, the daemon “snapd” and the packages “snaps”, but they all refer to a new way that Linux apps are prepared and installed. Does the name “snap” imply some simplification of the development and installation process? You bet it does!To read this article in full, please click here
The rm command easily makes files disappear from our file listings, but what does it actually do and how can we ensure that files are unlikely to be recoverable?A little background To understand what happens when you remove a file from a Linux system with rm, first think about inodes -- those intriguing data structures that keep track of all of a file's attributes -- often called "metadata" -- that describe the file. This includes its name, its owner and group, what permissions have been established and where the file's contents can be found on the disk.Next, think about Linux directories. While they take the appearance and character of folders (i.e., merely containers for holding files) they are actually files themselves -- files that include no more than the names and inode numbers of the files they "contain". So, what we get is a convenient way to think about directories and files in the same way you might think about the folders and paperwork in your file cabinets (if any of you still have one of those).To read this article in full, please click here
There are quite a few control sequences available on Linux systems— many I use routinely, and some I've only just recently discovered— and they can be surprisingly useful. In today's post, we're going to run through a series of them and take a look at what they do and how they might be useful.To start, unless you're brand spanking new to the command line, you are undoubtedly familiar with the ctrl-c sequence that is used to terminate a running command. In print, this same sequence might be expressed as ^c or control-c and sometimes the "c" will be capitalized, but the expression always means "hold the control key and press the key specified — with no shift key or hyphen involved.To read this article in full, please click here
Red Hat just announced its role in bringing a top scientific supercomputer into service in the U.S. Named “Summit” and housed at the Department of Energy’s OAK Ridge National Labs, this system with its 4,608 IBM compute servers is running — you guessed it — Red Hat Enterprise Linux.The Summit collaborators With IBM providing its POWER9 processors, Nvidia contributing its Volta V100 GPUs, Mellanox bringing its Infiniband into play, and Red Hat supplying Red Hat Enterprise OS, the level of inter-vendor collaboration has reached something of an all-time high and an amazing new supercomputer is now ready for business.To read this article in full, please click here
There are a number of ways to compare files and directories on Linux systems. The diff, colordiff, and wdiff commands are just a sampling of commands that you're like to run into. Another is comm. The command (think "common") lets you compare files in side-by-side columns the contents of individual files.Where diff gives you a display like this showing the lines that are different and the location of the differences, comm offers some different options with a focus on common content. Let's look at the default output and then some other features.Here's some diff output -- displaying the lines that are different in the two files and using < and > signs to indicate which file each line came from.To read this article in full, please click here
There are a number of ways to compare files and directories on Linux systems. The diff, colordiff, and wdiff commands are just a sampling of commands that you're likely to run into. Another is comm. The command (think "common") lets you compare files in side-by-side columns the contents of individual files.Where diff gives you a display like this showing the lines that are different and the location of the differences, comm offers some different options with a focus on common content. Let's look at the default output and then some other features.Here's some diff output — displaying the lines that are different in the two files and using < and > signs to indicate which file each line came from.To read this article in full, please click here
Linux users have for many decades been using simple cp and mv commands to copy and rename files. These commands are some of the first that most of us learned and are used every day by possibly millions of people. But there are other techniques, handy variations, and another command for renaming files that offers some unique options.First, let’s think about why might you want to copy a file. You might need the same file in another location or you might want a copy because you’re going to edit the file and want to be sure you have a handy backup just in case you need to revert to the original file. The obvious way to do that is to use a command like “cp myfile myfile-orig”.To read this article in full, please click here
The logger command provides an easy way to add log files to /var/log/syslog -- from the command line, from scripts or from other files. In today's post, we'll take a look at how it works.How easy is easy? This easy. Just type logger <message> on the command line and your message will be added to the end of the /var/log/syslog file.$ logger comment to be added to log $ tail -1 /vvar/log/syslog May 21 18:02:16 butterfly shs: comment to be added to log Command output You can also add the output from commands by enclosing the commands in backticks.$ logger `who` $ tail -1 /var/log/syslog May 21 18:02:43 butterfly shs: shs pts/0 2018-05-21 15:57 (192.168.0.15) Content from a file The contents of text files can be added by using the -f option. Put the name of the file to be added to the log following the -f option as shown below.To read this article in full, please click here
The logger command provides an easy way to add log files to /var/log/syslog — from the command line, from scripts, or from other files. In today's post, we'll take a look at how it works.How easy is easy? This easy. Just type logger <message> on the command line and your message will be added to the end of the /var/log/syslog file.$ logger comment to be added to log $ tail -1 /vvar/log/syslog May 21 18:02:16 butterfly shs: comment to be added to log Command output You can also add the output from commands by enclosing the commands in backticks.$ logger `who` $ tail -1 /var/log/syslog May 21 18:02:43 butterfly shs: shs pts/0 2018-05-21 15:57 (192.168.0.15) [ Two-Minute Linux Tips: Learn how to master a host of Linux commands in these 2-minute video tutorials ] Content from a file The contents of text files can be added by using the -f option. Put the name of the file to be added to the log following the -f option as shown below.To read this article in full, please click here
There are many aspects to security on Linux systems – from setting up accounts to ensuring that legitimate users have no more privilege than they need to do their jobs. This is look at some of the most essential security commands for day-to-day work on Linux systems.To read this article in full, please click here(Insider Story)