1.1 INTRODUCTION 

1.1 GENERAL CHARACTERISTICS

1.1.2 VERSIONS

1. Introduction

Origin: created in the early 1970s in the Bell–AT&T laboratories.

Industrial expansion: in the early 1980s.

Current role: a major player in groupware and client/server architectures.


2. General Characteristics

Multi‑user: several users can work at the same time.

Multitasking: multiple programs can run in parallel.

Multi‑platform: available on many different hardware platforms.

Multiprocessor support: can take advantage of machines with multiple processors.


3. Performance and Positioning

Unix solutions:

  • provide performance levels comparable to proprietary systems,
  • offer equivalent functionality,
  • are often more attractive in terms of cost and scalability.

4. Spirit and Philosophy of Unix

Unix is first and foremost a development system.

Everything is designed with programming in mind.

Key principle: modularity.

There is a set of standard utilities.
These utilities can be freely combined (a “toolbox” approach).


5. Learning and Mastery

It requires a substantial amount of learning at the beginning (because of its rich functionality and openness).

In return:

  • your level of expertise increases with regular practice,
  • the more you understand Unix, the more benefits you gain.

To feel comfortable with Unix, you need to know:

  • its basic mechanisms,
  • the utilities and services it provides.

6. Standards and Portability

Although there are many Unix variants, the system is based on:

  • several types of standards,
  • de facto standards, particularly for:
    • programming interfaces,
    • services.

As a result, applications are highly portable, which is one of Unix’s major strengths.


7. Unix Strengths in Information System Architectures

There are many software solutions, for example:

  • as a database management system (DBMS) server.

Networking:

  • high quality and reliability around the TCP/IP protocols.

Graphics:

  • solutions based on the X Window System.

All of this makes adopting Unix easy when choosing an information system architecture.


 

1-ការណែនាំ

ប្រភពដើម៖ ត្រូវបានបង្កើតឡើងនៅដើមទសវត្សរ៍ ១៩៧០ ក្នុងមន្ទីរពិសោធន៍ Bell–AT&T។

ការពង្រីកឧស្សាហកម្ម៖ នៅដើមទសវត្សរ៍ ១៩៨០។

តួនាទីបច្ចុប្បន្ន៖ ជាអ្នកលេងសំខាន់ម្នាក់ក្នុងកម្មវិធីសហប្រតិបត្តិការ (groupware) និងស្ថាបត្យកម្ម client/server។


2-លក្ខណៈទូទៅ

ពហុអ្នកប្រើ (Multi‑user)៖ អ្នកប្រើជាច្រើនអាចធ្វើការនៅពេលតែមួយ។

ពហុភារកិច្ច (Multitasking)៖ កម្មវិធីជាច្រើនអាចដំណើរការដំណាលគ្នា។

ពហុវេទិកា (Multi‑platform)៖ មានលើវេទិកាឧបករណ៍រឹងជាច្រើនប្រភេទខុសៗគ្នា។

គាំទ្រពហុប្រូសេស័រ (Multiprocessor support)៖ អាចប្រើប្រាស់អត្ថប្រយោជន៍ពីម៉ាស៊ីនដែលមានប្រូសេស័រច្រើន។


3-ប្រសិទ្ធភាព និងទីតាំង

ដំណោះស្រាយ Unix៖

  • ផ្តល់កម្រិតប្រសិទ្ធភាពដែលអាចប្រៀបធៀបបាននឹងប្រព័ន្ធផ្តាច់មុខ (proprietary systems),
  • ផ្តល់មុខងារស្មើគ្នា,
  • ជាញឹកញាប់មានភាពទាក់ទាញជាង ក្នុងទាក់ទងនឹងថ្លៃដើម និងសមត្ថភាពពង្រីក (scalability)។

4-វិញ្ញាសា និងទស្សនវិស័យរបស់ Unix

Unix គឺជាប្រព័ន្ធអភិវឌ្ឍន៍ជាងគេមុនសិន។

អ្វីៗត្រូវបានរចនាឡើងដោយគិតគូរទៅលើការសរសេរកម្មវិធី។

គោលការណ៍សំខាន់៖ ការបែងចែកជាម៉ូឌុល (modularity)។

មានឧបករណ៍ប្រើប្រាស់ស្តង់ដារ (standard utilities)។

ឧបករណ៍ទាំងនេះអាចបន្សំជាមួយគ្នាបានមិនដាច់ដូង (របៀប «ប្រអប់ឧបករណ៍» / toolbox approach)។


