Sandra Henry-Stocker

Author Archives: Sandra Henry-Stocker

Looking at your Linux system’s network interface with ethtool

The ethtool utility on Linux allows you to view and change some of your network-driver and interface-card settings, especially for wired devices. These include their speed, whether the interface uses auto-negotiation, and whether it runs in half- or full-duplex mode. Ethtool also provides an easy way to view or troubleshoot your network interface.More than likely, ethtool is already available on your Linux system. However, to check, you can use one or both of these commands:$ which ethtool /usr/sbin/ethtool $ sudo ethtool —version ethtool version 5.13 To get a sense of how this utility can control settings, run a command like the one below. The -h means “help”. You’ll likely find yourself looking at 10 pages or so of syntax like what is shown here.To read this article in full, please click here

Looking at your Linux system’s network interface with ethtool

The ethtool utility on Linux allows you to view and change some of your network-driver and interface-card settings, especially for wired devices. These include their speed, whether the interface uses auto-negotiation, and whether it runs in half- or full-duplex mode. Ethtool also provides an easy way to view or troubleshoot your network interface.More than likely, ethtool is already available on your Linux system. However, to check, you can use one or both of these commands:$ which ethtool /usr/sbin/ethtool $ sudo ethtool —version ethtool version 5.13 To get a sense of how this utility can control settings, run a command like the one below. The -h means “help”. You’ll likely find yourself looking at 10 pages or so of syntax like what is shown here.To read this article in full, please click here

Managing and monitoring swap space on Linux

Most of us don't often think about swap space unless we run into a problem on our systems that suggests we don't have enough. Even so, viewing and gauging the adequacy of swap space on a system is not overly complicated, and knowing what's normal for your system can help you spot when something is wrong. So let's check out some commands that can help you look into your swap space. But first, let's review some fundamentals.What swap space is and how it's used Swap space is disk space that acts something like an extension of memory. It gets used when the system's physical memory (RAM) is full and the system needs more memory resources. It's called "swap" because the system will move some inactive pages in memory into the swap space so that it can accommodate more data in RAM. In other words, it provides a way to free up RAM on a busy system.To read this article in full, please click here

Managing and monitoring swap space on Linux

Most of us don't often think about swap space unless we run into a problem on our systems that suggests we don't have enough. Even so, viewing and gauging the adequacy of swap space on a system is not overly complicated, and knowing what's normal for your system can help you spot when something is wrong. So let's check out some commands that can help you look into your swap space. But first, let's review some fundamentals.What swap space is and how it's used Swap space is disk space that acts something like an extension of memory. It gets used when the system's physical memory (RAM) is full and the system needs more memory resources. It's called "swap" because the system will move some inactive pages in memory into the swap space so that it can accommodate more data in RAM. In other words, it provides a way to free up RAM on a busy system.To read this article in full, please click here

Sleeping and waiting on Linux

The Linux sleep and wait commands allow you to run commands at a chosen pace or capture and display the exit status of a task after waiting for it to finish. Sleep simply inserts a timed pause between commands. Wait, on the other hand, waits until a process completes before notifying you that it has finished.Sleep The sleep command pauses for a specified time. It’s generally used in a script, but works on the command line as well. In the example below, sleep pauses a minute between the two date commands.$ date; sleep 60; date Wed Sep 8 12:10:40 PM EDT 2021 Wed Sep 8 12:11:40 PM EDT 2021 Summarizing your command-line usage on Linux The sleep command takes the numeric argument as the number of seconds. You can, however, ask it to sleep for various amounts of time by adding another character to the argument: 1m = 1 minute 2h = 2 hours 3d = 3 days $ date; sleep 1m; date Wed Sep 8 12:16:38 PM EDT 2021 Wed Sep 8 12:17:38 PM EDT 2021 In fact, you can sleep for less than a second if you need.To read this article in full, please click here

Sleeping and waiting on Linux

The Linux sleep and wait commands allow you to run commands at a chosen pace or capture and display the exit status of a task after waiting for it to finish. Sleep simply inserts a timed pause between commands. Wait, on the other hand, waits until a process completes before notifying you that it has finished.Sleep The sleep command pauses for a specified time. It’s generally used in a script, but works on the command line as well. In the example below, sleep pauses a minute between the two date commands.$ date; sleep 60; date Wed Sep 8 12:10:40 PM EDT 2021 Wed Sep 8 12:11:40 PM EDT 2021 Summarizing your command-line usage on Linux The sleep command takes the numeric argument as the number of seconds. You can, however, ask it to sleep for various amounts of time by adding another character to the argument: 1m = 1 minute 2h = 2 hours 3d = 3 days $ date; sleep 1m; date Wed Sep 8 12:16:38 PM EDT 2021 Wed Sep 8 12:17:38 PM EDT 2021 In fact, you can sleep for less than a second if you need.To read this article in full, please click here

