Posted: . At: 10:04 PM. This was 7 years ago. Post ID: 4446
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.