files and directories
create temporary file¶
remove windows line breaks¶
split a file in small pieces¶
where:
--bytes=<size>
is the maximum size of each piece, in bytes, or an interger folloed byK
,M
,G
,T
,P
,E
,Z
,Y
-d
adds a numeric suffix in the end of the file name<prefix>
the name of every piece
an example: an iso file can be sliced in several 1Gb files:
$ split --verbose --bytes=1G -d imagefile.iso img
creating file "img00"
creating file "img01"
creating file "img02"
creating file "img03"
creating file "img04"
to join these files back together, use
listing only one column of a file¶
a file with columns separated by :
can have its data displayed like this
showing a file content, removing duplicates¶
list the recursive contents of a directory¶
ls -R /my_path | awk '
/:$/&&f{s=$0;f=0}
/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}
NF&&f{ print s"/"$0 }'
besides showing the contents recursively, this command also shows the full path of the files, not just the names.
reference: AskUbuntu.com