Skip to content

Instantly share code, notes, and snippets.

@l0neranger
l0neranger / tab-to-csv.sh
Last active August 29, 2015 14:00
Convert a tab de-limited mysql export to csv
# Strategy:
# Remove all double quotes.
# Replace all tabs with double-quotes on either side of a comma.
# Add double-quotes to the beginning and the end of the line.
# Debian
sed -e 's/\"//g' -e 's/\t/\",\"/g' -e 's/^/\"/' -e 's/$/\"/' filename.tab > filename.csv
# OS X: The \t needs to be replaced by CTRL+v followed by a tab.
@l0neranger
l0neranger / gist:9441808
Created March 9, 2014 01:55
Rename User and Move Home Directory [Debian/Ubuntu]
#!/bin/bash
usermod -l newusername -d /home/newusername -m oldusername
groupmod -n newusername oldusername