Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Essential Linux Commands

You're reading from   Essential Linux Commands 100 Linux commands every system administrator should know

Arrow left icon
Product type Paperback
Published in Nov 2023
Publisher Packt
ISBN-13 9781803239033
Length 250 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Paul Olushile Paul Olushile
Author Profile Icon Paul Olushile
Paul Olushile
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Part 1:Server Installations and Management Commands
2. Chapter 1: Getting a CentOS Server Up and Running FREE CHAPTER 3. Chapter 2: Linux User and Group Commands 4. Chapter 3: File Compression and Archival Commands 5. Part 2:Frequently Used Commands – Part 1
6. Chapter 4: Format and Disk Space Commands 7. Chapter 5: Linux Permissions Commands 8. Chapter 6: Filesystem Mount and Manipulation Commands 9. Part 3:Frequently Used Commands – Part 2
10. Chapter 7: File Content and Conversion Commands 11. Chapter 8: Linux SWAP Commands 12. Chapter 9: Linux Monitoring and Debugging Commands 13. Chapter 10: Linux IPTABLES and Network Commands 14. Chapter 11: File Transfer, Downloading, and Managing Log Files 15. Part 4:Linux Security and the Cloud
16. Chapter 12: Exploring Linux Security 17. Chapter 13: Linux in the Cloud 18. Index 19. Other Books You May Enjoy

Information commands

CentOS provides system administrators with a range of commands for obtaining information about various aspects of the system, including hardware, software, networks, and users. These commands are essential tools for monitoring and troubleshooting the system and its components, providing insight into the current status, configuration, and performance of the system. With the ability to obtain accurate and up-to-date information about the system, system administrators can quickly identify and resolve issues, ensuring optimal performance and the stability of the system. These commands provide information about the system’s hostname, disk usage, processes, CPU, and network interfaces, respectively, making them valuable tools for system administrators who need to diagnose and resolve system issues.

Here are a few commonly used information commands in CentOS:

  • uname: The uname command is used to display information about the operating system and the system’s hostname. This command can also display the type of hardware, the version of the operating system, and the release number of the kernel.
Figure 1.38 – Displaying the operating system

Figure 1.38 – Displaying the operating system

The uname command comes with different flags that can be executed; for example, the -a parameter displays the whole information, including the system name, network node hostname, kernel release, version, and machine hardware name, as we can see in the following terminal:

Figure 1.39 – Displaying all system information

Figure 1.39 – Displaying all system information

  • lsb_release: The lsb_release command is used to display information about the Linux Standard Base (LSB) version, distributor ID, and release number. The LSB is a standard that defines the Linux operating system and ensures compatibility among different Linux distributions.
Figure 1.40 – Displaying the Linux Standard Base version

Figure 1.40 – Displaying the Linux Standard Base version

To execute additional flags, we’ll make use of a flag commonly used by administrators to display the distributor indicator.

Figure 1.41 – Displaying Distributor Indicator

Figure 1.41 – Displaying Distributor Indicator

  • hostnamectl: The hostnamectl command is used to display and modify the system hostname and to view various system settings such as the operating system architecture, boot mode, and system time zone. This command is useful for changing the hostname or viewing system settings without having to log in to the system as a root user.
Figure 1.42 – Displaying the system settings and architecture

Figure 1.42 – Displaying the system settings and architecture

Let us execute hostnamectl with another flag, set-hostname. This flag is used to set the system hostname to a specified value. For example, you might execute hostnamectl set-hostname myhost:

Figure 1.43 – Setting a system hostname

Figure 1.43 – Setting a system hostname

The preceding useful information commands that we covered in this section will help you gather information about your system. Throughout this chapter, we emphasized the importance of proper server setup and installations, including regular software upgrades and updates, to ensure that your system runs smoothly and remains secure. By following the steps outlined in this chapter, you will be well on your way to setting up a reliable and secure server for your personal use, as well as building a foundation to further learn about Linux system administration.

You have been reading a chapter from
Essential Linux Commands
Published in: Nov 2023
Publisher: Packt
ISBN-13: 9781803239033
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image