5-ការរៀន និងការកាន់កាប់ឱ្យបានជំនាញ

តម្រូវឱ្យមានការរៀនសូត្រច្រើននៅដំបូង (ដោយសារតែសម្បូរមុខងារ និងភាពបើកចំហ)។

ជាគុណវិបាកវិញ៖

  • កម្រិតជំនាញនឹងកើនឡើងតាមការអនុវត្តន៍ជាប្រចាំ។
  • អ្នកយល់ដឹង Unix កាន់តែច្រើន អ្នកនឹងទទួលបានអត្ថប្រយោជន៍ច្រើនកាន់តែបន្ថែម។

ដើម្បីមានផាសុកភាពជាមួយ Unix អ្នកត្រូវតែស្គាល់៖

  • មេកានិزمមូលដ្ឋាន,
  • ឧបករណ៍ និងសេវាកម្មដែលមានផ្តល់ឱ្យ។

6-ស្តង់ដារ និងសមត្ថភាពផ្ទេរ

បើទោះបីមានវ៉ារីយ៉ង់ Unix ច្រើនក៏ដោយ ប្រព័ន្ធនេះស្ថិតលើមូលដ្ឋាន៖

  • ស្តង់ដារជាច្រើនប្រភេទ,
  • ស្តង់ដារបែប de facto ជាពិសេសសម្រាប់៖
    • ចំណុចប្រទាក់កម្មវិធី (programming interfaces),
    • សេវាកម្ម។

លទ្ធផល៖ កម្មវិធីមានសមត្ថភាពផ្ទេរខ្ពស់ (high portability of applications) ដែលជាទ្រព្យសម្បត្តិសំខាន់មួយរបស់ Unix។


7-ចំណុចខ្លាំងរបស់ Unix ក្នុងស្ថាបត្យកម្មព័ត៌មានវិទ្យា

មានដំណោះស្រាយកម្មវិធីជាច្រើន៖

  • ឧទាហរណ៍ ជាម៉ាស៊ីនមេគ្រប់គ្រងមូលដ្ឋានទិន្នន័យ (DBMS server)។

បណ្តាញ (Networking)៖

  • មានគុណភាព និងភាពទុកចិត្តបានខ្ពស់ជុំវិញពិធីការ TCP/IP។

ក្រាហ្វិច (Graphics)៖

  • មានដំណោះស្រាយផ្អែកលើប្រព័ន្ធ X Window។

អ្វីទាំងនេះធ្វើឱ្យការទទួលយក Unix ក្លាយជារឿងងាយស្រួល នៅពេលជ្រើសរើសស្ថាបត្យកម្មព័ត៌មានវិទ្យា។


ប្រសិនបើអ្នកចង់ អ្នកអាចផ្ញើទំព័រផ្សេងទៀត ឬអត្ថបទផ្សេងទៀតឲ្យបកប្រែដូចគ្នានេះបានផង។

1.1.1 COMPONENTS OF THE SYSTEM

The components of the system can be represented as follows:

Kernel

  • Written in the C language
  • Performs the essential functions
    (memory management, process management, input/output, etc.)

File system

  • Integrated into the kernel
  • The internal implementation and the resulting administration capabilities
    are specific to each version, but the available commands and utilities
    are, of course, common.

Command languages (shells)

  • Dual role: interpreter and programming language
  • The “shell” is a program external to the kernel; a login consists in
    starting the interpreter of one’s choice.
  • The most widespread shells are:
    • Korn shell (the recommended shell today)
    • POSIX shell (standardized version of the Korn shell)
    • Bourne shell (the original shell)
    • C shell (from the Berkeley versions)
    • Bash, for Bourne Again Shell (from the Open Source world)

Available utilities and services

  • Numerous commands for the user
  • Compilers (C, C++, etc.)
  • Text editors (ed, vi, emacs, etc.)
  • Filters (text file processing tools)
  • TCP/IP network protocols
  • TCP/IP applications and services
    • standard applications: telnet, ftp, “remote commands,” etc.
    • NFS file-sharing service
    • NIS centralized administration services
    • SNMP network management protocols
  • Internet tools
  • X Window graphical interface system
  • etc.

Programming interfaces

  • System calls (C under Unix)
  • Network programming (sockets, TLI, RPCs)
  • X Window programming
  • A multitude of freeware tools for development and administration

1.1.1 សមាសភាគនៃប្រព័ន្ធ

