AegisRyan's Island

about tech, code, hobbies..


Archive for April, 2010



How to Check My Linux Version?

Tuesday 20 April 2010 @ 11:05 am

The similar question you may ask:

  • How to know my Linux server is running in 64/32 bits?
  • How to check which kernel version is my Linux?
  • How to show the Linux release name? Is it Ubuntu?Redhat or CentOS or something else?

In work, we have many different linux servers either in physical machine or virtual machine (Using Xen/KVM). Sometimes we easily lost track of which linux version is installed for Server A, B, and other.

There are few simple command to check for which Linux version you were using:

To show the linux release information as per LSB specification

sudo lsb_release -a

No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 8.04
Release:    8.04
Codename:    hardy

To show the Linux kernel build and version

cat /proc/version

Linux version 2.6.24-19-xen (buildd@king) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Sat Jul 12 00:15:59 UTC 2008

The other commands is to show the kernel version and type:

uname -a

Linux penguin 2.6.24-19-xen #1 SMP Sat Jul 12 00:15:59 UTC 2008 x86_64 GNU/Linux




How to List Crontab for All Users

Friday 9 April 2010 @ 10:23 am

There was a time I would like to check what are the task/job configured in crontab of all users. After I googled it I found this scripts from StackOverflow

You must run this script as root.

   for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done

What does it do? This script basically loop thru /etc/passwd to get the user id and call ‘crontab -l’ for each user. A nice script to share and also I would like to keep it here so easy for me to refer next time.