The difference between common commands between CentOS/RedHat and Debian/Ubuntu

Key Differences Between CentOS and Ubuntu

based on Framework and distribution that implements a free, community-supported computing platform compatible with the corresponding upstream source Red Hat . In contrast, is a based on open source Linux distribution.

In this vs comparison, we will aim to provide an overview of the main features of both Linux distributions which will help you web Choose the correct operating system.

With the vast number of options available, choosing an operating system for your can be a very confusing task; especially if you want to use a Linux distribution. There are many options, but none as famous as Ubuntu or CentOS.

Whether you're a pro or a beginner, it often comes down to choosing between two options. It's safe to say there's no immediate decision. In this article, we're going to compare CentOS vs Ubuntu with the aim of finding out which one is best for you when setting up a VPS plan.


The difference between some commonly used commands

Centos 6/7/Ubuntu
1. package suffix*.rpm*.deb
2. Software source configuration file/etc/.conf/etc/apt/sources.list
3. Update the package listyum makecache apt-get update
4. Install software from software repositoryyum install packageapt-get install package
5. Install a downloaded packageyum install pkg.rpm
rpm -i pkg.rpm
dpkg -i pkg.deb
dpkg –install pkg.deb
6. Delete the software packagerpm -e package
yum remove package
apt-get remove package
apt-get purge package
7. Obtain information about a certain software package**yum search packageapt-cache search package
8. Get all installed software displayedyum list installed
dpkg -l
dpkg –list
9. Get information about installed software packagesrpm -qi packagedpkg –status packages
10. Network card configuration file/etc/sysconfig/network-scripts/ifcfg-eth0/etc/network/interfaces
11. selinux/etc/selinux/configno selinux
12.Allow root login by defaultRoot login is not allowed by default
13. Create userCreate user home directory by default
The default shell interpreter is bash
Interaction-free password creation – stdin
By default, no user home directory is created
The default shell interpreter is sh
Create password without interaction chpasswd
14. Firewall RulesDefault rulesBy default there are no rules
15. Permissionsroot or normal userDefault normal user permissions

Commonly used apt-get command parameters

apt-cache search packagesearch package
apt-cache show packageGet information about the package, such as description, size, version, etc.
apt-cache depends on packageUnderstand usage dependencies
apt-cache rdepends packageCheck which packages this package depends on
apt-get install packageInstallation package
apt-get install package –reinstallReinstall package
apt-get -f installFix install "-f=–fix-missing"
apt-get remove packageDelete package
apt-get remove package –purgeDelete packages, including deleting configuration files, etc.
apt-get updateupdate source
apt-get upgradeUpdate installed packages
apt-get dist-upgradeUpgrading the system
apt-get dselect-upgradeUpgrade with dselect
apt-get -dep packageInstall relevant compilation environment
apt-get source packageDownload the source code of the package
apt-get clean && apt-get autocleanClean up useless packages
apt-get checkCheck for broken dependencies

CentOS/ There are some differences between the two Linux distributions and Debian/Ubuntu in common commands. Some commonly used commands and their usage comparison are listed below.

  1. apt-get vs yum: Debian/Ubuntu uses the apt-get command, while CentOS/ uses the yum command. Both commands are tools for package management, but there are differences in specific command usage and package storage management.
  2. top vs htop: Debian/Ubuntu uses the top command to view the real-time process status of the system, while CentOS/RedHat uses the htop command, which provides richer information and a more powerful interactive interface.
  3. ifconfig vs ip: Debian/Ubuntu uses the ifconfig command to view and configure network interfaces, while CentOS/RedHat uses the ip command, which provides more concise, flexible and scalable network configuration management.
  4. ls vs dir: Debian/Ubuntu uses the ls command to list directory contents, while CentOS/RedHat uses the dir command.
  5. df vs stat: Debian/Ubuntu uses the df command to view disk usage, while CentOS/RedHat uses the stat command.
  6. mount vs df: Debian/Ubuntu uses the to mount filesystems, while CentOS/RedHat uses the df command.
  7. umount vs unmount: Debian/Ubuntu uses the umount command to unmount a mounted file system, while CentOS/RedHat uses the unmount command.
  8. vs pgrep: Debian/Ubuntu uses the command to view the current process status, while CentOS/RedHat uses the pgrep command to find the process by the process name.
  9. grep vs egrep: Debian/Ubuntu uses the grep command to search text, while CentOS/RedHat uses the egrep command, which provides a more powerful regular expression matching function.
  10. touch vs creat: Debian/Ubuntu uses the touch command to create empty files or update file timestamps, while CentOS/RedHat uses the creat command to create files or pipes.

These comparisons are not exhaustive, but are meant to illustrate the main differences between these two Linux distributions in commonly used commands. In addition, there are some differences between the two distributions in other areas, such as file system structure, system configuration, and management tools. Therefore, when performing system management and maintenance, it is necessary to select appropriate commands and tools according to the specific distribution and environment.


Leave a Reply

Your email address will not be published. Required fields are marked *