សមាសភាគនៃប្រព័ន្ធ​អាចបង្ហាញបាន​ដូចខាងក្រោម៖

Kernel

  • សរសេរឡើងដោយប្រើភាសា C
  • អនុវត្តមុខងារចម្បងៗ
    (ការគ្រប់គ្រងមេម៉ូរី ការគ្រប់គ្រងដំណើរការ ការបញ្ចូល/បង្ហាញលទ្ធផល ជាដើម)

ប្រព័ន្ធឯកសារ (File system)

  • បញ្ចូលរួមជាមួយខឺណែល
  • រចនាសម្ព័ន្ធខាងក្នុង និងសមត្ថភាពគ្រប់គ្រងដែលទទួលបាន
    ខុសគ្នាតាមកំណែ​នីមួយៗ ប៉ុន្តែពាក្យបញ្ជា និងឧបករណ៍សម្រួល
    ដែលអាចប្រើបានវិញ គឺជារឿងទូទៅដូចគ្នា។

ភាសាពាក្យបញ្ជា (shells)

  • មានតួនាទីពីរ៖ ជាកម្មវិធីបកប្រែ និងជាភាសាកម្មវិន្ធ
  • «Shell» គឺជាកម្មវិធីមួយនៅខាងក្រៅខឺណែល; ការចូលប្រើប្រព័ន្ធ (login)
    គឺជាការចាប់ផ្ដើមកម្មវិធីបកប្រែដែលអ្នកជ្រើសរើស។
  • Shell ដែលគេប្រើច្រើនបំផុតមាន៖
    • Korn shell (shell ដែលបានផ្ដល់អនុសាសន៍សម្រាប់បច្ចុប្បន្ន)
    • POSIX shell (កំណែស្តង់ដារនៃ Korn shell)
    • Bourne shell (shell ដើម)
    • C shell (មកពីកំណែ Berkeley)
    • Bash សម្រាប់ Bourne Again Shell (មកពីពិភព Open Source)

ឧបករណ៍សម្រួល និងសេវាកម្មដែលអាចប្រើបាន

  • ពាក្យបញ្ជាច្រើនសម្រាប់អ្នកប្រើ
  • កម្មវិធីបកប្រែកូដ (compilers) (C, C++ ជាដើម)
  • កម្មវិធីកែសម្រួលអត្ថបទ (text editors) (ed, vi, emacs ជាដើម)
  • Filters (ឧបករណ៍ដំណើរការឯកសារអត្ថបទ)
  • ពិធីការ​បណ្ដាញ TCP/IP
  • កម្មវិធី និងសេវាកម្ម TCP/IP
    • កម្មវិធីស្តង់ដារ៖ telnet, ftp, «remote commands» ជាដើម
    • សេវាកម្ម​ចែករំលែកឯកសារ NFS
    • សេវាកម្មគ្រប់គ្រងកណ្ដាល NIS
    • ពិធីការគ្រប់គ្រងបណ្ដាញ SNMP
  • ឧបករណ៍សម្រាប់អ៊ីនធឺណិត
  • ប្រព័ន្ធចំណុចប្រទាក់ក្រាហ្វិក X Window
  • ជាដើម។

ចំណុចប្រទាក់សរសេរកម្មវិធី (Programming interfaces)

  • System calls (C ក្រោម Unix)
  • ការសរសេរកម្មវិធីបណ្ដាញ (sockets, TLI, RPCs)
  • ការសរសេរកម្មវិធី X Window
  • ឧបករណ៍ឥតគិតថ្លៃជាច្រើនសម្រាប់ការអភិវឌ្ឍ និងការគ្រប់គ្រង

1.1.2 VERSIONS

Introduction

Unix currently comes in many different variants.

The impact of these different versions is really significant only with regard to « System Administration » aspects and, to a lesser extent, « Network Configuration » aspects.

Some major versions (in alphabetical order)


AIX

IBM (RS/6000 and pSeries ranges) and BULL (Escala)

Versions 5, 4.3.x (PowerPC hardware)

FreeBSD

Versions 4.x (Intel, Alpha… platforms)

HP-UX

HP (HP9000 range)

Versions 10.x, 11.x and 11i

IRIX

SGI (Octane, O2, Onyx… range)

Versions 6.5.x (MIPS processors)

LINUX

2.x kernel (various distributions on various platforms)

SCO

Linux and UNIX distribution

OpenLinux, Open UNIX 8

SCO Open Server 5.x

UnixWare 7

