Friday, March 1, 2013

How Redirect Console / Terminal output to File and Console Both in Linux


1 . >> operator [redirect all output to file]

    #./a.out >> op.txt

2. | tee [redirect all output to file & Console both]

    #./a.out | tee op.txt

How to reactivate Windows 7

Steps:
1. open command prompt (run as administrator)
2. type: slmgr -rearm (press enter)
3. reboot system

How to install grub for Ubuntu


LIVE BOOT with ubuntu 64 BIT only

lauch Gparted check ext4 parition of ubuntu note down (e.g. /dev/sda7 then let x=a and y=7)

First, open the Terminal and execute below commands

Mount partition
sudo mount /dev/sdXY /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt

Install Grub 
grub-install /dev/sdX
grub-install --recheck /dev/sdX
update-grub

Now unmount all
exit
sudo umount /mnt/dev
sudo umount /mnt/dev/pts
sudo umount /mnt/proc

sudo umount /mnt/sys
sudo umount /mnt
All done!! just reboot your system

How to change boot order Linux UBUNTU FEDORA CENTOS

STEPS:

  1. Note the serial number (x) of the desired default OS during grub loading start counting from zero (0).
  2. Edit /boot/grub/grub.conf
  3. change default value to x
  4. Save and reboot.

Command to check SSH LOG in LINUX UBUNTU



1. Open terminal  type below command and hit enter.

        last | head