Grep: Skirtumas tarp puslapio versijų
Jump to navigation
Jump to search
(Naujas puslapis: == Grep exceptions from file == grep -vf exclude.txt file.txt {{Template:Distributions}} Category:Scripts) |
|||
(nerodoma viena tarpinė versija, sukurta to paties naudotojo) | |||
2 eilutė: | 2 eilutė: | ||
== Grep exceptions from file == | == Grep exceptions from file == | ||
grep -vf exclude.txt file.txt | grep -vf exclude.txt file.txt | ||
+ | |||
+ | === Jeigu didesnis failas ir pasibaigia ramas === | ||
+ | Pirmiausia susortinam failus | ||
+ | cat file.txt | sort -u > file_sorted.txt | ||
+ | cat exclude.txt | sort -u > exclude_sorted.txt | ||
+ | Darom compare | ||
+ | comm -23 file_sorted.txt exclude_sorted.txt > file_clean.txt | ||
{{Template:Distributions}} | {{Template:Distributions}} | ||
[[Category:Scripts]] | [[Category:Scripts]] |
Dabartinė 13:29, 18 liepos 2019 versija
Grep exceptions from file[keisti]
grep -vf exclude.txt file.txt
Jeigu didesnis failas ir pasibaigia ramas[keisti]
Pirmiausia susortinam failus
cat file.txt | sort -u > file_sorted.txt cat exclude.txt | sort -u > exclude_sorted.txt
Darom compare
comm -23 file_sorted.txt exclude_sorted.txt > file_clean.txt