Saturday, 2 February 2013

How To Find All Zero Byte Files (aka Zero Length File) Under Ubuntu / Linux

A zero byte file is a file that is placed in your hard drive with no data inside it. This means it has a size or length of zero bytes. If you want to list all zero byte files in a particular location in your hard drive under Ubuntu or any other Linux-based system, you can simply use the "Find" command line utility.

To scan for example the current terminal location for zero length files, you can use this command:

find -size 0

To scan a particular directory (the home directory for example), use this command:

find ~/ -size 0

To scan your root folder, use this command:

find / -size 0

What To Do After A New Installation Of Ubuntu 12.04 Precise Pangolin

Some readers contacted me about the possibility to write an article about things to do after a fresh installation of Ubuntu 12.04 Precise Pangolin. In fact, there are many things to do after a new installation of Ubuntu 12.04, but in this guide I will try to give you what is important. If you think we have missed something interesting for Ubuntu 12.04, please mention it in the comment form given below.

1. Updating Your Repositories

The first thing to do is to configure Ubuntu to download packages from main Ubuntu servers instead of location-based servers to avoid the notorious 404 error when installing packages from the terminal using the "apt-get install" command. To do this, start the terminal (Ctrl+Alt+T) and run this command:

    sudo software-properties-gtk


Make sure all options under "Downloadable from the internet" are checked on, then select Download from: Main server:


In the same window, open the "Other Software" tab and check on all unticked sources (Canonical, Independent, etc.):


Close the window and update now your repositories with these commands:

    sudo apt-get update

    sudo apt-get upgrade


2. Installing Hardware Drivers

Open the terminal and run this command:

    sudo jockey-gtk


In the window that appears, install proposed hardware drivers (wifi, keyboard, proprietary graphics card drivers, etc.):


If you own a high-end graphics card from Nvidia or AMD, you need to install the latest open-source driver to get better graphics support and performance. We have written many articles about the installation of Nvidia/AMD drivers in this blog. You can check them here.

3. Add Support For Double Layer DVD In Ubuntu 12.04

To be able to read Double Layer DVDs on Ubuntu 12.04, you need to install the libdvdcss2 package with these commands:

    sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list

    sudo apt-get --quiet update

    sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring

    sudo apt-get --quiet update

    sudo apt-get install libdvdcss2


4. Installing Multimedia Packages ( Ubuntu Restricted Extras)

Ubuntu needs some packages to be able to play certain audio/video format such as MP3, AVI, Mp4, etc. To install them, open the terminal and run this command:

    sudo apt-get install ubuntu-restricted-extras


5. Managing Unity & Desktop Visual Effects

If you need to do some modification for example on the launcher's icon size, transparency, backlights,  window decoration, add desktop 3d effects, and so on, the best choice is to use software like MyUnity and  Compiz Config Settings Manager. To install them on Ubuntu 12.04, run the following commands:

 - Compiz Config Settings Manager:


    sudo apt-get install compizconfig-settings-manager


 - MyUnity:



    sudo apt-get install myunity


6. Clean up Ubuntu With Ubuntu Tweak


Ubuntu Tweak is an application with GUI that allows users to view system device details (CPU, Memory, etc.) and clean up your system from junk files that are unnecessary. You can install it on Ubuntu 12.04 or older with the following commands:

    sudo add-apt-repository ppa:tualatrix/ppa

    sudo apt-get update

    sudo apt-get install ubuntu-tweak


8. Installing Oracle Java 7

To install Java 7 under Ubuntu 12.04, run the following commands from the terminal:

    sudo add-apt-repository ppa:upubuntu-com/java

    sudo apt-get update

    sudo apt-get install oracle-java7-installer


9. Adding Themes To Unity & Gnome Shell

If you want to install GTK+ themes for Unity/Gnome Shell, you can get many of them here. The Gnome Shell interface is installed by default in Ubuntu 12.04 (Precise Pangolin). If it is not the case, you can simply install it with this command:

    sudo apt-get install gnome-shell gnome-tweak-tool


 To enable this interface, logout the current session, select GNOME from the session menu, then log back in:


To install Gnome Shell themes (not GTK+themes) on Ubuntu 12.04, you can refer to this article. For Gnome Shell extensions, go to this website, or check this post that we have published recently containing many extensions for Gnome Shell 3.4. You can also find here a list of application indicators for Unity.