Intel and Itanium platforms

Solaris

SUN (Sparc and Intel platforms)

Solaris 8, 9

1.1.2 កំណែ (VERSIONS)

សេចក្តីផ្ដើម

ក្នុងបច្ចុប្បន្ន Unix មានកំណែ និងកំណែរងជាច្រើនប្រភេទខុសៗគ្នា។

ផលប៉ះពាល់នៃកំណែផ្សេងៗទាំងនេះ មានសារៈសំខាន់ពិតប្រាកដ តែក្នុងចំណុច «ការ​គ្រប់គ្រង​ប្រព័ន្ធ» ប៉ុណ្ណោះ ហើយមាន​ផលប៉ះពាល់តិចជាង ក្នុងចំណុច «ការ​កំណត់​រចនាសម្ព័ន្ធ​បណ្តាញ» ។

កំណែសំខាន់ៗខ្លះ (តាមលំដាប់អក្សរក្រម)


AIX

IBM (ជួរ RS/6000 និង pSeries) និង BULL (Escala)

កំណែ 5, 4.3.x (ផ្នែករឹង PowerPC)

FreeBSD

កំណែ 4.x (វេទិកា Intel, Alpha…)

HP-UX

HP (ជួរ HP9000)

កំណែ 10.x, 11.x និង 11i

IRIX

SGI (ជួរ Octane, O2, Onyx…)

កំណែ 6.5.x (ប្រព័ន្ធដំណើរការ MIPS)

LINUX

ខឺណែល 2.x (ការចែកចាយជាច្រើន នៅលើវេទិកាផ្សេងៗគ្នា)

SCO

ការចែកចាយ Linux និង UNIX

OpenLinux, Open UNIX 8

SCO Open Server 5.x

UnixWare 7

វេទិកា Intel និង Itanium

Solaris

SUN (វេទិកា Sparc និង Intel)

Solaris 8, 9

1.2 បរិស្ថានការងារ

Unix ដំបូងគេ គឺជា​ប្រព័ន្ធ​ដែលផ្អែក​លើ​បន្ទាត់​ពាក្យ​បញ្ជា ដែល​អ្នក​ចូលប្រើ​តាមរយៈ terminal អក្សរ​អសមកាល (asynchronous text terminal) មួយ។

ការវិវឌ្ឍន៍​បច្ចេកវិទ្យា និង​ការ​កើត​មាន​ដំណោះស្រាយ​បណ្តាញ និង​ចំណុច​ប្រទាក់​ក្រាហ្វិក បាន​ពង្រីក​វិធី​សាស្រ្ត​ផ្សេងៗ​សម្រាប់​ភ្ជាប់​ចូល​ប្រព័ន្ធ។

បរិស្ថាន​ក្រាហ្វិក​កំពុង​ក្លាយ​ជា​អ្វី​ដែល​ប្រើ​ប្រាស់​យ៉ាងទូលំទូលាយ និង​មាន​ស្តង់ដារ​កាន់​តែ​ច្រើន​ឡើង។

ជំនាញ​ល្អ​លើ​វាក្យសម្ពន្ធ (syntax) នៃ​ពាក្យ​បញ្ជា និង​ឧបករណ៍ (utilities) នៅ​តែ​ជា​អ្វី​ចាំបាច់​សម្រាប់​អ្នក​ជំនាញព័ត៌មានវិទ្យា (IT professionals) មិន​ថា​ពួកគេ​ភ្ជាប់​ចូល​មក​ពី​បរិស្ថាន​ប្រភេទ​ណា​ក៏​ដោយ។

អាស្រ័យ​លើ​ប្រភេទ​សកម្មភាព មាន​វិធី​ច្រើន​ដើម្បី​ភ្ជាប់​ចូល Unix ៖

  • terminal អក្សរ​មូដ​អសមកាល (asynchronous text‑mode terminal)
  • terminal X
  • workstation X
  • workstation មិនមែន Unix

terminal X ត្រូវ​បាន​ភ្ជាប់​ដោយ​ផ្ទាល់​ទៅ​បណ្តាញ ហើយ​ទទួល​បាន “login banner” មួយ ដែល​អនុញ្ញាត​ឲ្យ​ចាប់ផ្ដើម​ចំណុច​ប្រទាក់ X Window។

អ្នក​ជំនាញ IT អាច​បើក​បង្អួច emulator terminal ច្រើន ហើយ​ដូច្នេះ​អាច​មាន​ការ​ភ្ជាប់​ជា​ច្រើន​ម្ដង​តែមួយ លើ workstation តែមួយ​បាន។

