Jai Srila Prabhupada.
Many times filenames contain numbers of arbitrary length - file1, file2, ..., file9, file10, file11, ..., file19, file20, file21, ... so on. When we run the 'ls' command, the output is sorted based on dictionary order and not in the way shown above.
Use the following command:
ls | sort -V
Note that we are calling 'ls' without any arguments, otherwise it won't work.
Jaya Sathguru Bhagawan Sri Sridhara Swamy Maharaja.
Wednesday, March 16, 2011
Friday, March 4, 2011
Why some Linux distros install to extended partitions
Jaya Srila Prabhupada
Some Linux distros including openSUSE create an extended partition on the hard disk before installing the OS on to it. Also the partition numbering starts from 5 and not from the next available number. For example, if I have one partition on the hard disk namely sda1 and I am installing openSUSE on it, the latter creates an extended partition sda2 and logical partitions starting from sda5 (sda5, sda6, and so on). One may wonder why the logical partitions didn't start from sda3.
The reason is extra convenience that one gets when one needs to add a partition. For example, if another (primary) partition is added to the disk described above, the new partition will be numbered as sda2 and the extended partition that was previously numbered as sda2 becomes sda3. However, and this is the important point, none of the logical partitions need to be renumbered; they still start from sda5. Thus no changes need to be made to the boot loader (e.g. GRUB) and fstab entries in the installation.
Jaya Sathguru Bhagawan Sridhara swami maharaj.
Saturday, February 26, 2011
Live USB
Jaya Srila Prabhupada
Making a live USB stick is simple. Make sure that the USB stick is not mounted before trying this.
dd_rescue /path/to/image.iso /dev/sdX
where /dev/sdX is the actual device. It can be known in openSUSE by running the following command:
ls -l /dev/disk/by-id/*usb*
PS: Unfortunately this method is specific for openSUSE and may not work when creating a USB installer for other distros. Each distro has its own way of creating a USB installer.
Jaya Sathguru Bhagwan Sridhara swamy maharaj.
Saturday, February 19, 2011
Irrational Numbers - another display of Krishna's genius
Jai Srila Prabhupada
Recently something had spurred in me a lot of interest for Math. I came across the concept of irrational numbers. You can create an irrational number in a number of ways. One of which I know is by taking the square-root of a number. There is also a ready to use irrational number - the pi.
Thinking of the pi made me appreciate the creative genius of Lord Krishna. The definition of the pi is: The number that you get when you divide the circumference of a circle by its radius. Fascinating isn't it? Just think of it. Draw a circle. Find its circumference. Then divide it by the circle's radius. And lo; you get a number that's having infinite digits with no repetition. That means you just can't express the pi using pen and paper like you do for other (rational) numbers. What special property that the circumference of a circle has that gives this special number - the pi - the irrational nature? We can only appreciate the genius of Krishna whenever we look at the pi.
Jaya Sathguru Bhagwan Sridhara swamy maharaja.
Saturday, February 12, 2011
Shortcut Keys in Evince
Jai Srila Prabhupada
I found two undocumented shortcut keys in Evince. To expand a node in the page index pane (on the left of the reading pane), highlight the node and press space bar. To collapse the node, press the '/' key in the number pad section of the keyboard.
Jai Sathguru Bhagwan Sridhara Swamy Maharaja.
Saturday, February 5, 2011
finding disk usage using 'grep' and 'du'
Jai Srila Prabhupada.
Today I was trying to find how much disk storage space was being used by files on my system. I used the following command to find disk storage space used:
du -hc / > usage_details.txt
Now I needed to analyze the information captured in the text file that got created in the above step. During my analysis, I did find that knowing the disk usage for a particular folder was easy, as the 'du' tool captures the disk usage folder-wise when used with the -c option as shown above. But, now I wanted to find the disk usage only for the top level folders i.e. /home, /tmp, /var, /usr etc. I resorted to using the 'grep' command in the following way:
grep -v "\/.*\/.*" usage_details.txt
The text within quotes is a back-slash, forward-slash, period, asterix and again the same set of characters. Here 'grep' is called with the -v option which means negation of the match condition - if the text read by 'grep' doesn't match the pattern, then print it to the standard output. That was a pretty nifty feature, eh!
Jai Sathguru Bhagavan Sridhara swamy maharaj.
Saturday, November 20, 2010
Reflections on GRUB 1
I noticed that after installing openSUSE on my hardisk, I was able to boot from either FreeBSD or PC BSD but not both. Of course, I could always boot into openSUSE. I couldn't quite understand it. There were 3 operating systems on my hard disk - FreeBSD, PC BSD and openSUSE. But why was it that whenever I would choose either FreeBSD or PC BSD from the GRUB menu, I would succeed in booting into one of them?
The FreeBSD and PC BSD boot managers had simple functionality and small enough to fit into the MBR. GRUB was more complex. In fact, in Linux world, GRUB is called a boot loader and seldom boot manager. The fact is that GRUB loads in stages. The stage 1 loads first and is tiny enough to fit into the MBR. The subsequent stages of grub (1.5 and 2) load later and are present in the first sector of the respective partition (grub's home partition) or something like that.
Anyway, I need to investigate on that. But, I could solve the above problem by actually going through the installation procedure for GRUB after openSUSE had got installed. That means, GRUB was not previously installed into the MBR! Then how was openSUSE getting loaded. I noticed that the extended partition on which openSUSE was installed was marked active. When I made some other partition active, the GRUB menu was never displayed, so the partition on which GRUB (openSUSE) was installed had to be active for it to load. The fact that GRUB was not in the MBR may also have been the reason for the funny behavior I noted in the first paragraph of this post.
Jaya Sri Sridharasvami Maharaja.
The FreeBSD and PC BSD boot managers had simple functionality and small enough to fit into the MBR. GRUB was more complex. In fact, in Linux world, GRUB is called a boot loader and seldom boot manager. The fact is that GRUB loads in stages. The stage 1 loads first and is tiny enough to fit into the MBR. The subsequent stages of grub (1.5 and 2) load later and are present in the first sector of the respective partition (grub's home partition) or something like that.
Anyway, I need to investigate on that. But, I could solve the above problem by actually going through the installation procedure for GRUB after openSUSE had got installed. That means, GRUB was not previously installed into the MBR! Then how was openSUSE getting loaded. I noticed that the extended partition on which openSUSE was installed was marked active. When I made some other partition active, the GRUB menu was never displayed, so the partition on which GRUB (openSUSE) was installed had to be active for it to load. The fact that GRUB was not in the MBR may also have been the reason for the funny behavior I noted in the first paragraph of this post.
Jaya Sri Sridharasvami Maharaja.
Subscribe to:
Posts (Atom)