Home>Article>Operation and Maintenance> Are the terminal commands on mac the same as those on linux?
Mac terminal commands are different from linux terminal commands; mac and linux are both based on Unix, and many of the terminal commands are modeled after Unix. Some commonly used commands are basically the same, but they are not. It's exactly the same. For example, Linux is written in C language, so commands need to be case-sensitive, which does not exist on Mac.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
Mac and Linux are both based on Unix, and many commands are modeled after Unix, so there is basically no difference in commonly used commands, such as viewing files (ls), search for files (find), copy files (cp), create directories (mkdir), package files (tar), etc., and their software package installation are all based on the same concept (./configure, install).
But some details are different. For example, Linux is written in C language, so commands need to be case-sensitive, which does not exist on Mac.
For example:
When using the mac terminal, you need to copy the directory recursively. In Linux systems, it is usually the -r parameter. Please note that in mac it is -Rp. If the copied path is in In paths such as /usr/local, sudo permissions are also required
sudo cp -Rp source /usr/local/source_copy
Mac is based on Unix, so some commands of Mac are common to Linux.
Some Linux commands are not available in Mac.
Although both systems are based on Unix, the commands in Linux are richer and more convenient to use. The commands in Mac are much less than those in Linux.
Expand knowledge
What is the difference between linux and macos
The former is a closed system developed by Apple. Only for Apple devices, Linux is an open source free system that can run on many kinds of devices and also allows developers to develop secondary projects
macOS is a graphical interface operating system, similar to Windows, while Linux is a pure code operation. I can’t see the interface, which is confusing for novices.
macOS is suitable for ordinary users to use for office and entertainment. Linux is suitable for servers because it has no graphical interface and takes up very little memory. Many webmasters have chosen Linux. A series of operating systems
Mac OS One is UNIX, the other is Linux
One is developed by the richest IT company in the world, and the other is developed by I don’t know how many companies and how many versions.
macOS kernel (XNU ) is older than Linux and is based on the combination of two older code bases; Linux, on the other hand, is newer, was written from scratch, and is used on more devices.
Recommended learning:
Linux video tutorialThe above is the detailed content of Are the terminal commands on mac the same as those on linux?. For more information, please follow other related articles on the PHP Chinese website!