Using the Linux set command

The Linux set command allows you to change the value of shell options or to display the names and values of shell variables. Rarely used, it is a bash builtin, but is quite a bit more complicated than most builtins.If you use the command without any arguments, you will get a list of all the settings—the names and values of all shell variables and functions. Watch out though! You’ll end up with a torrent of output flowing down your screen. There are just short of 3,000 lines of output on my Fedora system:$ set | wc -l 2954 The top of the list looks like what you see below, but the output gets considerably more complicated as you move through it.To read this article in full, please click here

Using the Linux set command

The Linux set command allows you to change the value of shell options or to display the names and values of shell variables. Rarely used, it is a bash builtin, but is quite a bit more complicated than most builtins.If you use the command without any arguments, you will get a list of all the settings—the names and values of all shell variables and functions. Watch out though! You’ll end up with a torrent of output flowing down your screen. There are just short of 3,000 lines of output on my Fedora system:$ set | wc -l 2954 The top of the list looks like what you see below, but the output gets considerably more complicated as you move through it.To read this article in full, please click here

Linux turns 30

Something happened back in 1991 that dramatically changed the future of computing. Linus Torvalds, a Finnish-American software engineer, released the Linux kernel and the second version of the GNU General Public License (GPLv2). A good portion of the technology we use today would not be what it is had this not happened.It all started on August 25th of that year when Torvalds announced in a usenet post that he was working on a free OS and that it would be ready within a few months. He also said it "won't be big and professional like gnu," but that wasn't exactly how things turned out!The GPL The beauty of the Gnu GPL was that, instead of restricting what users can do with the Linux kernel, it maximized their rights. Richard Stallman, GNU founder, referred to these rights as the "four freedoms." They include the freedom to run, copy, study/improve and distribute. This was akin to turning the function of a license inside out.To read this article in full, please click here

Linux turns 30

Something happened back in 1991 that dramatically changed the future of computing. Linus Torvalds, a Finnish-American software engineer, released the Linux kernel and the second version of the GNU General Public License (GPLv2). A good portion of the technology we use today would not be what it is had this not happened.It all started on August 25th of that year when Torvalds announced in a usenet post that he was working on a free OS and that it would be ready within a few months. He also said it "won't be big and professional like gnu," but that wasn't exactly how things turned out!The GPL The beauty of the Gnu GPL was that, instead of restricting what users can do with the Linux kernel, it maximized their rights. Richard Stallman, GNU founder, referred to these rights as the "four freedoms." They include the freedom to run, copy, study/improve and distribute. This was akin to turning the function of a license inside out.To read this article in full, please click here

Choosing and changing your Linux shell

There are quite a few shells on Linux system and more that can be easily added. This post examines some of the more popular shells, how they differ and the files that contribute to their configuration.The default shell on most Linux systems is bash. Unless you make an effort, any user accounts added to the system will be assigned bash as their login shell. Bash has been around since 1989 and was meant to replace the Bourne shell (sh). In fact, if you take a look at /bin/sh, you'll probably find that it's nothing more than a symbolic link to /bin/bash.$ ls -l /bin/sh lrwxrwxrwx. 1 root root 4 Jan 25 2021 /bin/sh -> bash Summarizing your command-line usage on Linux   Popular Shells Some of the best and most popular shells include:To read this article in full, please click here

Choosing and changing your Linux shell

There are quite a few shells on Linux system and more that can be easily added. This post examines some of the more popular shells, how they differ and the files that contribute to their configuration.The default shell on most Linux systems is bash. Unless you make an effort, any user accounts added to the system will be assigned bash as their login shell. Bash has been around since 1989 and was meant to replace the Bourne shell (sh). In fact, if you take a look at /bin/sh, you'll probably find that it's nothing more than a symbolic link to /bin/bash.$ ls -l /bin/sh lrwxrwxrwx. 1 root root 4 Jan 25 2021 /bin/sh -> bash Summarizing your command-line usage on Linux   Popular Shells Some of the best and most popular shells include:To read this article in full, please click here

How password hashing works on Linux

You may know that passwords are hashed on Linux systems, and the hashes are stored in the restricted access /etc/shadow file. But did you know that you can also determine the hash method that was used and report the number of days since a password was last changed from this file as well?To look at a user record in the /etc/shadow file, run a command like this:$ sudo grep nemo /etc/shadow You should see a line that looks something like this:nemo:$6$FVYIIgcEcObSsUcf$FsSBlV9soVt.Owbd4xnvhlZzjx73ZBQQBT0WMyah6qcdnH91tBf9C4EaYbRtr7jKGETP/TwBNjyrDFqhvK0NV1:18698:7:90:7::: Viewing and configuring password aging on Linux   In spite of how long that line is, it's quite easy to parse. The first two fields in the lines of this colon-separated file store:To read this article in full, please click here