workstation X គឺ​ជា​ម៉ាស៊ីន Unix មួយ ដែល​បំពាក់​ដោយ​អេក្រង់​ក្រាហ្វិក ហើយ​ត្រូវ​បាន​ប្រើ​ជា console មួយ។

workstation X ផ្ដល់​នូវ​បរិស្ថាន​ការងារ​ដូចគ្នា​នឹង terminal X។

ចាប់ពី​ប្រព័ន្ធ​ប្រតិបត្តិការ​មួយ ដែល​អនុវត្ត​ពិធីការ TCP/IP រួចរាល់ អាច​តភ្ជាប់​ទៅ​ម៉ាស៊ីន Unix មួយ​នៅ​លើ​បណ្តាញ តាមរយៈ​កម្មវិធី​ដែល​សង់​លើ​ពិធីការ​ទាំង​នោះ។

ការភ្ជាប់​នេះ​អាច​ធ្វើ​បាន ៖

  • ជា​មូដ​អក្សរ តាមរយៈ telnet emulator មួយ ឬ
  • ជា​មូដ​ក្រាហ្វិក ប្រសិន​បើ​មាន​កម្មវិធី emulate X Window មួយ។

មាន​កម្មវិធី​ជា​ច្រើន​ប្រភេទ​អាច​រក​បាន ជាពិសេស​សម្រាប់​បរិស្ថាន Microsoft Windows។

1.3 FIRST STEPS IN UNIX

1.3.1 LOGGING INTO THE SYSTEM

To log into the system, you must have a login name (login) to which it is recommended, or even mandatory, to associate a password.

Each login is placed, when it is created by the administrator, in a primary group.

It may also belong to supplementary or secondary groups in order to benefit from a broader range of file access rights.

There is a privileged user with the traditional name root (internal number 0) who corresponds to the administrator and has full powers over the system.

A login session consists in the execution of a shell (command interpreter).

This login shell (a program external to the kernel) is chosen when the login is created. Its role is to display a prompt and to interpret the command lines typed by the user, until the user requests to log out.

The original Bourne shell (sh or bsh) is still used for programming.

The Korn shell (ksh) is the recommended interpreter because of its rich functionality and its standardized nature for programming.

In this respect, it is a superset of the original Bourne shell.

The C shell (csh) provided convenient interactive features on systems where the Korn shell was not available. Its use is becoming more and more marginal.

BASH (bash) is the Open Source version. It offers an improvement over the Korn shell and C shell versions, while ensuring upward compatibility with the Bourne shell.


 

 

1.3 ជំហានដំបូងលើ Unix

1.3.1 ការចូលទៅក្នុងប្រព័ន្ធ

ដើម្បីចូលទៅក្នុងប្រព័ន្ធ អ្នកត្រូវមានឈ្មោះចូល (login) មួយ ដែលត្រូវបានផ្ដល់ឲ្យ និងភ្ជាប់ជាមួយពាក្យសម្ងាត់ (password) មួយ ដែលភាគច្រើនត្រូវបានណែនាំ ឬត្រូវបានទាមទារឱ្យមាន។

រាល់ login ត្រូវបានដាក់ឲ្យស្ថិតក្នុងក្រុមមេមួយ នៅពេលវាត្រូវបានបង្កើតឡើងដោយអ្នកគ្រប់គ្រងប្រព័ន្ធ។

វាអាចក្លាយជាសមាជិកក្រុមបន្ថែម ឬក្រុមរងផ្សេងទៀត ដើម្បីទទួលបានជួរសិទ្ធិចូលដំណើរការឯកសារធំទូលាយជាងមុន។

មានអ្នកប្រើដែលមានសិទ្ធិពិសេសម្នាក់ មានឈ្មោះប្រពៃណីថា root (លេខខាងក្នុង 0) ដែលតំណាងឱ្យអ្នកគ្រប់គ្រង និងមានអំណាចពេញលេញលើប្រព័ន្ធ។

សម័យការចូលមួយ (login session) គឺជាការប្រតិបត្តិរបស់ shell មួយ (កម្មវិធីបកស្រាយពាក្យបញ្ជា)។