10. Download Manager

If you want to perform mass downloads with the ability to pause/resume file download, you can install on Ubuntu 12.04 the UGET download manager with this command:

    sudo apt-get install uget


11. Graphics Applications

There are many graphics applications you can use on Ubuntu 12.04. Here are some popular ones that you need to install:

- GIMP 2.8

    sudo add-apt-repository ppa:otto-kesselgulasch/gimp

    sudo apt-get update

    sudo apt-get install gimp gimp-plugin-registry gimp-resynthesizer


- Inkscape Vector Graphics Editor

    sudo apt-get install inkscape


- Pinta 1.2

    sudo add-apt-repository ppa:pinta-maintainers/pinta-stable

    sudo apt-get update

    sudo apt-get install pinta


12. Media Players

There are many other powerful media players other than Rhythmobox such as VLC, Clementine, SMPlayer, and Audacious.

- VLC Installation:

    sudo add-apt-repository ppa:videolan/stable-daily

    sudo apt-get update

    sudo apt-get install vlc


- Clementine Installation:

    sudo apt-get install clementine


- Audacious Installation:

    sudo apt-get install audacious


- SMPlayer Installation:

    sudo apt-get install smplayer


13. Video Editing Software

You can simply use the Openshot video editor:

    sudo apt-get install openshot openshot-doc


14. Bittorent Client

If you want to download torrent files, you can use Transmission. To install it on Ubuntu, run this command:

    sudo apt-get install transmission-gtk transmission-common


15. Chat & Communication Software

The best communication software for Ubuntu to stay in touch with your friends and family is Skype, aMSN, and Pidgin. You can install Skype 4.0 with these commands:

    sudo add-apt-repository ppa:upubuntu-com/chat

    sudo apt-get update

    sudo apt-get install skype


aMSk with this command:

    sudo apt-get install amsn


For Pidgin, run this command:

    sudo apt-get install pidgin


16. Install Windows Applications On Ubuntu 12.04

There are many emulators that allow to run Windows applications and games on Ubuntu. The most popular one is Wine. You can install it with these commands:

    sudo add-apt-repository ppa:ubuntu-wine/ppa

    sudo apt-get update

    sudo apt-get install wine1.5


17.  Virtualization Software

Your best friend here is VirtualBox which allows to install various operating systems under Ubuntu. You can install it with these commands:

    sudo sh -c "echo 'deb http://download.virtualbox.org/virtualbox/debian precise contrib' >> /etc/apt/sources.list"

    wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

    sudo apt-get update

    sudo apt-get install virtualbox-4.1


18. Installing More Web Browsers

If you want to use more than one web browser, you can install Google Chrome or Opera.

- Google Chrome:

    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

    sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'

    sudo apt-get update

    sudo apt-get install google-chrome-stable


- Opera:

    wget -O - http://deb.opera.com/archive.key | sudo apt-key add -

    sudo sh -c 'echo "deb http://deb.opera.com/opera/ stable non-free" > /etc/apt/sources.list.d/opera.list'

    sudo apt-get update

    sudo  apt-get  install opera


19. Installing A Web Server

If you are web developer, you can simply use the LAMP web server on Ubuntu. A tutorial here explains its installation on Ubuntu 12.04.

20. Synaptic Installation

Synaptic is no longer available in Ubuntu 12.04. This tool allows to easily install, remove, and upgrade Ubuntu packages. If you want to restore it, you can simply install it with this command:

    sudo apt-get install synaptic

Run "apt-get update" and "apt-get upgrade" in one ommand

In this tutorial, we will see two methods that will allow us to combine two frequently used terminal commands in a single command under a system running Ubuntu/Linux Mint. We will help you run "apt-get update" and "apt-get upgrade" with one command called "update", which will be easier to write and will save you time.

Method 1

Open the terminal (CTRL+ALT+T) and run this command:

 > ~/.bash_aliases; gedit ~/.bash_aliases

For Linux Mint, run this command:

 > ~/.bash_aliases; pluma ~/.bash_aliases

Add now these lines:

alias update='sudo apt-get update; sudo apt-get upgrade'


Save your file and close it, then restart your terminal by closing and opening it again. You can now run two commands using this one:

update

Method 2

Open the terminal and run this command:

sudo gedit /usr/local/bin/update

For Linux Mint, run this command:

sudo pluma /usr/local/bin/update

