Posts tagged as:

Linux

Stickies : Linux - FreeBSD commands

by Perk1z on July 14, 2007

Disk, filesystem

Disk usage
{linux}$ du -sh
{freebsd}$ du -sh

Count subdirectories in current directory:
{linux}$ du –max-depth=1
{freebsd}$ du -d1

Typical approach to find biggest directories/files on disk:
{linux}$ du –max-depth=1 -kx|sort -n
{freebsd}$ du -d1 -kx|sort -n

Find some kinds of files (regex is a mask for full path, no need for begin/end marks)
{linux}$ find . -regextype posix-extended -type f -regex “.*\.(java|class)”
{freebsd}$ find -E . -type f -regex “.*\.(java|class)”

Show open files and programs:
{linux}$ lsof
{freebsd}$ fstat

Some networking
Show open ports and apps connected to them:
{linux}$ netstat -apne –inet
{freebsd}$ sockstat

Kernel issues
Show loaded modules:
{linux}$ lsmod
{freebsd}$ kldstat

Load kernel module:
{linux}$ modprobe SomeModule
{freebsd}$ kldload SomeModule

Remove loaded module:
{linux}$ rmmod SomeModule
{freebsd}$ kldunload SomeModule

[click to continue...]

Popularity: 10% [?]

{ 0 comments }