Linux and UNIX commands that are very useful.

Posted: August 11, 2017. At: 10:04 PM. This was 3 months ago. Post ID: 4446
Page permalink:

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 

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

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.

  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.

  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.

Login name: flynn                       In real life:  Flynn Taggart
Directory: /home/flynn                  Shell:  /bin/bash

No comments have been made. Use this form to start the conversation :)

Leave a Reply