Add now this line:

sudo apt-get update; sudo apt-get upgrade


Save your file and exit, then give execution permission to this file with this command:

sudo chmod +x /usr/local/bin/update

Run now this command to test your script:

update

I hope you find this tip useful!

Archey: Display Distribution Logo And System Information On The Terminal - Ubuntu/Linux Mint/Debian

Archey is a tool written in Python that allows users to preview system information along with your Linux distribution logo on the terminal. In this tutorial we will help you install it on Ubuntu, Linux Mint and Debian.

Archey Installation

Let's firstly install some dependencies with this command:

 sudo apt-get install scrot lsb-release 

Install now Archey with these commands:

cd /tmp
wget -O archey-0.2.8.deb http://goo.gl/a9ku4
sudo dpkg -i archey-0.2.8.deb

Start now Archey with this command:

archey

For Ubuntu, you will get this:


If you want to start Archey automatically once you launch the terminal, then do the following:

- Edit .bashrc with this command:

sudo gedit ~/.bashrc

For Linux Mint:

sudo pluma ~/.bashrc

- At the end of the file, add these two lines:

# Archey
archey

- Save your file and exit, then open a new terminal window to test Archey.

Archey Home Page

20 Useful Terminal Commands and Tools that you May Need in Ubuntu/Linux Mint

Terminal is a text-based interface that grants users direct access to the UNIX system. You can use Terminal to run some specific commands, create files/folders, change system settings, and any other features that aren't available via programs with GUI.

In this article, I have collected 20 tools and commands that can be useful for Ubuntu/Linux Mint users. If you have more interesting commands or tools, you can mention them below.

1. Make An ISO From A Folder

If you want to make an iso file from a directory containing other files and sub-directories via the terminal, you can use the following command:


mkisofs -o image.iso -R /path/to/folder/

If you wish to backup the home folder, use this command:

mkisofs -o image.iso -R $HOME

2. Remove Non-Empty Folder

To remove a non-empty folder from the command line, you can use this command:

rm -rf /path/to/folder/

3. Checking Current CPU Architecture (32-bit or 64-bit)

To list your processor architecture in Ubuntu/Linux Mint, use one of these commands:

uname -m

or

arch

or

 file /bin/bash | cut -d' ' -f3

4. Generate Random Passwords

To generate random passwords via the terminal, you can use the following commands:

   a - makepasswd

makepasswd is a command line tool for generating passwords in Ubuntu/Linux Mint. Install it with this command:

 sudo apt-get install makepasswd

To generate a password with 20 characters, enter this command:

makepasswd --chars=20

b- OpenSSL

You can also use OpenSSL to generate random passwords using this simple command:

openssl rand -base64 20

5. Check Uptime

To check for how long your computer or laptop has been running since you powered it on, issue this command:

uptime

To monitor system uptime in real-time, use this command:

 watch -n 1 uptime

6. Check Information About Your Video Card

To list information about your graphics card (Nvidia, AMD, Intel, etc.), enter this command:

 lspci -v -s `lspci | awk '/VGA/{print $1}'`

7. Download And Extract Tar Files In One Command

If you want to extract an archive file after being downloaded in a single command, you can use the following command for tar files:

 wget URL-To-TAR-File -O - | tar xfz -

Here is an example:

 wget http://garr.dl.sourceforge.net/project/multibootusb/MultiBootUSB_4.7.tar.gz -O - | tar xfz -

8. Block/Unblock Wifi/Bluetooth

To disable wifi or Bluetooth in Ubuntu/Linux Mint, we can simply use the rfkill command line tool. To deactivate wifi, enter this command:

rfkill block wlan

For Bluetooth:

rfkill block bluetooth

To unblock WiFi, enter this command:

rfkill unblock wlan

For Bluetooth:

rfkill unblock bluetooth

9. Check CPU Temperature

To get the current temperature of your processor, issue this command:

acpi -t

To check CPU temp in real-time, run this command:


watch -n 1 acpi -t

10. Change Read Speed Of A CD/DVD

Let's first get the maximum read speed of your optical drive with this command:

eject -X

To increase/decrease read speed of a CD/DVD inserted into your optical drive, enter this command followed by the desired speed:

 eject -x 4

For more than one optical disc drive, use this command:

 eject /dev/cdrom -x 4

11. Check RAM Speed

