Linux - Useful Commands for Linux Newbies - lsblk , cal , date



To list all the Block devices with their Mount points

#lsblk

The “lsblk” stands for (List Block Devices)

It lists  block devices by their assigned name in a tree-like fashion.


Example output

# lsblk

NAME                          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                             8:0    0  1.1T  0 disk
├─sda1                          8:1    0  200M  0 part /boot
├─sda2                          8:2    0   16G  0 part
│ └─VGswap-LVswap (dm-0)      253:0    0   16G  0 lvm  [SWAP]
└─sda3                          8:3    0  1.1T  0 part
  ├─VGdata-rootdir (dm-1)     253:1    0   17G  0 lvm  /
  ├─VGdata-usr6 (dm-2)        253:2    0   40G  0 lvm  /usr6
  ├─VGdata-usr7 (dm-3)        253:3    0   40G  0 lvm  /usr7
  ├─VGdata-usr4 (dm-4)        253:4    0   40G  0 lvm  /usr4
  ├─VGdata-usr5 (dm-5)        253:5    0   40G  0 lvm  /usr5
  ├─VGdata-usr2 (dm-6)        253:6    0   40G  0 lvm  /usr2
  ├─VGdata-usr3 (dm-7)        253:7    0   40G  0 lvm  /usr3
  ├─VGdata-usr1 (dm-8)        253:8    0   40G  0 lvm  /usr1
  ├─VGdata-home (dm-9)        253:9    0   20G  0 lvm  /home
  ├─VGdata-tmp (dm-10)        253:10   0   10G  0 lvm  /tmp
  ├─VGdata-tmpfs (dm-11)      253:11   0   10G  0 lvm  /tmpfs
  ├─VGdata-apps (dm-12)       253:12   0   25G  0 lvm  /apps
  ├─VGdata-var (dm-13)        253:13   0   10G  0 lvm  /var
  ├─VGdata-datadump (dm-14)   253:14   0  106G  0 lvm  /datadump
  ├─VGdata-coldbackup (dm-15) 253:15   0  197G  0 lvm  /coldbackup
  ├─VGdata-undo (dm-16)       253:16   0   30G  0 lvm  /undo
  ├─VGdata-index2 (dm-17)     253:17   0   40G  0 lvm  /index2
  ├─VGdata-index3 (dm-18)     253:18   0   40G  0 lvm  /index3
  ├─VGdata-index1 (dm-19)     253:19   0   40G  0 lvm  /index1
  ├─VGdata-arch (dm-20)       253:20   0  119G  0 lvm  /arch
  ├─VGdata-index4 (dm-21)     253:21   0   40G  0 lvm  /index4
  ├─VGdata-temp (dm-22)       253:22   0   30G  0 lvm  /temp
  ├─VGdata-redo5 (dm-23)      253:23   0 1008M  0 lvm  /redo5
  ├─VGdata-redo4 (dm-24)      253:24   0 1008M  0 lvm  /redo4
  ├─VGdata-redo1 (dm-25)      253:25   0 1008M  0 lvm  /redo1
  ├─VGdata-redo3 (dm-26)      253:26   0 1008M  0 lvm  /redo3
  └─VGdata-redo2 (dm-27)      253:27   0 1008M  0 lvm  /redo2
sr0                            11:0    1 1024M  0 rom


-----

The “cal” (Calendar), it is used to displays calendar of the present month or any other month of any year that is advancing or passed.

# cal

# cal
    February 2016
Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29
Calender of February 1971

# cal 02 1971

    February 1971
Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28
Calender of February 2050

# cal 02 2050
    February 2050
Su Mo Tu We Th Fr Sa
       1  2  3  4  5
 6  7  8  9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28
--------------------


The “date” (Date) command print the current date and time on the standard output, and can further be set.

# date
Wed Feb 24 13:16:54 IST 2016
To set the date

# date --set='24 feb 2016 13:14'

Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post