How password hashing works on Linux

You may know that passwords are hashed on Linux systems, and the hashes are stored in the restricted access /etc/shadow file. But did you know that you can also determine the hash method that was used and report the number of days since a password was last changed from this file as well?To look at a user record in the /etc/shadow file, run a command like this:$ sudo grep nemo /etc/shadow You should see a line that looks something like this:nemo:$6$FVYIIgcEcObSsUcf$FsSBlV9soVt.Owbd4xnvhlZzjx73ZBQQBT0WMyah6qcdnH91tBf9C4EaYbRtr7jKGETP/TwBNjyrDFqhvK0NV1:18698:7:90:7::: Viewing and configuring password aging on Linux   In spite of how long that line is, it's quite easy to parse. The first two fields in the lines of this colon-separated file store:To read this article in full, please click here

Using the Linux cut command to grab portions of lines from files

One surprisingly easy command for grabbing a portion of every line in a text file on a Linux system is cut. It works something like awk in that it allows you to select only what you want to see from files, enabling you to pull fields (regardless of the delimiter used), characters or bytes. To check on cut, you can ask about its version like this:$ cut --version cut (GNU coreutils) 8.32 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David M. Ihnat, David MacKenzie, and Jim Meyering. Selecting by field To illustrate how the cut command works, we'll first run commands using a sample "cities" file that contains details of the largest cities in the US in a tab-separated format. The lines in this file look something like what is shown below:To read this article in full, please click here

Using the Linux cut command to grab portions of lines from files

One surprisingly easy command for grabbing a portion of every line in a text file on a Linux system is cut. It works something like awk in that it allows you to select only what you want to see from files, enabling you to pull fields (regardless of the delimiter used), characters or bytes. To check on cut, you can ask about its version like this:$ cut --version cut (GNU coreutils) 8.32 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David M. Ihnat, David MacKenzie, and Jim Meyering. Selecting by field To illustrate how the cut command works, we'll first run commands using a sample "cities" file that contains details of the largest cities in the US in a tab-separated format. The lines in this file look something like what is shown below:To read this article in full, please click here

The many faces of awk

If you only use awk when you need to select specific fields from lines of text, you might be missing out on a lot of other services that the command can provide. In this post, we'll look at this simple use along with many other things that awk can do for you with enough examples to show you that the command is a lot more flexible than you might have imagined.Plucking out columns of data The easiest and most commonly used service that awk provides is selecting specific fields from files or from data that is piped to it. With the default of using white space as a field separator, this is very simple:To read this article in full, please click here

Viewing enabled and running services on Linux with systemctl

A vast majority of Linux systems these days are using systemd – a suite of programs aimed at managing and interconnecting different parts of the system. Systemd started replacing the init process back in 2014 and is now the first process that starts when most Linux systems boot. To get a quick peek, you can run a command like this, which verifies that process 1 is indeed systemd. On this system, two additional systemd processes are currently also running.$ ps -C systemd PID TTY TIME CMD 1 ? 00:00:59 systemd <=== 1244 ? 00:00:00 systemd 54429 ? 00:00:00 systemd To see a little more detail, try the command below. The blank within the quotes is meant to prevent related processes like systemd-journald from showing up in the list.To read this article in full, please click here

Viewing enabled and running services on Linux with systemctl

A vast majority of Linux systems these days are using systemd – a suite of programs aimed at managing and interconnecting different parts of the system. Systemd started replacing the init process back in 2014 and is now the first process that starts when most Linux systems boot. To get a quick peek, you can run a command like this, which verifies that process 1 is indeed systemd. On this system, two additional systemd processes are currently also running.$ ps -C systemd PID TTY TIME CMD 1 ? 00:00:59 systemd <=== 1244 ? 00:00:00 systemd 54429 ? 00:00:00 systemd To see a little more detail, try the command below. The blank within the quotes is meant to prevent related processes like systemd-journald from showing up in the list.To read this article in full, please click here

Commands to find Linux-package updates

Did you know that you can ask your Linux system to tell you what upgrades are available for the packages installed on it? You might be surprised by how many you’ll see, especially if you’re using the current release and don’t have your system set up for frequent or automatic updates.Updates play an important role in keeping your Linux systems secure and performing well. Since most packages are updated as fixes or improvements to the code become available, it’s hard to predict how many will show up on any particular day. (Note: Updates should be done when your system is not performing other important tasks.)Finding installed packages on Fedora Linux systems Fedora and related systems To check what updates are currently available for your Fedora or related system, use a command like this:To read this article in full, please click here

1 2 3 19