To check memory speed from the command line, run this command:

 sudo dmidecode -t 17 | awk -F":" '/Speed/ { print $2 }'

12. Read/Write Speed Of A Hard Disk

To check read/write speed of your hard drive on the terminal, use this command:

sudo hdparm -tT /dev/sda

13. Monitor Network Usage

IPTraf is a command line utility that allows to monitor network activities in real-time. Install it in Ubuntu/Linux Mint with this command:

 sudo apt-get install iptraf

Start monitoring using this command:

sudo iptraf

14- Downloading Websites

If you want to download an entire website via the terminal, enter this command:

 wget --recursive  --page-requisites --convert-links www.domain.com

15. Check Gmail Unread Messages

To check for unread messages in your Gmail account, use this command:

curl -u GMAILUSER --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "\t" if //; print "$2\n" if /<(title|name)>(.*)<\/\1>/;'

16. Monitor HDD Temperature

Use hddtemp to monitor hard disk temperature on the terminal. Run these commands:

sudo apt-get install hddtemp 
sudo hddtemp /dev/sda

17. Force Kill Apps

To force close an unresponsive software, run xkill from the terminal then click the software's window to close it.

18. Screen Recording

To capture your screen and record it in a video, use ffmpeg:

sudo apt-get install ffmpeg 
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq output.mpg

19. Check Current Kernel Version

You can simply use this command:

uname -r

20. Dtrx

The dtrx tool allows to extract most archive files without the hassle of memorizing the various extraction commands. To install it, run this command:

sudo apt-get install dtrx

Here are some examples:

dtrx file.zip 
dtrx file.tar.gz 
dtrx file.7z



Thursday, 29 November 2012


Linux Command To List Directories / Directory Names Only



The “ls” command in Linux dumps the files and directories in an argumented directory or the current directory by default. The options to this command change the behavior of this command, such as listing hidden files as well with -a option, or listing in long format with -l option. But if you wish to list directories only, there is no option in this command. But it does not mean that we cannot accomplish this. Linux has provided with a lot of options to fiddle with. You can use command chaining (using pipes) to see what directories are present in a given directory. This article presents a number of ways of getting the directory listing.

Listing directories using Wildcards

The simplest method is using wildcards. All the directories end in forward slash.
$ ls -d */
Desktop/ Downloads/ looped/ Music/ orb.db/ Pictures/ Templates/ Videos/ Virus/
Documents/ jvm/ mounts/ netbeans-6.9/ PacketTracer5/ Public/ Ubuntu One/ VirtualBox VMs/
For long listing, just add -l option.
$ ls -ld */
drwxr-xr-x 4 raghu raghu 4096 2012-09-27 23:50 Desktop/
drwxr-xr-x 13 raghu raghu 4096 2012-09-16 13:22 Documents/
drwxr-xr-x 5 raghu raghu 4096 2012-09-28 15:01 Downloads/
drwxr-xr-x 2 raghu raghu 4096 2012-03-27 10:48 jvm/
drwxr-xr-x 2 raghu raghu 4096 2011-10-29 13:02 looped/
drwxr-xr-x 2 root root 4096 2011-11-15 01:23 mounts/
drwxr-xr-x 2 raghu raghu 4096 2011-10-26 16:03 Music/
drwxr-xr-x 12 raghu raghu 4096 2012-01-24 19:29 netbeans-6.9/
drwxr-xr-x 3 raghu raghu 4096 2012-04-17 12:23 orb.db/
drwxr-xr-x 4 raghu raghu 4096 2011-11-16 13:03 PacketTracer5/
drwxr-xr-x 5 raghu raghu 4096 2012-07-16 11:41 Pictures/
drwxr-xr-x 2 raghu raghu 4096 2011-10-26 16:03 Public/
drwxr-xr-x 2 raghu raghu 4096 2011-10-26 16:03 Templates/
drwxrwxr-x 2 raghu raghu 4096 2011-10-26 19:42 Ubuntu One/
drwxr-xr-x 2 raghu raghu 4096 2012-06-15 18:36 Videos/
drwxr-xr-x 7 raghu raghu 4096 2012-09-13 00:52 VirtualBox VMs/
drwxr-xr-x 2 raghu raghu 4096 2012-01-17 17:46 Virus/

Using -F option and grep

