Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Useful commands in Linux

For copying files keeping modtime, easiest to use rsync: rync -trv [source] [target] (times, recursive, verbose) Add -n for dry-run.

For queuing tasks:

  1. Install task spooler sudo apt-get install task-spooler
  2. Queue commands with tsp {command}
  3. To mail result, add TS_MAILTO: export TS_MAILTO=address@domain
  4. Queue with different working directory and mail result: tsp -m bash -c '(pushd /dir/to/enter && {command}; popd)'

Python defaults to ASCII sys.output encoding even if terminal is UTF-8. To fix use: PYTHONIOENCODING=utf-8:surrogateescape python script.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment