Showing posts with label sysadmin. Show all posts
Showing posts with label sysadmin. Show all posts

Monday, November 16, 2009

Version

Hi,

Probably did this before - but administered lost and found computers has made me need this info again.

Version of linux.
cat /proc/version


Gives you:
Linux version 2.6.28-15-generic (buildd@rothera) (gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) ) #52-Ubuntu SMP Wed Sep 9 10:49:34 UTC 2009



And then you need the release info for the distribution.

lsb_release -a


Gives you:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 9.04
Release: 9.04
Codename: jaunty



And of course uname -a. Which is a start. Would love to hear other tips on determining the state of a box that has previously been abandoned.

Update: Naming of the actual machine and shit as well.

Running hostname should give you the name of the actual machine. Not entirely sure how this works when you have multiple "machines" kinda running off the same physical machine.
user@machine:~$ hostname
machine-name



You can then check this the other way round:
user@machine:~$ host name.domain.tld
ip address .in-addr.arpa domain name pointer name.domain.tld

Tuesday, January 13, 2009

Disk space usage

My VM keeps getting filled up, and then crashing cos the programs that write logs are not being correctly handled by the underlying FS. So I am interested in generating useful infos on the disk to find out where all the disk space is at. The command du is a big help here. But I frequently just want to know in which directories the most space is being used.

du -h --max-depth=1

That command will give you a listing of which directories under the current dir are using all the space. So in the home dir or at the usr dir run this and find out where all the unneccessary crap is.

Giving me in the /usr dir the following output:
1.1G    ./share
40K ./games
1.4G ./local
7.1M ./sbin
125M ./src
36K ./X11R6
136M ./bin
14M ./include
1.6G ./lib
4.3G .


And this tells me that I ought to tidy up the /usr/local dir. If you ran the above command without the max-depth option then the resulting output will probably overrun your cache/history in your bash shell and besides the output would be impossible to make sense of.