Linux and UNIX commands that are very useful.

To view the contents of an ISO  image, the isoinfo command for Linux will come in very useful indeed. Just type isoinfo -f -i myiso.iso to view the contents of the ISO image as shown in this example.

C:\MEDIA\ELEMENTS\FILES\ISOS> isoinfo -f -i linuxmint-11-gnome-dvd-64bit.iso 
/BOOT
/CASPER
/EFI
/ISOLINUX
/MD5SUM.TXT;1
/PRESEED
/_DISK
/BOOT/GRUB
/CASPER/FILESYSTEM.MANIFEST;1
/CASPER/FILESYSTEM.MANIFEST_DESKTOP;1
/CASPER/FILESYSTEM.SIZE;1
/CASPER/FILESYSTEM.SQUASHFS;1
/CASPER/INITRD.LZ;1
/CASPER/VMLINUZ.;1
/EFI/BOOT
/ISOLINUX/BOOT.CAT;1
/ISOLINUX/GFXBOOT.C32;1
/ISOLINUX/ISOLINUX.BIN;1
/ISOLINUX/ISOLINUX.CFG;1
/ISOLINUX/MEMTEST.;1
/ISOLINUX/SPLASH.JPG;1
/ISOLINUX/VESAMENU.C32;1
/PRESEED/CLI.SEED;1
/PRESEED/LTSP.SEED;1
/PRESEED/MINT.SEED;1
/_DISK/BASE_INSTALLABLE.;1
/_DISK/CASPER_UUID_GENERIC.;1
/_DISK/CD_TYPE.;1
/_DISK/INFO.;1
/_DISK/MINT4WIN.;1
/_DISK/RELEASE_NOTES_URL.;1
C:\MEDIA\ELEMENTS\FILES\ISOS>

To shutdown your Linux machine, use the shutdown command, the sudo shutdown -h now command will shutdown the computer right away and it will switch off. Using the sudo shutdown -r now command will re-boot the computer instead.

The readelf command is used to print information about an ELF executable file. In the example below, I used the readelf -h command to print the ELF file header.

C:\HOME\FLYNN\DOCUMENTS> readelf -h echo
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x400410
  Start of program headers:          64 (bytes into file)
  Start of section headers:          4424 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         9
  Size of section headers:           64 (bytes)
  Number of section headers:         30
  Section header string table index: 27
C:\HOME\FLYNN\DOCUMENTS>

The stat command is a nice command that will print information about a file on a file-system and it also can give information about the file-system on which the file resides. In this example, I am checking the properties of a tiny executable file.

C:\HOME\FLYNN\DOCUMENTS> stat echo
  File: `echo'
  Size: 8378      	Blocks: 24         IO Block: 4096   regular file
Device: 802h/2050d	Inode: 540126331   Links: 1
Access: (0775/-rwxrwxr-x)  Uid: ( 1000/   flynn)   Gid: ( 1000/   flynn)
Access: 2012-07-26 11:15:44.061446862 +1000
Modify: 2012-07-26 11:15:32.241446473 +1000
Change: 2012-07-26 11:15:32.241446473 +1000
 Birth: -

And the -f parameter prints information about the file-system, in my case it is XFS.

C:\HOME\FLYNN\DOCUMENTS> stat -f echo
  File: "echo"
    ID: 80200000000 Namelen: 255     Type: xfs
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 89556250   Free: 83588012   Available: 83588012
Inodes: Total: 358400000  Free: 357861534

Use the pinky -l $LOGNAME command if you want to print more information about your user. This is a lightweight version of the finger command.

C:\HOME\FLYNN\DOCUMENTS> pinky -l $LOGNAME
Login name: flynn                       In real life:  Flynn Taggart
Directory: /home/flynn                  Shell:  /bin/bash
About

I am a computer enthusiast that has always been interested in maintaining and upgrading computer hardware. I was born on a farm and lived there for 13 years before moving into town. I was always interested in technology and my father always gave me good encouragement for developing my knowledge and interest in tinkering with computers. He was using a computer on the farm but that was in the very late 80`s and late 90`s. Seeing what a computer could do always fascinated me and then I knew that is what I wanted to do. The first time I used Linux was Red Hat 6.2 installed off a single CDROM and I was amazed that you did not need to install any more drivers on my old Intel Celeron machine to be able to enjoy a nice 24BPP desktop and use the GIMP to edit photos and enjoy playing the old Linux games like Xbill. Then a while later I tried Mandrake Linux 9.2 and I was hooked. It came with so much software and was very easy to use as well. Then Mandrake Linux 10 and on through FreeBSD, Debian 3.0, Debian 3.1 Suse Linux 9.2, Suse 10 and onto the Ubuntu distributions although I am using Fedora Core 15 and the Gnome 3 desktop at the moment.

Tagged with: , , , , ,
Posted in bejiitaswrath

Leave a Reply

close
Facebook Iconfacebook like buttonYouTube IconSubscribe on YouTubeTwitter Icontwitter follow button
Plugin from the creators of Brindes :: More at Plulz Wordpress Plugins