Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, October 8, 2013

FreeBSD's badblocks utility

I had a hard time finding badblocks for FreeBSD 9.2 when Googling for "FreeBSD badblocks": https://google.com/search?&q=FreeBSD+badblocks

pkg_add -r e2fsprogs

If you're in csh or tcsh or zsh, run rehash and you can use badblocks.

Should've realized looking up what package provides it for Linux (also e2fsprogs) would've found me the package for FreeBSD.

Tuesday, December 18, 2012

Check for Kerberos ticket or authentication

Some commands require a valid Kerberos ticket, but if you want to integrate a check for a ticket yourself, try this:
/usr/kerberos/bin/klist -5 -c -s 2

Thursday, May 31, 2012

Show Linux or *nix permissions in octal

Like many others before me, I briefly Googled for "ls show octal permissions" (without quotes) and got next to nothing immediately useful: https://www.google.com/search?q=ls+show+octal+permissions

I would've written the solution to this thread since I got this idea from there, but unfortunately, it's closed: http://www.unix.com/unix-dummies-questions-answers/119538-ls-switch-view-octal-permissions.html

Solution: ditch ls and use stat instead---stat can format its output similar to date.
$ stat -c %a "${filename}"
644