Linux commands

Antworten
Benutzeravatar
Sebastian
Administrator
Beiträge: 660
Registriert: Di 28. Mai 2013, 21:45
Wohnort: Monheim
Kontaktdaten:

Linux commands

Beitrag von Sebastian » Mo 4. Mai 2020, 17:24

Sort huge files (using another location for temp if RAM is not enough)

Code: Alles auswählen

sort -T /var/somewhere/tmp/ -u passwords.txt >> newfile.txt
-T specifies the location where to store temp files during sort process
-u only unique lines should remain

Merge files with two values within one line each only keep the second one and also formatted in DOS format (remove ^M EOL symbol); in addtion only keep those values with >8 chars lenght

Code: Alles auswählen

cat *.txt | cut -d':' -f2 | sed -e "s/\r//g" | grep -E '^.{8,}$' >> ../passwords.txt

Antworten