-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplit
85 lines (49 loc) · 4.5 KB
/
split
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
طرق للبحت عبر سطر الاوامر داخل الملفات
تنظيف ارقام الهاتف من 11 رقم من ملفات
grep -o '[0-9]\{11\}' n.txt > number.txt
grep -E '(.+\.)+.+\..+$' tftp.txt > 55555.txt استخراج الدومينات الفرعية فقط
grep -R ':' IpsUK-AllPORT.txt >new.txt امر فلترة كافة الاسطر بحثا عن الرمز : واعادة حفظهم فى ملف أخر مهم جدا للسكان
grep -n '194.6.1.156:8280' ips.ip كشف كم رقم الاى بى بأى سطر بالملف
grep 'word' filename – Search any line that contains the word in filename on Linux
grep -i 'bar' file1 – A case-insensitive search for the word ‘bar’ in Linux and Unix
grep -R 'foo' . – Search all files in the current directory and in all of its subdirectories in Linux for the word ‘foo’
grep -c 'nixcraft' frontpage.md – Search and display the total number of times that the string ‘nixcraft’ appears in a file named frontpage.md
ظغط سريع للمفات لحد النصف
lz4 [OPTIONS] [-|INPUT-FILE] <OUTPUT-FILE>
unlz4 is equivalent to lz4 -d
grep -i '92.222.220' ips.ip > test.txt جيد
grep -iF '"txt.' aaa.json > qqqqqq.txt الافضل حاليا
awk '$0="Mohammad"$0' hosts.txt > testHosts.txt اضافة كلمة او سطر او رمز اول السطر فى ملف النصي
grep -m100000 -iF 'text' mx.txt > save.txt لكن بده ترتيب النتائج بتفرق عن الى فوق سريع
gunzip file.gz فك ظغط ملفات gz
lz4 file
unlz4 file
cat palman.txt | split -d -b 50m - "palman." تقسيم الملف الى ملفات بحجم 50 ميغا
cat palman.* >>palman.txt تجميع الكل الى ملف واحد
sort -u ipGOOD.txt > testip.txt تنظيف المكرر عبر سطر الاوامر
grep -oP "(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]" ip.txt > ipNEW.txt بنظف ملف الايبيهات ويتم الحصول على رئيسيى وفرعي
grep -E '\.[^.]+\.[[:alpha:]]' ipNEW.txt > ipGOOD.txt تنظيف دومينات وسب دومين
awk -F. '{print $1}' ip.txt > ipNEW.txt مفيد لتنقية الاسماء الفرعية للدومين واستخدامها فى التخمين
awk -F\. '{print $(NF-1) FS $NF}' ip.txt > ipNEW.txt تنظيف دومينات رئيسية من اى اضافات
grep -x '[A-Za-z0-9_\.-]*.net' net.txt > netnew.txt فرز الدومينات على حسب الامتداد
grep -io '[0-9a-f]\{12\}' file.txt > macs.txt تنظيف ماكات
grep -Po "(\d+\.){3}\d+:?(\d?){4}" palman.txt > ip.txt تنظيف الايبيهات واخراج ايبيهات مع بورتات
grep -Po "([0-2]?\d?\d\.){3}[0-2]?\d?\d:(\d?){5}" file تنظيف واضافة بورت
grep -Po "([0-2]?\d?\d\.){3}[0-2]?\d?\d" file تنظيف بدون بورت
grep -Po "(([0-1](\d\d?)?|2([0-4]\d?|5[0-5]?|[6-9])?|[3-9]\d?)\.){3}([0-1](\d\d?)?|2([0-4]\d?|5[0-5]?|[6-9])?|[3-9]\d?)(:([0-5](\d(\d(\d\d?)?)?)?|6([0-4](\d(\d\d?)?)?|5([0-4](\d\d?)?|5([0-2]\d?|3[0-5]?|[4-9])?|[6-9]\d?)?|[6-9](\d\d?)?)?|[7-9](\d(\d\d?)?)?))?" "textfile.txt"
yum update -y && yum install epel-release -y && yum install python-devel python-setuptools python-pip -y && yum install requests==2.18.4 && yum install urllib3==1.22
grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ip.txt > ip80.txt
تنظيف ايبيهات
cat ip80.txt | grep '^[0-9]\{1,3\}[.][0-9]\{1,3\}[.][0-9]\{1,3\}[.][0-9]\{1,3\}[,].*$\|^.*[,][0-9]\{1,3\}[.][0-9]\{1,3\}[.][0-9]\{1,3\}[.][0-9]\{1,3\}[,].*$\|^.*[,][0-9]\{1,3\}[.][0-9]\{1,3\}[.][0-9]\{1,3\}[.][0-9]\{1,3\}$'
split -l 50000 -d --additional-suffix=.txt ip.txt Pal- بقسم الايبيهات لعدد 50 الف وبحفظ بامتداد txt
rm -rf PAL حدف مجلد
mkdir PAL انشاء مجلد
rename test.txt hope.txt تغير اسم الملف
I know the question has been asked a long time ago, but I am surprised that nobody has given the most straightforward unix answer:
split -l 5000 -d --additional-suffix=.txt $FileName file
-l 5000: split file into files of 5,000 lines each.
-d: numerical suffix. This will make the suffix go from 00 to 99 by default instead of aa to zz.
--additional-suffix: lets you specify the suffix, here the extension
$FileName: name of the file to be split.
file: prefix to add to the resulting files.
As always, check out man split for more details.