Index

Files

printing to system output

print file line by line
cat [file]
print file line by line (reverse order)
tac [file]

Copy

copy file
cp original destination
copy directory
cp -r directory destination
copy don't overwrite (useful for backups)
cp -n original destination

Move

move file
mv original destination
move file (verbose)
mv -v [source] [destination]

Soft link

create soft link (general form)
ln -s [existing target] [link to create]
concrete example
ln -s ~/.bashrc /tmp/bashrc
create links to files with their original name in a destination directory
ln -s ~/.b* .
get the destination of a link on the filesystem
readlink [existing_link]

rsync

copy directory source/data to destination/data
rsync -v -a source/data destination
copy files from source/data to destination/data without overwriting
rsync -v -a --ignore-existing source/data destination
move files (not links) from source/data to destination/data without overwriting
rsync -v -a --ignore-existing --remove-source-files source/data destination
same as above, but create hardcopies of links
rsync -v -a --ignore-existing --remove-source-files --copy-links source/data destination

split a file into chunks

split a file into chunks of specified size
split --bytes 500M --numeric-suffixes --suffix-length=3 [input] [output file prefix]