When setting up a new Linux server, there are several utilities that can significantly enhance your system’s functionality and ease your troubleshooting process. While most Linux distributions come pre-loaded with a plethora of command utilities, a minimal operating system installation might not include all these tools.
This guide will walk you through seven essential Linux utilities that you should consider installing on your server. These utilities are equally functional in CentOS or Red Hat Enterprise Linux (RHEL).
Identifying Missing Utilities
Before we delve into the specifics of each utility, it’s important to know how to identify whether a utility is installed on your Linux operating system. If a utility is missing, you’ll see one or more of the following warnings:
[root@rhel62 ~]# wget -bash: wget: command not found [root@rhel62 ~]# telnet -bash: telnet: command not found [root@rhel62 ~]# scp -bash: scp: command not found [root@rhel62 ~]# man scp -bash: man: command not found [root@rhel62 ~]# nslookup -bash: nslookup: command not found [root@rhel62 ~]# dig -bash: dig: command not found [root@rhel62 ~]# host -bash: host: command not found
Seven Essential Linux Utilities
Let’s now explore each of these seven utilities in detail.
1. wget
Wget is a network utility that retrieves files from the Web using HTTP and FTP, the two most widely used Internet protocols. It’s a handy tool for downloading files from the internet directly to your server.
[root@rhel62 ~]# wget http://files2.zimbra.com/downloads/8.0.2_GA/zcs-8.0.2_GA_5569.RHEL6_64.20121210115059.tgz
2. telnet
Telnet is a network protocol used on the Internet or local area networks. It’s a user command and an underlying TCP/IP protocol for accessing remote computers. Telnet is very useful for troubleshooting and verifying the opened ports.
[root@rhel62 ~]# telnet localhost 25 Trying ::1... Connected to localhost. Escape character is '^]'. 220 rhel62.webhostinggeeks-dev2.local ESMTP Postfix
3. scp
Secure Copy Protocol (scp) is a remote file copy utility between hosts on a network. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.
[root@rhel62 ~]# scp root@192.168.2.60:/tmp/VMwareTools-9.2.2-893683.tar.gz . The authenticity of host '192.168.2.60 (192.168.2.60)' can't be established. RSA key fingerprint is 76:78:87:36:44:c1:46:fa:c4:b4:61:4a:e5:b3:be:e3. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.2.60' (RSA) to the list of known hosts. root@192.168.2.60's password: VMwareTools-9.2.2-893683.tar.gz 100% 63MB 63.3MB/s 00:01
4. man
The ‘man’ command is used to display the manual page for other commands. It helps to explain the functions for the commands that are commonly used.
Example :
[root@rhel62 ~]# man wget
WGET(1) GNU Wget WGET(1) NAME Wget - The non-interactive network downloader. SYNOPSIS wget [option]... [URL]... DESCRIPTION GNU Wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. Wget is non-interactive, meaning that it can work in the background, while the user is not logged on. This allows you to start a retrieval and disconnect from the system, letting Wget finish the work. By contrast, most of the Web browsers require constant userâs presence, which can be a great hindrance when transferring a lot of data. Wget can follow links in HTML, XHTML, and CSS pages, to create local versions of remote web sites, fully recreating the directory structure of the original site. This is sometimes referred to as "recursive downloading." While doing that, Wget respects the Robot Exclusion Standard (/robots.txt). Wget can be instructed to convert the links in downloaded files to point at the local files, for offline viewing.
5. nslookup, dig, host
These three utilities – nslookup, dig, and host – are part of the bind utilities. They are the basic tools for DNS client and DNS server troubleshooting.
Examples:
[root@rhel62 ~]# nslookup > set type=mx > webhostinggeeks-dev2.com Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: webhostinggeeks-dev2.com mail exchanger = 0 webhostinggeeks-dev2.com. Authoritative answers can be found from: >
[root@rhel62 ~]# dig webhostinggeeks-dev2.com ; < <>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6 < <>> webhostinggeeks-dev2.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<
[root@rhel62 ~]# host -t mx webhostinggeeks-dev2.com webhostinggeeks-dev2.com mail is handled by 0 webhostinggeeks-dev2.com.
Installation of Utilities
To install these utilities, you can simply run the following command:
[root@rhel62 ~]# yum install wget telnet openssh-clients bind-utils man -y
Commands Mentioned
- wget – Retrieves files from the web using HTTP and FTP protocols
- telnet – A network protocol used for accessing remote computers
- scp – A remote file copy utility that uses ssh for data transfer
- man – Displays the manual page for other commands
- nslookup – A utility for DNS client and server troubleshooting
- dig – Another utility for DNS client and server troubleshooting
- host – A utility for DNS client and server troubleshooting
Conclusion
In conclusion, these seven utilities – wget, telnet, scp, man, nslookup, dig, and host – are essential tools for any Linux server administrator. They enhance the functionality of your system and aid in troubleshooting various issues. By understanding what each utility does and how to use it, you can significantly improve your efficiency and effectiveness as a server administrator.
Remember, the installation of these utilities is straightforward and can be done with a single command. However, always ensure that you understand the purpose and function of each utility before using it. This will help you avoid potential issues and make the most of these powerful tools.
For more in-depth information about various server types, you can visit the following pages:
These resources provide a wealth of information about servers like Apache, Nginx, LiteSpeed, and various hosting options like dedicated server, VPS server, cloud hosting, and shared hosting.
FAQs
-
What is the purpose of the wget utility?
Wget is a network utility used to retrieve files from the Web using HTTP and FTP, the two most widely used Internet protocols. It’s useful for downloading files directly to your server.
-
How does the telnet utility aid in troubleshooting?
Telnet is a network protocol used for accessing remote computers. It’s particularly useful for troubleshooting as it allows you to verify open ports on your system.
-
What does the scp utility do?
Secure Copy Protocol (scp) is a remote file copy utility that operates between hosts on a network. It uses ssh for data transfer, providing the same level of security and authentication as ssh.
-
What is the function of the ‘man’ command?
The ‘man’ command is used to display the manual page for other commands, helping to explain their functions. The term ‘man’ is short for manual.
-
What are nslookup, dig, and host utilities used for?
nslookup, dig, and host are part of the bind utilities. They are basic tools used for DNS client and DNS server troubleshooting, helping to resolve and investigate DNS-related issues.