هناك العديد من الأوامر التي يحتاج المبتدؤون إلى معرفتها عن نظام التشغيل لينيكس . ولكن ليس من الممكن فهم كل الأوامر في يوم واحد. إذا كنت بحاجة الى بداية جيدة في لينكس اذا الرجاء قراءت هذا المقالة وفهم الأوامر الأكثر استخداما في لينكس .



إذا كانت هذه اول مرة لك تستعمل لينكس، سوف تحتاج إلى معرفة  كيفية إنشاء دليل ، كيفية إنشاء ملف ، وكيفية قراءة ملف ، ملف فتحه وتحريره ، ملف نسخة ، التحرك ملف ، حذف الملفات و الدلائل ... الخ. دعونا نرى كيف نحن ذاهبون للقيام بذلك بواسطة أوامر العمليات مع الأمثلة: 


MKDIR Command 

1 . بمجرد تسجيل الدخول إلى الجهاز وفتحت المحرر "terminal "أولا كل ما تحتاجه هو انشاء دليل لعملكم. إنشاء الدليل عن طريق الأمر التالي:
login as: root
root@192.168.136.132's password:
[root@localhost ~]#
[root@localhost ~]# mkdir test
[root@localhost ~]# ls
anaconda-ks.cfg  install.log  install.log.syslog  test
[root@localhost ~]#

CD Command 
 
2 . بمجرد إنشاء الدليل. عليك أن تذهب داخل الدليل، يمكنك أن تفعل ذلك على النحو التالي :

  [root@localhost ~]#
[root@localhost ~]# cd test
[root@localhost test]#
 

touch command
 


3 . عندما تذهب داخل الدليل. امت بحاجة إلى إنشاء ملف . على النحو التالي:
[root@localhost test]#
[root@localhost test]# touch test.txt
[root@localhost test]# ls
test.txt
[root@localhost test]#

Vi editor 


4 . هناك طرق مختلفة لإنشاء الملفات و عموما يستعملون touch, vi, cat. سوف نستخدم  vi لإنشاء الملفات أكثر. ولكن يمكننا تعديل الملف الذي تم إنشاؤه بهذه الطريقة أيضا.

[root@localhost test]#
[root@localhost test]# vi test1.txt
[root@localhost test]#
 
cat command
 


5 . بمجرد تحرير هذا الملف و تريد قراءتها. استخدم الأوامر التالية .
[root@localhost test]#
[root@localhost test]# cat test1.txt

Hello Linux Concepts and Commands Author
How are you?

[root@localhost test]#

more command 


6 . في بعض الأحيان ، سيكون ملف كبير جدا ولا يمكن أن نرى ذلك على شاشة واحدة , يمكنك أن تقرأ هذا الملف كما يلي :more command  يقرأ صفحة ملف في الصفحة . أنت فقط تحتاج إلى الضغط على مفتاح Enter للصفحة التالية و الصفحة الى الوراء  الضغط على مفتاح b ..

[root@localhost test]#
[root@localhost test]# vi test2.txt
[root@localhost test]#
[root@localhost test]# cat test2.txt | more
[root@localhost test]#
 يمكننا استخدام more مثل cat أيضا# #
 [root@localhost test]# more test2.txt

cp command 

7 . الآن نسخ ملف إلى أي ملف اخر, انشاء أكثر من نسخة للملف test2.txt وإعطاء اسم للملف الجديد على النحو التالي: test2.txt_bak

[root@localhost test]#
[root@localhost test]# cp test2.txt test2.txt_bak
[root@localhost test]#
[root@localhost test]# ls
test1.txt  test2.txt  test2.txt_bak  test.txt
[root@localhost test]#
 
mv command 


8 . الآن إعادة تسمية الملف ( test1.txt ) إلى test3.txt .
[root@localhost test]# ls
test1.txt  test2.txt  test2.txt_bak  test.txt
[root@localhost test]#
[root@localhost test]# mv test1.txt test3.txt
[root@localhost test]# ls
test2.txt  test2.txt_bak  test3.txt  test.txt
[root@localhost test]#


 rm command, rmdir command
 9/10 . الآن حذف الملف من قبل قيادة RM ، حذف الدليل عن طريق الأمر RMDIR و إذا كان لديك العديد من الدلائل داخل دليل واحد. قم بإزالة ذلك الدليل الرئيسي على النحو التالي :
[root@localhost test]# ls
test2.txt  test2.txt_bak  test3.txt  test.txt
[root@localhost test]#
[root@localhost test]# rm test2.txt
rm: remove regular file `test2.txt'? y
[root@localhost test]# ls
test2.txt_bak  test3.txt  test.txt
[root@localhost test]# mkdir test1
[root@localhost test]# cd test1
[root@localhost test1]# touch file1
[root@localhost test1]# touch file2 file3
[root@localhost test1]# cd ..
[root@localhost test]# ls
test1  test2.txt_bak  test3.txt  test.txt
[root@localhost test]# rm -r test1/
rm: descend into directory `test1'? y
rm: remove regular empty file `test1/file3'? y
rm: remove regular empty file `test1/file2'? y
rm: remove regular empty file `test1/file1'? y
rm: remove directory `test1'? y
 إذا كنت ترغب في حذف دون موجه. استخدم الأمر التالي .# #
 [root@localhost test]# rm -rf test1
### انشاء دليل فارغ
[root@localhost test]# mkdir test1
الأمر RMDIR يزيل دليل فارغ فقط##
 [root@localhost test]# rmdir test1
[root@localhost test]#

0 التعليقات:

إرسال تعليق