ពាក្យ​បញ្ជា​ថត និង​ឯកសារ

pwd - បោះ​ពុម្ព​ថត​ដំណើរ​ការ

The pwd command displays the directory where the user is currently located. (pwd stands for print working directory). For example, typing

pwd

while in the Desktop will show /home/[username]/Desktop.

Note

konsole​ ក៏​នឹង​បង្ហាញ​ព័ត៌មាន​នៅ​ក្នុង​ផ្ទាំង និង​របារ​ចំណង​ជើង​នៃ​បង្អួច​របស់​វា​ផង​ដែរ ។

cd - ផ្លាស់​ប្តូរ​ថត

The cd command changes directories. (cd stands for change directory). When a terminal window is opened, it will be in the user's home directory. Moving around the file system requires the use of the cd.

  • To navigate into the root directory, type:

    cd /

  • To navigate to the current user's home directory, type:

    cd

    or

    cd ~

    Note

    តួអក្សរ​ ~ តំណាង​ឲ្យ​ថត​ផ្ទះ​អ្នក​ប្រើ​បច្ចុប្បន្ន ។ ដូច​បាន​បង្ហាញ​នៅ​ខាង​លើ​ cd ~ គឺ​ស្មើនិង​ cd /home/username/ ។ ទោះ​បី​យ៉ាង​ណា នៅ​ពេល​រត់​ពាក្យ​បញ្ជា​ជា​ root (ឧទាហរណ៍ ដោយ​ប្រើ​ sudo) ~ ចង្អុល​ទៅ​កាន់​ /root ។ នៅ​ពេល​រត់​ពាក្យ​បញ្ជា​ cd ដោយ​ប្រើ​ sudo ផ្លូវ​ពេញ​សម្រាប់​ថត​ផ្ទះ​នឹង​ត្រូវ​បាន​ផ្តល់​ឲ្យ ។

  • To navigate up one directory level, type:

    cd ..

  • To navigate up two directory levels, type:

    cd ../../

  • To navigate to the previous directory (go back), type:

    cd -

  • ដើម្បី​រុក​រក​តាម​រយៈ​ថត​ជា​ច្រើន​កម្រិត​ក្នុង​ពេល​តែ​មួយ បញ្ជាក់​ផ្លូវ​ថត​ពេញ​លេញ​ ។ ឧទាហរណ៍​ វាយ​ ៖

    cd /var/log

    ដើម្បី​ចូល​ទៅ​កាន់​ /log ថត​រង​របស់​ /var/ ដោយ​ផ្ទាល់ ។ ឧទាហរណ៍​ វាយ​៖

    cd ~/Desktop

    ផ្លាស់​ទី​ទៅ​កាន់​ថត​រង​របស់​ ផ្ទៃ​តុ​ នៅ​ខាង​ក្នុង​ថត​ផ្ទះ​របស់​អ្នក​ប្រើ ។

ls - ឯកសារ​បញ្ជី

The ls command outputs a list of the files in the current directory. (ls is short for list). For example, typing

ls ~

will display the files that are in the current user's home directory.

ប្រើ​ជា​មួយ​ជម្រើស​ -l ls បង្ហាញ​ព័ត៌មាន​ផ្សេង​ទៀត​ជា​មួយ​នឹង​ឈ្មោះ​ឯកសារ​ ដូច​ជា សិទ្ធិ​នៅ​លើ​ឯកសារ​ ម្ចាស់​របស់​ឯកសារ និង​​ផ្សេង​ៗ​ទៀត ។

ប្រើ​ជម្រើស​ -al ls បង្ហាញ​នូវ​ព័ត៌មាន​ដែល​ទាក់​ទង​ជា​មួយ​ជម្រើស​ -l ព្រម​ទាំង​បង្ហាញ​នូវ​ឯកសារ​ដែល​បាន​លាក់​ (ជម្រើស​a) ។

touch - បង្កើត​ឯកសារ​ទទេ

ពាក្យ​បញ្ជា​ touch ត្រូវ​បាន​ប្រើ​ដើម្បី​ផ្លាស់​ប្តូរ​សិទ្ធិ​ចូល​ប្រើ​របស់​ឯកសារ និង​ការ​កែ​ប្រែ​ត្រាពេល​វេលា​ ឬ​ដើម្បី​បង្កើត​ឯកសារ​ទទេ​ថ្មី​ ។ ឧទាហរណ៍​

touch foo

នឹង​បង្កើត​ឯកសារ​ទទេ​ថ្មី​ដែល​មាន​ឈ្មោះ​ថា​ foo ។ បើ​ foo ជា​ឯកសារ​រួច​ហើយ​ បន្ទាប់​មក​ការ​ប្រើ​ touch នឹង​ធ្វើ​បច្ចុប្បន្នភាព​ត្រា​ពេល​វេលា​នៅ​លើ​ឯកសារ​ដែល​នឹង​បង្ហាញ​ពេល​វេលា​ចុង​ក្រោយ​ដែល​ឯកសារ​ត្រូវ​បាន​ touched

mkdir - បង្កើត​ថត

The mkdir command is used to create a new directory. (mkdir stands for make directory). To create a new directory named foobar, type:

mkdir foobar

cp - ចម្លង​ឯកសារ ឬ​ថត

The cp command makes a copy of a file or directory. (cp is short for copy). To make an exact copy of foo and name it bar, type:

cp foo bar

To make an exact copy of the foo_dir directory and name it bar_dir, type:

cp -r foo_dir bar_dir

mv - ផ្លាស់​ទី​ឯកសារ ឬ​ថត

The mv command moves a file or directory to a different location or will rename a file or directory. (mv is short for move). To rename the file foo to bar, type:

mv foo bar

To move the file foo into the current user's Desktop directory, type:

mv foo ~/Desktop

This will not rename foo to Desktop because foo is a file and Desktop is a directory.

rm - យក​ឯកសារ ឬ​ថត​ចេញ

The rm command is used to delete files and directories. (rm is short for remove). To delete the file foo for the current directory, type:

rm foo

តាម​លំនាំ​ដើម​ rm នឹង​មិ​ន​យក​ថត​ចេញ​ទេ ។ ដើម្បី​យក​ថត​ចេញ​ អ្នក​ត្រូវ​តែ​ប្រើ​ជម្រើស​ -r (ក៏​អាច​វាយ​បញ្ចូល​ជា​ -R ឬ​ --recursive) ។ ឧទាហរណ៍​

rm -r foobar

ឬ​

rm -R foobar

ឬ​

rm --recursive foobar

នឹង​យក​ថត​ចេញ​ foobar និង​មាតិការ​បស់​វា​ទាំង​អស់​ចេញ​ផង​ដែរ​ !