shell សម្រាប់ការចូល (login shell) នេះ គឺជាកម្មវិធីមួយនៅខាងក្រៅ kernel ដែលត្រូវបានជ្រើសនៅពេលបង្កើត login។ ភារកិច្ចរបស់វាគឺបង្ហាញ prompt (សញ្ញាអញ្ជើញបញ្ចូលពាក្យបញ្ជា) និងបកស្រាយបន្ទាត់ពាក្យបញ្ជាដែលអ្នកប្រើវាយ ចាប់តាំងពីពេលចូលរហូតដល់ពេលអ្នកប្រើស្នើចង់ចេញ (logout)។

Bourne shell ដើម (sh ឬ bsh) នៅតែត្រូវបានប្រើសម្រាប់ការកម្មវិធី។

Korn shell (ksh) គឺជា​អន្ទាក់បកស្រាយ​ដែលត្រូវបានផ្ដល់អនុសាសន៍ ពីព្រោះមានមុខងាររឹងមាំ និងមានលក្ខណៈស្ដង់ដាសម្រាប់ការកម្មវិធី។

ក្នុងទិដ្ឋភាពនេះ វាជាសំណុំផ្ទៃលើ (superset) នៃ Bourne shell ដើម។

C shell (csh) បានផ្ដល់ភាពស្រួលក្នុងការប្រើប្រាស់អន្តរកម្មល្អលើប្រព័ន្ធ នៅពេលដែល Korn shell មិនមាន។ ការប្រើប្រាស់របស់វាកំពុងតែតិចតួចចុះៗទៅ។

BASH (bash) គឺជា version បើកទូលាយ (Open Source)។ វាបន្ថែមការកែលម្អលើ Korn shell និង C shell ខណៈដែលរក្សាភាពឆបគ្នាឡើងលើ (upward compatibility) ជាមួយ Bourne shell។

Command line syntax

command

[-option(s)]

[argument(s)]

command
executable file or internal shell command

options

  • simple options

    • sequence of alphanumeric characters
      $ ls -il
  • options with arguments

    • keyword option_argument
      $ ps -u stagel

arguments &

They are often file names

(abridged) which will be processed by the shell before invoking the command

$ ls -il exemple

Of course, some commands do not follow this basic syntax.

Furthermore, more advanced mechanisms (redirections, pipelines, etc.) enrich this command line.

The following chapters will gradually present these additional aspects.

Special characters

Unix distinguishes between lowercase and uppercase.

All commands are in lowercase.

Deleting a character
key “Backspace” (Ctrl H)

Deleting the whole line
keys @ or Ctrl U

Logout
keys Ctrl D or exit


 

 

វាក្យសម្ព័ន្ធនៃបន្ទាត់ពាក្យបញ្ជា

ពាក្យបញ្ជា

[-ជម្រើស(ಗಳು)]

[អាគ្យូម៉ង់(ಗಳು)]

ពាក្យបញ្ជា (command)
ឯកសារ​ប្រតិបត្តិ (executable file) ឬ​ពាក្យបញ្ជាផ្ទៃក្នុង​របស់ shell

ជម្រើស (options)

  • ជម្រើសធម្មតា

    • លំដាប់តួអក្សរ និង​លេខ (alphanumeric)
      $ ls -il
  • ជម្រើស​ដែលមាន​អាគ្យូម៉ង់

    • ពាក្យគន្លឹះ បន្ទាប់ដោយ​អាគ្យូម៉ង់​របស់​ជម្រើស
      $ ps -u stagel

arguments &

វាជាញឹកញាប់​ជា​ឈ្មោះ​ឯកសារ

(ទម្រង់កាត់) ដែល​នឹងត្រូវបាន​ដំណើរការ​ដោយ shell មុនពេល​ប្រតិបត្តិ​ពាក្យបញ្ជា

$ ls -il exemple

ជាក់ស្តែង មាន​ពាក្យបញ្ជា​មួយចំនួន​មិន​ធ្វើតាម​វាក្យសម្ព័ន្ធ​មូលដ្ឋាន​នេះ​ទេ។

ពីមួយភាគទៅមួយភាគ មាន​យន្តការលំបាក​ជាងនេះ (redirect, pipeline ជាដើម) ដែលបន្ថែមលើ​បន្ទាត់​ពាក្យបញ្ជា​នេះ។

ជំពូក​បន្ទាប់ៗ នឹងបង្ហាញ​បន្ថែម​ពី​ឯកសារទាំងនេះ​បន្តបន្ទាប់​គ្នា។

តួអក្សរពិសេស

Unix ខុសគ្នា​រវាង​អក្សរតូច និង​អក្សរធំ (case‑sensitive)។