The -F options appends a trailing forward slash. So we can ‘grep’ the directories only by ‘grep’ing lines ending with a forward slash (/).
$ ls -lF | grep \/$
drwxr-xr-x 4 raghu raghu 4096 2012-09-27 23:50 Desktop/
drwxr-xr-x 13 raghu raghu 4096 2012-09-16 13:22 Documents/
drwxr-xr-x 5 raghu raghu 4096 2012-09-28 15:01 Downloads/
drwxr-xr-x 2 raghu raghu 4096 2012-03-27 10:48 jvm/
drwxr-xr-x 2 raghu raghu 4096 2011-10-29 13:02 looped/
drwxr-xr-x 2 root root 4096 2011-11-15 01:23 mounts/
drwxr-xr-x 2 raghu raghu 4096 2011-10-26 16:03 Music/
drwxr-xr-x 12 raghu raghu 4096 2012-01-24 19:29 netbeans-6.9/
drwxr-xr-x 3 raghu raghu 4096 2012-04-17 12:23 orb.db/
drwxr-xr-x 4 raghu raghu 4096 2011-11-16 13:03 PacketTracer5/
drwxr-xr-x 5 raghu raghu 4096 2012-07-16 11:41 Pictures/
drwxr-xr-x 2 raghu raghu 4096 2011-10-26 16:03 Public/
drwxr-xr-x 2 raghu raghu 4096 2011-10-26 16:03 Templates/
drwxrwxr-x 2 raghu raghu 4096 2011-10-26 19:42 Ubuntu One/
drwxr-xr-x 2 raghu raghu 4096 2012-06-15 18:36 Videos/
drwxr-xr-x 7 raghu raghu 4096 2012-09-13 00:52 VirtualBox VMs/
drwxr-xr-x 2 raghu raghu 4096 2012-01-17 17:46 Virus/
or for just the directory names, without -l option,
$ ls -F | grep \/$
Desktop/
Documents/
Downloads/
jvm/
looped/
mounts/
Music/
netbeans-6.9/
orb.db/
PacketTracer5/
Pictures/

Using -l option and grep

In long listing of ls i.e. “ls -l”, we can ‘grep’ the lines starting with ‘d’.
$ ls -l | grep ^d
drwxr-xr-x 4 raghu raghu 4096 2012-09-27 23:50 Desktop
drwxr-xr-x 13 raghu raghu 4096 2012-09-16 13:22 Documents
drwxr-xr-x 5 raghu raghu 4096 2012-09-28 15:01 Downloads
drwxr-xr-x 2 raghu raghu 4096 2012-03-27 10:48 jvm
drwxr-xr-x 2 raghu raghu 4096 2011-10-29 13:02 looped
drwxr-xr-x 2 root root 4096 2011-11-15 01:23 mounts
drwxr-xr-x 2 raghu raghu 4096 2011-10-26 16:03 Music
drwxr-xr-x 12 raghu raghu 4096 2012-01-24 19:29 netbeans-6.9
drwxr-xr-x 3 raghu raghu 4096 2012-04-17 12:23 orb.db
drwxr-xr-x 4 raghu raghu 4096 2011-11-16 13:03 PacketTracer5
drwxr-xr-x 5 raghu raghu 4096 2012-07-16 11:41 Pictures
We can extract just the file names by printing only the last columns.
$ ls -l | grep ^d | awk ‘{print $8,$9}’
Desktop
Documents
Downloads
jvm
looped
mounts
Music
netbeans-6.9
orb.db
PacketTracer5
Pictures

Using echo command

We can use echo command to list the entries trailing with forward slash (/).
$ echo */
Desktop/ Documents/ Downloads/ jvm/ looped/ mounts/ Music/ netbeans-6.9/ orb.db/ PacketTracer5/ Pictures/

Using printf

Similarly, printf can be used to highlight strings ending with forward slash (/).
$ printf ‘%s\n’ */
Desktop/
Documents/
Downloads/
jvm/
looped/
mounts/
Music/
netbeans-6.9/
orb.db/
PacketTracer5/
Pictures/

Using find command

