Author Archives: ptankov

[HOWTO] Create a large file that occupies no space

dd if=/dev/zero of=largefile count=0 obs=1 seek=200G

Posted in Uncategorized | Leave a comment

[TIP] Find newest (last modified) files

find . -type f -printf “%TY-%Tm-%Td %TT %p\n” | sort | tail -5 or find . -type f -printf “%TY-%Tm-%Td %TT %p\n” | sort -r | head -5

Posted in console | Leave a comment

[TIP] Avoid SSH security question

ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null user@host

Posted in console | Tagged | Leave a comment

[TIP] Force variable substitution within single quotes in BASH

Sometimes in a BASH script you need to have single quotes but the value inside them is actually a variable. Here is how to have both the single quotes and the actual value of the variable expanded. % foo=bar % … Continue reading

Posted in console | Tagged | 4 Comments

[TIP] Count non-empty lines in a text file

grep -c -v ‘^$’ filename If you want to, as well, exclude lines which contain only spaces: grep -c -v ‘^ *$’ filename Notes (from the grep man page): -c, –count Suppress normal output; instead print a count of matching … Continue reading

Posted in console | Tagged , , | Leave a comment

[HOWTO] Install and Configure FreeBSD 7.1 on VMware Workstation 6.5 From the Ground Up

This HOWTO shows a step-by-step installation and configuration of FreeBSD 7.1 from scratch. The reader should have a basic Linux and/or Unix knowledge and should feel comfortably with the console. Throughout this document, by “VMware” I’m actually referring to “VMware … Continue reading

Posted in console | Tagged , | 6 Comments

[HOWTO] Mount ISO Image File on AIX

The usual mount -o ro,loop image.iso /mnt/iso/, which you’re used to on Linux, can’t be used on AIX. On AIX you dd the ISO file into a raw Logical Volume, then mount the LV as a filesystem. Here are the … Continue reading

Posted in console | Tagged | 2 Comments