ពាក្យបញ្ជា​ទាំងអស់ ត្រូវសរសេរ​ដោយ​អក្សរតូច។

លុបតែ​តួអក្សរ​មួយ
គ្រាប់ចុច “Backspace” (Ctrl H)

លុបបន្ទាត់​ទាំងមូល
គ្រាប់ចុច @ ឬ Ctrl U

ចេញពី​ប្រព័ន្ធ (logout)
គ្រាប់ចុច Ctrl D ឬ exit

1.3.2 FIRST SIMPLE COMMANDS

  • clear
    Clear the screen.

    Command without options or parameters.

  • who
    Display the list of connected users.

    $ who 
     root   console  Oct 17 08:07
    stage3  pts/3    Oct 17 12:07
    stage5  tty01    Oct 17 09:30
    stagel  tty02    Oct 17 10:55

    With the -q option, the command gives a summarized list of the users as well as the number of connected users.

    $ who -q
     root stage3 stage5 stage1
    # users=4 
     
  • who am i
    Identify the user connected on the terminal.

    $ who am i
    stagel tty02 Oct 17 10:55
  • tty
    Identify the terminal.

     

    $ tty 
    /dev/tty02

 

 

១.៣.២ ពាក្យបញ្ជា​សាមញ្ញ​ដំបូង

  • clear
    ជម្រះអេក្រង់។

    ពាក្យបញ្ជា​មួយ ដែល​គ្មាន​ជម្រើស (options) ឬ​ប៉ារ៉ាម៉ែត្រ (parameters) ណាមួយ។

  • who
    បង្ហាញ​បញ្ជី​អ្នកប្រើ ដែល​កំពុង​ភ្ជាប់។

    $ who 
     root   console  Oct 17 08:07
    stage3  pts/3    Oct 17 12:07
    stage5  tty01    Oct 17 09:30
    stagel  tty02    Oct 17 10:55

    ជាមួយ​នឹង​ជម្រើស -q ពាក្យបញ្ជា​នេះ ផ្តល់​បញ្ជី​សង្ខេប​អ្នកប្រើ និង​ក៏​បង្ហាញ​ចំនួន​អ្នកប្រើ ដែល​កំពុង​ភ្ជាប់​ផងដែរ។

    $ who -q
    #users$ =4
    root stage3 stage5 stage1
  • who am i
    កំណត់អត្តសញ្ញាណ​អ្នកប្រើ ដែល​កំពុង​ភ្ជាប់​នៅ​លើ terminal ។

     
    $ who am i
    stagel tty02 Oct 17 10:55

  • tty
    កំណត់អត្តសញ្ញាណ terminal ។

    $ tty 
    $ /dev/tty02
  • id
    Identify the login name and the names of the groups (primary and secondary).

     
    $ id
    uid=1001(stagel) gid=1000(stage) groups=1(staff)
    $ id stage2
    uid=1002(stage2) gid=1000(stage) groups=1(staff)
  • echo
    Display the list of parameters, separating them with a space and ending with a newline.

    The command interprets a few conventional characters:

    • \n extra newline
    • \b backspace
    • \c cancel the default newline
    • \t tabulation
    • \r carriage return
    • \0n character whose ASCII code is n (in octal, for example: 007 for Ctrl+G)

    You must use double quotes ( » « ) for these characters to be interpreted correctly and to avoid conflicts with the shell’s special characters.

     
    $ echo Bienvenue chez e-Center
    Bienvenue chez e-Center
     
    $ echo "\tA bientot\nchez e-Center\t\c"
    A bientot
    chez e-Center $ 

 

 

  • id
    កំណត់អត្តសញ្ញាណឈ្មោះ login និងឈ្មោះក្រុម (ក្រុមមេ និងក្រុមរង)។

     
    $ id
    uid=1001(stagel) gid=1000(stage) groups=1(staff)
    $ id stage2
    uid=1002(stage2) gid=1000(stage) groups=1(staff)
  • echo
    បង្ហាញប៉ារ៉ាម៉ែត្រ (arguments) ទាំងអស់ ដោយបំបែកគ្នាដោយចន្លោះ ហើយបញ្ចប់ដោយការចុះបន្ទាត់មួយ។

    ពាក្យបញ្ជា​នេះ បកស្រាយតួអក្សរពិសេសមួយចំនួន៖

    • \n ចុះបន្ទាត់បន្ថែម
    • \b លុបតួអក្សរមុនមួយ (backspace)
    • \c មិនបញ្ចូលការចុះបន្ទាត់លើកចុងក្រោយ (បោះបង់ newline លំនាំដើម)
    • \t ថេប (tabulation)
    • \r carriage return (ត្រឡប់ទៅដើមបន្ទាត់)
    • \0n តួអក្សរដែលមានលេខកូដ ASCII ជាមូល ៨ ស្មើ n (ឧទាហរណ៍ 007 សម្រាប់ Ctrl+G)

    ត្រូវប្រើ « double quotes » ( » « ) ដើម្បីឲ្យតួអក្សរពិសេសទាំងនេះត្រូវបានបកស្រាយត្រឹមត្រូវ ហើយដើម្បីជៀសវាងការជាន់គ្នាជាមួយតួអក្សរពិសេសរបស់ shell ផ្សេងៗ។

    $ echo Bienvenue chez e-Center
    Bienvenue chez e-Center
     
    $  echo "\tA bientot\nchez e-Center\t\c"
    A bientot
    chez e-Center $

