Introduction to Linux
History of Unix
Unix is an operating system developed in 1969 at AT&T Bell Labs by Ken Thompson, Dennis Ritchie, and Brian Kernighan. Bell Labs had originally been developing a multitasking operating system called “Multics”, but the system became too large. To play a game called “Space Travel”, which had been developed as a side project on Multics, they built a smaller operating system on a dusty DEC PDP-7 computer sitting in a corner of the lab. That was the beginning of Unix.
Various UNIX Systems
Unix-like operating systems have been independently extended by companies and organizations, resulting in many types and versions such as System V (AT&T), BSD (University of California, Berkeley), Solaris (Sun Microsystems), HP-UX (HP), AIX (IBM), XENIX (Microsoft), UnixWare (Novell), FreeBSD, NetBSD, and OpenBSD. Several Unix-like OS standardization groups, including UNIX International, OSF, and X/Open, were also founded, merged, and reorganized. Today, The Open Group handles this standardization.
UNIX and Unix
The name “UNIX” is a trademark managed by The Open Group. Only operating systems that satisfy the “Single UNIX Specification”, an extension of the IEEE POSIX standard for Unix-like operating systems, may call themselves “UNIX”. However, not many systems satisfy this specification. Operating systems that do not meet it are usually referred to as “Unix-like operating systems” or written as “Unix” with mixed case rather than “UNIX”.
The Emergence of Linux
Linux is one of the Unix-like operating systems developed in November 1991 by Linus Torvalds of the University of Helsinki in Finland. Because it was released as open source and could run on PCs, it spread rapidly. Strictly speaking, Linux is the name of the OS kernel. When combined with basic software such as the C compiler (gcc) developed by the GNU Project, it is called GNU/Linux. There are also many “Linux distributions” based on GNU/Linux that add installers, package management systems, and other tools.
Operating System An interface that lets users make practical use of a computer. Examples: Windows, Mac, Linux, Unix
Linux Distributions
In the early days, many distributions appeared, including TurboLinux, Miracle Linux, Debian, and Red Hat Linux. Today, Debian-based and Red Hat-based distributions are the mainstream. Among Debian-based systems, Ubuntu is widely used and has also been adopted as an operating system for low-cost PCs. Red Hat Linux split into Red Hat Enterprise Linux (RHEL), which improves commercial stability, and Fedora, which experimentally integrates the latest technologies. CentOS, a free distribution compatible with RHEL, has also been widely used.
Debian-based distributions
| Distribution | Description |
|---|---|
| Debian | GNU/Linux developed by the community |
| KNOPPIX | Linux that can be used by booting from a CD |
| Ubuntu | Known for providing a rich desktop environment |
Red Hat-based distributions
| Distribution | Description |
|---|---|
| Fedora | Linux from the Red Hat-supported Fedora Project community |
| Red Hat Enterprise Linux | Commercial Linux provided by Red Hat. Also called RHEL |
| CentOS | Linux that aims for full compatibility with RHEL. Close to a free version of RHEL |
| Vine Linux | Linux developed in Japan |
Slackware-based distributions
| Distribution | Description |
|---|---|
| OpenSUSE | Linux developed by a community supported by Novell |
| SUSE Linux Enterprise | Stable commercial Linux based on openSUSE |
Other distributions
| Distribution | Description |
|---|---|
| Arch Linux | Uses Pacman as its package management system |
| Gentoo Linux | Uses the Portage package management system |
Where Unix/Linux Is Used
Early Unix-like operating systems were mainly used in engineering work, but today they are used for many purposes, including web servers, mail servers, routers and other network devices, televisions, and car navigation systems. Mac was also rebuilt on BSD Unix starting with Mac OS X. Google’s Android is also based on Linux. Microsoft Windows, which can be considered a major counterpart to Unix/Linux, is not called a Unix-like operating system, but it has incorporated some Unix-like technologies and ideas.
Characteristics of Linux
- It has permissions.
- Linux systems use two types of permissions: ownership and access permissions.
- It supports a multi-user environment.
- Linux systems support multi-user and multitasking environments, so many users can work at the same time.
- It distinguishes uppercase and lowercase letters.
- Check whether the Caps Lock key is on or off.
- It does not use the Windows-style concept of file extensions.
TUI and GUI
- TUI (Text User Interface)
- An environment where input and output are handled as text.
- GUI (Graphical User Interface)
- A graphical environment.
Difference Between Directories and Folders
In a TUI environment, they are called directories. In a GUI environment, they are called folders.
Users
In UNIX, users are identified by user names such as devkuma or kimkc. User information is recorded in the /etc/passwd file.
Groups
A user can belong to multiple groups. For example, suppose two users, devkuma and kimkc, belong to a group called adm. Group information is recorded in the /etc/groups file.
Permissions
Nine characters such as rwxr-xr-x represent permissions.
Shell
The UNIX equivalent of the Windows command prompt, formerly called the MS-DOS prompt, is the shell. When commands are entered in text mode, the results are also displayed as text.
Prompt Definition
A prompt is a waiting state in which commands can be entered and executed.
Prompt Structure
Windows (MS-DOS)
drive-name//path>
C://windows>
Linux (Bash Shell)
| Separator | Meaning |
|---|---|
| root | Logged-in user account name |
| localhost | Host name of the Linux system |
| ~ | Current working directory |
| # | Administrator account (#), regular account ($) |
[root@localhost ~]#
[devkuma@localhost ~]$
Environment Variables
Environment variables are special variables that programs can refer to when exchanging information with each other. They are similar to the PATH setting in Windows AUTOEXEC.BAT. CGI exchanges many pieces of information between the web server and CGI scripts through environment variables. The main environment variables are as follows.
| Environment variable | Meaning |
|---|---|
| PATH | Command search path. For example, when PATH=/bin:/usr/bin, if you run the ls command, the shell searches /bin/ls and /usr/bin/ls in order and executes the first command it finds. Conversely, commands not included in PATH must be specified with an absolute path such as /bin/ls. |
| TZ | Time zone. Specifies the time zone for the region. In Korea, for example, this can be set to TZ=KST-9 (more recently, TZ=Asia/Seoul). Otherwise, the system time may differ by nine hours depending on the system. |
To check the value of an environment variable, use the printenv command in the shell (or set if printenv is unavailable). In Perl, use $ENV{'environment variable name'}.
Differences Between UNIX and Windows
| Item | UNIX | Windows |
|---|---|---|
| Drive concept | None | Exists |
| Directory separator | / |
\ |
| File listing | ls | dir |
| File copy | cp | copy |
| File deletion | rm | del |
| File move | mv | move |
| File rename | mv | ren |
| Create directory | mkdir | mkdir |
| Remove directory | rmdir | rmdir |
| Move directory | cd | cd |
| General help | man command | command /? |
| Display environment variables | set/printenv | set |
| File name length | 256 characters | 255 characters |
| Case sensitivity in file names | Case-sensitive | Not case-sensitive |
| Executable files | By permissions | By extension |
| Line break in text files | <LF> |
<CR><LF> |
| Character encoding | UTF-8 (formerly EUC) | UTF-8 |
POSIX
When reading Linux or Unix-related materials, you will often see the word POSIX. POSIX stands for Portable Operating System Interface with Unix. It is a standard adopted by the International Organization for Standardization (ISO) to improve Unix compatibility and portability. In the early 1990s, several companies began independently developing their own Unix systems. Even though these were all Unix operating systems, each company’s unique customizations caused compatibility and portability to drop significantly. As a result, users had difficulty running and moving programs even between Unix systems, and system administration and usage methods differed by vendor, creating major inconvenience for users. For this reason, ISO adopted POSIX as a standard to improve Unix compatibility and portability. Therefore, most Unix versions released since the late 1990s have tried to satisfy the POSIX standard. The POSIX standard covers a very broad range.