If you do not find what you're looking for, you can use more accurate words.
split txt.txt --verbose creating file ‘xaa’ creating file ‘xab’
split -l200 txt.txt --verbose creating file ‘xaa’ creating file ‘xab’ creating file ‘xac’ creating file ‘xad’ creating file ‘xae’ creating file ‘xaf’
wc -l xa* 200 xaa 200 xab 200 xac 200 xad 200 xae 91 xaf
استخدم بناء الجملة التالي لتقسيم الملفات ذات الحجم بالبايت، KB ، MB و GB
# split -b {bytes} {file_name} # split -b nK {file_name} // n هي القيمة الرقمية # split -b nM {file_name} // n هي القيمة الرقمية # split -b nG {file_name} // n هي القيمة الرقمية
تقسيم الملف بناءً على وحدات البايت: # split -b2000000 txt.txt تقسيم الملف بناءً على كيلوبايت: # split -b 50K txt.txt تقسيم الملف بناءً على ميغابايت: # split -b 50M txt.txt تقسيم الملف على أساس GB: # split -b 1G txt.txt
تقسيم الملف بناءً على وحدات البايت:
split -b2000000 tuxlap.txt
تقسيم الملف بناءً على كيلوبايت:
split -b 50K tuxlap.txt
تقسيم الملف بناءً على ميغابايت:
split -b 50M tuxlap.txt
تقسيم الملف على أساس GB:
split -b 1G tuxlap.txt
في الأمثلة الموضحة أعلاه، رأينا أن ملفات إخراج أمر الانقسام يتم إنشاؤها باستخدام لاحقة أبجدية مثل xaa و xab ...
[root@Amine ~]# split -d tuxlap.txt [root@Amine ~]# ll total 1024256 -rw-------. 1 root root 980 Aug 12 00:15 anaconda-ks.cfg -rwx------. 1 root root 1048576000 Apr 15 03:54 linux-lite.iso -rw-r--r--. 1 root root 120010 Apr 15 04:39 tuxlap.txt -rw-r--r--. 1 root root 11998 Apr 15 04:41 x00 -rw-r--r--. 1 root root 12000 Apr 15 04:41 x01 -rw-r--r--. 1 root root 12000 Apr 15 04:41 x02 -rw-r--r--. 1 root root 12000 Apr 15 04:41 x03 -rw-r--r--. 1 root root 12000 Apr 15 04:41 x04 -rw-r--r--. 1 root root 12000 Apr 15 04:41 x05 -rw-r--r--. 1 root root 12000 Apr 15 04:41 x06 -rw-r--r--. 1 root root 12000 Apr 15 04:41 x07 -rw-r--r--. 1 root root 12000 Apr 15 04:41 x08 -rw-r--r--. 1 root root 12000 Apr 15 04:41 x09 -rw-r--r--. 1 root root 12 Apr 15 04:41 x10 [root@Amine ~]#
باستخدام الأمر split ، يمكننا إنشاء ملفات الإخراج المقسمة باستخدام لاحقة مخصصة. لنفترض أننا نريد إنشاء ملفات إخراج مقسمة مع تخصيص اللاحقة
# split {file_name} {prefix_name}
[root@amine ~]# split tuxlap.txt split_file_ [root@amine ~]# ll total 1024248 -rw-------. 1 root root 980 Aug 12 00:15 anaconda-ks.cfg -rwx------. 1 root root 1048576000 Apr 15 03:54 linux-lite.iso -rw-r--r--. 1 root root 11998 Apr 15 04:56 split_file_aa -rw-r--r--. 1 root root 12000 Apr 15 04:56 split_file_ab -rw-r--r--. 1 root root 12000 Apr 15 04:56 split_file_ac -rw-r--r--. 1 root root 12000 Apr 15 04:56 split_file_ad -rw-r--r--. 1 root root 12000 Apr 15 04:56 split_file_ae -rw-r--r--. 1 root root 12000 Apr 15 04:56 split_file_af -rw-r--r--. 1 root root 12000 Apr 15 04:56 split_file_ag -rw-r--r--. 1 root root 12000 Apr 15 04:56 split_file_ah -rw-r--r--. 1 root root 12000 Apr 15 04:56 split_file_ai -rw-r--r--. 1 root root 12000 Apr 15 04:56 split_file_aj -rw-r--r--. 1 root root 12 Apr 15 04:56 split_file_ak -rw-r--r--. 1 root root 120010 Apr 15 04:39 tuxlap.txt [root@amine ~]#