passwd

passwd is used to set or change a password. Whether a password is mandatory, the syntax constraints and the validity periods all vary depending on the version and/or the choices made by the system administrator.

On all versions, only the first eight characters of the password are significant.

Command with no echo ⇒ password must be entered twice:

text
$ passwd
New password:
Re-enter new password:

Syntax constraint:

text
$ passwd
old password:
New password:
Password is too short - must be at least 6 characters
New password:
Reenter new password:

Input error:

text
$ passwd
old password:
Sorry.

date

Display the system date.

The administrator can change the date using this command.

This command is an example of options that are unusual compared with the classical syntax.

text
$ date
Mon Jan 03 17:27:53 WET 2000

$ date '+Il est &H:&M'
Il est 17:28

$ date '+&T'
17:28:28


passwd

បញ្ជា passwd ត្រូវបានប្រើដើម្បីកំណត់ ឬផ្លាស់ប្ដូរ​ពាក្យសម្ងាត់។ ការត្រូវការមាន​ពាក្យសម្ងាត់ ឬអត់ ក៏ដូចជាកម្រិតកំណត់ទ្រង់ទ្រាយ (syntax) និងរយៈពេលមានសុពលភាព នឹងខុសគ្នា​អាស្រ័យលើកំណែប្រព័ន្ធ និង/ឬ ជម្រើសរបស់អ្នកគ្រប់គ្រងប្រព័ន្ធ។

ក្នុងកំណែទាំងអស់ មានតែអក្សរ ៨ តួដំបូង​នៃ​ពាក្យសម្ងាត់​ប៉ុណ្ណោះ ដែលត្រូវបានគេចាត់ទុកថាសំខាន់។

ពេលប្រើបញ្ជានេះ កាលវាយពាក្យសម្ងាត់ អក្សរមិនបង្ហាញលើអេក្រង់ឡើយ (no echo) ដូច្នេះ ត្រូវវាយពាក្យសម្ងាត់​ពីរដង៖

 
$ passwd
New password:
Re-enter new password:

កម្រិតកំណត់ទ្រង់ទ្រាយ (syntax constraint)៖

 
$ passwd
old password:
New password:
Password is too short - must be at least 6 characters
New password:
Reenter new password:

កំហុសពេលវាយ (input error)៖

text
$ passwd
old password:
Sorry.

date

បញ្ជា date បង្ហាញ​កាលបរិច្ឆេទ និងម៉ោង​របស់​ប្រព័ន្ធ។

អ្នកគ្រប់គ្រងប្រព័ន្ធ​អាចផ្លាស់ប្ដូរ​កាលបរិច្ឆេទ​តាមរយៈ​បញ្ជានេះ។

បញ្ជា​នេះ​ជា​ឧទាហរណ៍​មួយ​នៃ​ជម្រើស (options) ដែលមាន​ទ្រង់ទ្រាយ​ខុសប្លែក​ពី_Syntax_ ធម្មតា (classical syntax)។

 
$ date
Mon Jan 03 17:27:53 WET 2000
$ date  +%H%M'

Il est 17:28


$ date '+&T'
17:28:28

$ date ‘+T’

Cliquer ici pour ajouter votre propre texte

Cliquer ici pour ajouter votre propre texte

Cliquer ici pour ajouter votre propre texte

Cliquer ici pour ajouter votre propre texte

Cliquer ici pour ajouter votre propre texte

Cliquer ici pour ajouter votre propre texte