Tag Archives: Unix

Find All Hard Links to a File

FILE=’/my/hard/link’ find “$(stat -c %m “$FILE”)” -xdev -samefile “$FILE”

Posted in General | Tagged , | Leave a comment

dos2unix & unix2dos

Convert file with Windows line endings to UNIX and vice versa, all in Perl: perl -i -pe ‘s/\r//g’ dos2unix perl -i -pe ‘s/\n/\r\n/g’ unix2dos

Posted in General | Tagged , | Leave a comment

Unix Timestamp

Display current or specified date in Unix epoch: date –utc +%s date –utc +%s -d ‘2012-01-01 00:00:00’

Posted in General | Tagged , | Leave a comment