ພື້ນ​ຖານ Linux ຄໍາ​ສັ່ງ​ກ່ຽວ​ກັບ​ການ Linux ແລະ Windows ບົບ​ປະ​ຕິ​ບັດ

This writing is useful for those that wish to get started with Linux commands. Here you will find the most common commands that are used in Linux.

If you would like to run Linux commands on Windows then install Cygwin. Cygwin is a Linux layer on top of Windows that allows you to use Linux commands in Windows.

ຖ້າ​ຫາກ​ທ່ານ​ຕິດ​ຕັ້ງ Cygwin ໃນ Windows ຫຼັງ​ຈາກ​ນັ້ນ​ເສັ້ນ​ທາງ​ໃນ​ຕອນ​ຕົ້ນ​ໃນ​ເວ​ລາ​ທີ່​ທ່ານ​ຈະ​ເລີ່ມ​ຕົ້ນ​ໄດ້ Cygwin ປາຍ​ຈະ:

C:\cygwin64\home\{username}

 

ສ້າງ​ໃຫມ່​ຍົກ​ຕົວ​ຢ່າງ​ໄຟລ​໌ notepad

touch textfile.txt

 

ລະ​ບົບ​ການ​ປ່ຽນ​ແປງ

cd {directory path\name}

 

List directory content in long format ( -l ) including hidden files and directories ( -ເປັນ )

ls -l -a

ls -al

 

Order files and directories by the time they were last modified

ls -t

 

List directory with pause and scrolling

ls -l | less

 

ສະ​ແດງ​ໃຫ້​ເຫັນ​ສະ​ຖານ​ທີ່​ໃນ​ປະ​ຈຸ​ບັນ (print working directory)

pwd

 

ສານ​ສະ​ກັດ​ຈາກ​ສຸດ​ທ້າຍ 100 ຄໍາ​ສັບ​ຕ່າງໆ​ຂອງ​ໄຟລ​໌

tail -100 {filename.extension}

 

ສານ​ສະ​ກັດ​ຈາກ​ທໍາ​ອິດ 100 ແຖວ​ເກັດ​ທີ່​ຢູ່​ຂອງ​ໄຟລ​໌

head -100 {filename.extension}

 

ສໍາ​ເນົາ​ໄຟລ​໌​ເປັນ

cp {source} {destination}

 

ຍ້າຍ​ໄຟ

mv {source} {destination}

 

ເຮັດ​ໃຫ້​ລະ​ບົບ​ໃຫມ່

mkdir {new directory name}

 

ລົບ​ໄຟ

rm {filename}

 

Delete an empty directory

rmdir {directory to remove}
rm -d{directory to remove}

 

Delete directory and its contents

rm -r {directory to remove}
rm -R{directory to remove}

 

ຄັດ​ເນື້ອ​ໃນ​ຂອງ​ໄຟລ​໌

sort {filename to sort}

 

ດຶງ​ອອກ​ຈາກ​ການ​ອອກ​ສຽງ​ທີ່​ຊ​້​ໍາ​ໃນ​ໄຟ

uniq {filename to remove duplicates}

 

ການ​ບີບ​ໄຟ

gzip {filename}

 

ການ​ບີບ​ບົບ

gzip -r {directory name}

 

ນັບ​ຈໍາ​ນວນ​ຂອງ​ແຖວ​ເກັດ​ທີ່​ຢູ່​ແລະ​ຖ້ອຍ​ຄໍາ​ທີ່​ຢູ່​ໃນ​ໄຟລ​໌​ຂໍ້​ຄວາມ

wc {filename}

 

Search text within files for matching string pattern (case sensitive)

grep 'word' {filename}

 

Search text within files for matching string pattern (case insensitive)

grep -i 'word' {filename}

 

Search with a directory

grep -R Arctic /home/ccuser/workspace/geography

 

ສະ​ແດງ​ເນື້ອ​ໃນ​ຂອງ​ໄຟລ​໌​ຂໍ້​ຄວາມ

cat

 

sed stream editor (similar to find and replace)

sed 's/snow/rain/' forests.txt

 

ມີ​ການ​ປ່ຽນ​ແປງ​ລະ​ບົບ​ແລະ​ເອ​ກະ​ສານ​ການ​ອະ​ນຸ​ຍາດ

chmod {options} {permissions} {filename}

 

ລາຍ​ຊື່​ຄໍາ​ສັ່ງ​ທີ່​ຜ່ານ​ມາ​ການ​ນໍາ​ໃຊ້

history

 

ຈັດ​ຕາ​ຕະ​ລາງ​ອັດ​ຕະ​ໂນ​ມັດ​ວຽກ​ງານ

cron
crontab

 

ການ​ອະ​ນຸ​ຍາດ​ເອ​ກະ​ສານ​ການ​ປ່ຽນ​ແປງ

chmod {permission number} {some file or directory}
chmod 777 /storage

 

ການ​ປ່ຽນ​ແປງ​ການ​ອະ​ນຸ​ຍາດ​ເອ​ກະ​ສານ recursive

chmod -R {permission number} {some file or directory}

 

 

ອອກຈາກ Reply ເປັນ