We can always find files based on their file types using ‘find’ command:
$ find . -maxdepth 1 -type d
.
./.netbeans-registration
./.gvfs
./.shotwell
./.gegl-0.0
./.cache
./.ssh
./VirtualBox VMs
./.mission-control
./.gnome2
./.jedit
./.config
./mounts
./.gconf
./Desktop
./Documents
./.dbus
./Templates
./Virus
./Videos
./.Skype
./.tsclient
./.macromedia
./.purple
./PacketTracer5
./Public
./.nautilus
./.icons
./Downloads
./Pictures
The maxdepth option in the above command specifies that the search is to be performed in specified directory only. Otherwise, find command will find the directories recursively, by traversing each directory and their subdirectories. Also, in this command, the hidden directories are also shown. In all above methods that use ls command, the same can be achieved through -a option. For example,
$ ls -laF | grep \/$
drwxr-xr-x 60 raghu raghu 4096 2012-09-28 20:18 ./
drwxr-xr-x. 6 root root 4096 2012-06-25 01:08 ../
drwx—— 3 raghu raghu 4096 2011-10-29 14:04 .adobe/
drwx—— 28 raghu raghu 4096 2012-09-28 20:07 .cache/
drwx—— 3 raghu raghu 4096 2011-10-26 16:06 .compiz/
drwxr-xr-x 26 raghu raghu 4096 2012-09-27 00:20 .config/
drwx—— 3 raghu raghu 4096 2011-10-26 16:03 .dbus/
drwxr-xr-x 4 raghu raghu 4096 2012-09-27 23:50 Desktop/
drwxr-xr-x 13 raghu raghu 4096 2012-09-16 13:22 Documents/
drwxr-xr-x 5 raghu raghu 4096 2012-09-28 15:01 Downloads/
drwxr-xr-x 7 raghu raghu 4096 2012-09-15 23:21 .drpython/
drwxr-xr-x 2 raghu raghu 4096 2012-09-10 14:28 .fontconfig/
drwx—— 5 raghu raghu 4096 2012-09-28 20:07 .gconf/
drwx—— 2 raghu raghu 4096 2012-09-28 23:10 .gconfd/
drwx—— 4 raghu raghu 4096 2011-11-26 20:23 .gegl-0.0/
drwxr-xr-x 22 raghu raghu 4096 2012-09-27 01:44 .gimp-2.6/
drwx—— 11 raghu raghu 4096 2012-09-22 05:23 .gnome2/
drwx—— 2 raghu raghu 4096 2011-10-26 18:16 .gnome2_private/
drwxr-xr-x 2 raghu raghu 4096 2012-09-23 19:45 .gstreamer-0.10/
dr-x—— 2 raghu raghu 0 2012-09-28 20:07 .gvfs/
drwxr-xr-x 5 raghu raghu 4096 2012-03-09 10:12 .icedtea/
drwxr-xr-x 2 raghu raghu 4096 2011-10-26 19:10 .icons/
drwxr-xr-x 9 raghu raghu 4096 2012-09-16 13:28 .jedit/
drwxr-xr-x 2 raghu raghu 4096 2012-03-27 10:48 jvm/
drwxr-xr-x 3 raghu raghu 4096 2011-10-29 14:25 .libreoffice/
drwxr-xr-x 3 raghu raghu 4096 2011-10-26 16:03 .local/
drwxr-xr-x 2 raghu raghu 4096 2011-10-29 13:02 looped/
drwx—— 3 raghu raghu 4096 2011-10-29 14:04 .macromedia/
drwx—— 3 raghu raghu 4096 2011-11-15 01:08 .mission-control/
drwxr-xr-x 2 root root 4096 2011-11-15 01:23 mounts/
drwx—— 4 raghu raghu 4096 2011-10-26 18:22 .mozilla/
drwxr-xr-x 2 raghu raghu 4096 2011-10-26 16:03 Music/
drwxr-xr-x 2 raghu raghu 4096 2011-10-26 16:03 .nautilus/
drwxr-xr-x 7 raghu raghu 4096 2012-01-24 19:31 .nbi/
drwxr-xr-x 3 raghu raghu 4096 2012-01-24 20:13 .netbeans/
drwxr-xr-x 12 raghu raghu 4096 2012-01-24 19:29 netbeans-6.9/
drwxr-xr-x 3 raghu raghu 4096 2012-01-24 19:29 .netbeans-registration/
drwxr-xr-x 3 raghu raghu 4096 2012-04-17 12:23 orb.db/
drwxr-xr-x 4 raghu raghu 4096 2011-11-16 13:03 PacketTracer5/
drwxr-xr-x 5 raghu raghu 4096 2012-07-16 11:41 Pictures/
or
$ ls -la | grep ^d
drwxr-xr-x 60 raghu raghu 4096 2012-09-28 20:18 .
drwxr-xr-x. 6 root root 4096 2012-06-25 01:08 ..
drwx—— 3 raghu raghu 4096 2011-10-29 14:04 .adobe
drwx—— 28 raghu raghu 4096 2012-09-28 20:07 .cache
drwx—— 3 raghu raghu 4096 2011-10-26 16:06 .compiz
drwxr-xr-x 26 raghu raghu 4096 2012-09-27 00:20 .config
drwx—— 3 raghu raghu 4096 2011-10-26 16:03 .dbus
drwxr-xr-x 4 raghu raghu 4096 2012-09-27 23:50 Desktop
drwxr-xr-x 13 raghu raghu 4096 2012-09-16 13:22 Documents
drwxr-xr-x 5 raghu raghu 4096 2012-09-28 15:01 Downloads
drwxr-xr-x 7 raghu raghu 4096 2012-09-15 23:21 .drpython
drwxr-xr-x 2 raghu raghu 4096 2012-09-10 14:28 .fontconfig
drwx—— 5 raghu raghu 4096 2012-09-28 20:07 .gconf
drwx—— 2 raghu raghu 4096 2012-09-28 23:10 .gconfd
drwx—— 4 raghu raghu 4096 2011-11-26 20:23 .gegl-0.0
drwxr-xr-x 22 raghu raghu 4096 2012-09-27 01:44 .gimp-2.6
drwx—— 11 raghu raghu 4096 2012-09-22 05:23 .gnome2
drwx—— 2 raghu raghu 4096 2011-10-26 18:16 .gnome2_private
drwxr-xr-x 2 raghu raghu 4096 2012-09-23 19:45 .gstreamer-0.10
dr-x—— 2 raghu raghu 0 2012-09-28 20:07 .gvfs
drwxr-xr-x 5 raghu raghu 4096 2012-03-09 10:12 .icedtea

