User Tools

Site Tools


file_disk_tools

File & Disk Tools

Remove all Comments from File

sed -e '/^#/d' <file>

Split a File

This will not split single lines:

split --line-bytes=<size> <file_to_split>

The size argument is an integer and optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,… (powers of 1000).

Un-Split a File

cat <file_to_split>-part-* > <file_to_split>

Remove Duplicates

sort <file> | uniq -u > <new_file>

Delete Disk

shred -vn 1 /dev/<device>
file_disk_tools.txt · Last modified: 2020/09/26 16:25 by pmay