
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 ក៏នឹងបង្ហាញព័ត៌មាននៅក្នុងផ្ទាំង និងរបារចំណងជើងនៃបង្អួចរបស់វាផងដែរ ។
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
ផ្លាស់ទីទៅកាន់ថតរងរបស់
ផ្ទៃតុ
នៅខាងក្នុងថតផ្ទះរបស់អ្នកប្រើ ។
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 foo
នឹងបង្កើតឯកសារទទេថ្មីដែលមានឈ្មោះថា foo
។ បើ foo
ជាឯកសាររួចហើយ បន្ទាប់មកការប្រើ touch នឹងធ្វើបច្ចុប្បន្នភាពត្រាពេលវេលានៅលើឯកសារដែលនឹងបង្ហាញពេលវេលាចុងក្រោយដែលឯកសារត្រូវបាន touched ។
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
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
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.
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
និងមាតិការបស់វាទាំងអស់ចេញផងដែរ !