Showing posts with label Linux Tips. Show all posts
Showing posts with label Linux Tips. Show all posts

change and update date & time, time zone in ubuntu

tzselect: It is a command to change time zone in ubuntu. Just run the command, select continent or ocean, and
country . Type tzselect and press enter...
#tzselect
Run below command to syncronize time with ntp server
#ntpdate ntp.ubuntu.com

how to get entire system information in ubuntu

facter : It is a tool to collect and display facts about the current system. The library behind Facter is easy to expand, making Facter an easy way to collect information about a system from within the shell or within Ruby.
#apt-get install facter
#facter and press enter to get the system details
Below is the output of facter
# facter
architecture => i386
facterversion => 1.5.4
hardwareisa => unknown
hardwaremodel => i686
hostname => my-desktop
id => root
interfaces => eth0
ipaddress => 192.168.xxx.xxx
ipaddress_eth0 => 192.168.xxx.xxx
kernel => Linux
kernelrelease => 2.6.31-22-generic-pae
kernelversion => 2.6.31
lsbdistcodename => karmic
lsbdistdescription => Ubuntu 9.10
lsbdistid => Ubuntu
lsbdistrelease => 9.10
lsbmajdistrelease => 9
macaddress => 00:16:ec:da:bc:21
macaddress_eth0 => 00:16:ec:da:bc:21
manufacturer => HP Pavilion 061
memoryfree => 1.28 GB
memorysize => 1.90 GB
netmask => 255.255.255.0
netmask_eth0 => 255.255.255.0
network_eth0 => 192.xxx.xxx.0
operatingsystem => Ubuntu
operatingsystemrelease => 9.10
physicalprocessorcount => 1
processor0 => Intel(R) Pentium(R) D CPU 2.80GHz
processor1 => Intel(R) Pentium(R) D CPU 2.80GHz
processorcount => 2
productname => RC562AA-ACJ a1514in
ps => ps -ef
rubysitedir => /usr/local/lib/site_ruby/1.8
rubyversion => 1.8.7
serialnumber => INI6370L08 AP640
sshdsakey => AAAAB3NzaC1kc3MAAACBAOBuTdUYuMv2b3xqIhWVpuRQunyIm6T5xOYqlZbwuBTi66oZwWTfE5rywsUHQL8CExMaofWFxlo3c+mTcxWIL+68ZjY5NZy5irwAl3g/CL4THtHmDCMbCmvdQLZeePElvYNFcmvC+7o3CbZWC2KU2FnzTCuI9vpG1k51OSiZJtdHAAAAFQDUId/oRXYQ281bZ9J42Wrt3VsbgQAAAIEAn74omuvo4qKjr1PE12HZSA2oeqpFajcGctEyxurQXzpLgjWcgs1ip2phjz6kypDIbELG/nvOComWIABADwnBnErwM0uDpchOkghzCFgR7Hk10Ph1/SQ4Si0y8jKZ9VzPxYzhZp0ekpL15QIutJSTbCG7WzlGRl3eHrY0cVgZVs4AAACABl/PgIPo0u8L2jI0R5wpUql1Tb0Ln+LTMt1HZoqR2gb7dmvI3FvNRbJfEMOy8f5YXeELQz1ppwRS8PpAas3Dh+Deg9dVSzKUTZURqOe4X8TWjrhf3I6jn00zvIjmGk0XhB5ueH3uoQsjogL/uRws1Tqk1wxF/xvt25t8jV1WATQ=
sshrsakey => AAAAB3NzaC1yc2EAAAABIwAAAQEAy6l8d9gOYGQ9CHQoQBmoJ74NDnSZBreIXD/nsAwj93i7pCv9LJ1ifybP7am7kJq3qaHhoU3sB8oaTUUfeXMXGfoHrwRvcIdYFdDKQ7KvjpZU7jWSsKECk0aibaVzqni5sixquLXcjte18T7DU1ki/K/sQPvSQII2Y9EWOAzdzoov4ezj30uer6sR6BkXSR5LK3LW+qoRPKT+xIQMBseJ9TZ8Tz7hpiz1AmcmPNhLj61aK0/1bbRBKzfr8bd8kkI3vkHvfE5Sqzu4VplSCNxa9QNG9jNFCdN/cGCYlL7GdWPNdBP3jzFXeLNgH+bTA82FrBqFaQo5bUOBSSCKFZyuaQ==
swapfree => 5.58 GB
swapsize => 5.58 GB
timezone => IST
type => Desktop
uniqueid => 007f0101
uptime => 4 days
uptime_days => 4
uptime_hours => 109
uptime_seconds => 395539
virtual => physical

how to mount ISO on Ununtu

Mount iso in Ubuntu
mount -o loop -t iso9660 /path/to/iso/file.iso /media/cdrom
umount /media/cdrom or umount -f /media/cdrom

properties of user in linux

To check the user properties grep for a user name. 
root# grep user-name | /etc/passwd
user-name:x:500:500: :/home/user-name:/bin/bash # this line contains 7 information of a user.

{user-name}:{x}:{500}:{500}:{ }:{/home/user-name}:{/bin/bash} # I have divided each part with a bracket.

1.{user-name}                    = User name 
2.{x}                                   =Encrypted password
3.{500}                               =UID
4.{500}                               =GID
5.{ }                                    =Comment
6.{/home/user-name}         =User's default or home directory
7.{/bin/bash}                      =Default Shell of Linux

Users in Linux

In Linux platform their are 2 types of user such as System User and Normal User
System User : The user which are created default by Operating System are called system users.The function of this user to access or manange system services which cannot be utilized by normal user. The system services are Ex:shutdown,restart and application service like mail services and apache services etc..
The system users can also be recognized with the help of an UID(Unique Identifier) which starts from 0(zero) and  reserved up-to 499 by default.

Normal User: The user which are created manually by an administrator or by a system user to access system objects and resources are called normal users. Normal user can be recognized with the help of an UID(Unique Identifier) which starts from 500 and reserved up-to 60,000 by default.

linux file shareing server

Linux has 3 types of File Shareing Servers. P
1.FTP (File Transfer Protocol)
FTP usages port number 20 & 21
2.NFS(Network File Shareing)
NFS usages port number 204 and 111
3.Samba(It is a network service for file and print shareing)
Usages port number 137,138 & 139

Installation and configuration will be updated soon.....


partprobe(partitionpro)

Syntax: partprobe (device name) ### It will update partition table without reboot
Ex: partprobe /dev/sda



minumum and maximum partitions in linux

fdisk can create maximum 15 partitions in RHEL5
fdisk can create maximum 63 partitions in RHEL6
parted can create maximum 63 partitions in RHEL6

LVM disk backup in to image file

vmname-002 is running on LVM partition so I am taking vmname-002 LVM disk backup in to image file.

dd if=/dev/VG_Guests/vmname-002 of=newimage.img bs=1M