Posts Tagged ‘1-line’

Quick Tip: Erase a drive (insecurely) in 1 Line

sudo dd if=/dev/zero of=/dev/sdx bs=512 count=1
where sdx is the drive you want to zero (this is an INsecure wipe)

Quick Tip: Remove Lines with sed in 1 Line

cat sample.txt | sed -e '1,15d'

Quick Tip: Check PaDB Disk Usage in 1 Line

select owner, host, diskno, used, capacity from stv_partitions order by 1, 2, 3, 4, 5;
select sum( used), sum(capacity) from stv_partitions;

Quick-Tip: How to Search SQL/NoSQL/Postgres Information Schema in 1 Line


This also works for table_name!

Quick-Tip: How to Populate a Table in InfiniDB in 1 Line

cat data.tsv |sudo /usr/local/Calpont/bin/cpimport -s ‘\t’ hsa_infinidb tablename

Quick-Tip: Set MySQL PATH in 1 Line

export PATH=$PATH:/full/path/to/mysql

Quick-Tip: Check SQLWorkbench/J errors in 1 Line

select * from stl_load_errors where date(starttime) = ‘1999-12-31’ order by starttime desc limit 1;

Quick-Tip: Display Internal IP Address on Linux Bash CLI in 1 Line

ifconfig en0 | grep inet | cut -d : -f4 | awk ‘{print $2}’