Differences between common commands in CentOS/RedHat and Debian/Ubuntu

CentOS is based on the Linux framework and distribution, implementing a free, community-supported computing platform that is compatible with the corresponding upstream source Red Hat Linux. In contrast, Ubuntu is an open source Linux distribution based on Debian.

Main Differences Between CentOS and Ubuntu

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

In this CentOS vs Ubuntu comparison, we will aim to give an overview of the main features of both Linux distributions, which will help you choose the right operating system for your VPS web server.

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

Whether you are a professional or a beginner, it often comes down to choosing between the two options. It is safe to say that there is no straight forward decision. In this article, we intend to compare CentOS vs Ubuntu with the goal of finding out which one is best suited when it comes to setting up a VPS plan.

 

Differences between some common commands

contentCentos 6/7Debian/Ubuntu
1. Software package suffix*.rpm*.deb
2. Software source configuration file/etc/.conf/etc/apt/sources.list
3. Update package listyum makecache apt-get update
4. Install software from the 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. Remove Packagesrpm -e package
yum remove package
apt-get remove package
apt-get purge package
7. Get information about a software package**yum search packageapt-cache search package
8. All installed software is displayedyum list installed
rpm -qa
dpkg -l
dpkg --list
9. Get information about installed 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.Root login is allowed by defaultRoot login is not allowed by default
13. Create UserCreate user home directory by default
The default shell interpreter is bash
Create password without interaction --stdin
By default, user home directories are not created.
The default shell interpreter is sh
Create a 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 Packages
apt-cache show packageGet information about the package, such as description, size, version, etc.
apt-cache depends packageUnderstanding usage dependencies
apt-cache rdepends packageCheck which packages the package depends on
apt-get install packageInstalling Packages
apt-get install package --reinstallReinstall the package
apt-get -f installRepair installation "-f = --fix-missing"
apt-get remove packageRemoving a Package
apt-get remove package --purgeDelete the package, including deleting configuration files, etc.
apt-get updateUpdate Source
apt-get upgradeUpdate installed packages
apt-get dist-upgradeUpgrading the system
apt-get dselect-upgradeUpgrading with dselect
apt-get build-dep packageInstall the relevant compilation environment
apt-get source packageDownload the source code for this package
apt-get clean && apt-get autocleanClean up useless packages
apt-get checkCheck for broken dependencies

CentOS/ There are some differences in common commands between Debian and Ubuntu. The following lists some common commands and their usage comparison.

  1. apt-get vs yum: Debian/Ubuntu uses apt-get command, while CentOS/RedHat uses yum command. Both commands are tools for software package management, but they differ 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 extensible network configuration management.
  4. ls vs dir: Debian/Ubuntu uses ls command to list directory contents, while CentOS/RedHat uses 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 mount command to mount the file system, while CentOS/RedHat uses the df command.
  7. umount vs unmount: Debian/Ubuntu uses the umount command to unmount the mounted file system, while CentOS/RedHat uses the unmount command.
  8. vs pgrep: Debian/Ubuntu uses the ps command to view the current process status, while CentOS/RedHat uses the pgrep command to search for processes by process name.
  9. grep vs egrep: Debian/Ubuntu uses the grep command to search text, while CentOS/RedHat uses the egrep command, which provides more powerful regular expression matching capabilities.
  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 the two Linux distributions in terms of commonly used commands. In addition, there are some differences between the two distributions in other aspects, such as file system structure, system configuration and management tools. Therefore, when performing system management and maintenance, it is necessary to choose the appropriate commands and tools according to the specific distribution and environment.

score

Leave a Reply

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