Best Difference Between Linux Grub and Grub2 Bootloader


Here, in this article I am going to provide some understanding of Linux boot loader known as GRUB. If you have understanding of working pattern of GRUB then it can help you to know how the operating system exactly works. Even it will help you to fix and recover many Linux starting problems. If you really want to gain confidence in working of Linux then you should master the GRUB boot loader. It is very important step. GRUB can easily work with DOS, Windows, Linux or any BSD operating system. GRUB means Grand Unified Boot loader.If someone asks me which am the most frightening thing of Linux then I would say boot loader. Main reason for this is because most of the Linux users have used Windows operating system in their life. In windows, they have not bothered to know more about boot loaders. Even, sometimes they use only Recovery Console to solve their problems. So, they have never got a chance to learn more about this small software called boot loader.
This boot loader can be configured dynamically. This means that user has an option to make changes while booting. Even users can also easily alter the current boot entries, they can add new entries, select multiple kernels or even they can modify initrd. GRUB has also got a support of Logical Block Address. GRUB can be installed and executed from any type of device like hard disk, CD and USB. GRUB and GRUB2 are two different versions.
GRUB2 is considered as default boot loader of Ubuntu whereas GRUB is generally used in RHEL. When started, GRUB2 mainly presents a menu and waits for some input from users. It generally transfers control to our operating system kernel. GRUB2 is mainly designed to provide flexibility and performance to today’s operating systems.

Features and Comparisons between GRUB and GRUB2

The default menu which is looking very similar to GRUB but there are some changes made in this.
1. In today’s new installation of Ubuntu 9.10 or later versions, GRUB2 will now directly show a login prompt and no menu is displayed now.
2. If you want to see the menu during boot you need to hold down SHIFT key. Even sometimes by pressing ESC you can also display the menu.
3. Now, the new configuration file is /boot/grub/grub.cfg. There is no file called /boot/grub/menu.lst now. This main configuration file contains different types of scripts and it is not allowed to edit this file directly.
4. Users have also now choice of creating custom files in which they can place their own menu entries. You can make use of a file called 40_custom which is available in /etc/grub.d folder.
5. Even users can now change the menu display settings. This is done through a file called grub located in /etc/default folder.
6. In today’s GRUB, numbering of partitioning has totally changed. The first partition is now considered as 1 instead of 0. The first device is still identified with hd0. These changes can be altered if needed by making some changes to device.map file of the /etc/grub folder.