Tuesday, April 23, 2019

lsblk Linux Command | Detail of lsblk Linux Command | lsblk details



This post is divided into three parts.
  •  Default command and default output of lsbkl linux command 
  • Options for lsblk Linux command 
  • Available columns for output of lsblk Linux command


Default command and Default out put of lsblk linux command:
  •  [appsdba@reyaz Desktop]$ lsblk 

linux command lsblk
Default output of lsblk



Options for lsblk Linux command:



Options:
 -a,                          --all                        print all devices
 -b,                         --bytes                    print SIZE in bytes rather than in human readable format
 -d,                         --nodeps                 don't print slaves or holders
 -D,                         --discard                print discard capabilities
 -e,                         --exclude <list>      exclude devices by major number (default: RAM disks)
 -I,                           --include <list>     show only devices with specified major numbers
 -f,                          --fs                         output info about filesystems
 -h,                         --help                      usage information (this)
 -i,                           --ascii                    use ascii characters only
 -m,                        --perms                  output info about permissions
 -l,                           --list                      use list format output
 -n,                         --noheadings          don't print headings
 -o,                         --output <list>        output columns
 -p,                         --paths                    print complate device path
 -P,                         --pairs                     use key="value" output format
 -r,                          --raw                      use raw output format
 -s,                          --inverse               inverse dependencies
 -t,                          --topology             output info about topology
 -S,                          --scsi                    output info about SCSI devices

 -h,                         --help                    display this help and exit
 -V,                         --version               output version information and exit



Available columns for output of lsblk Linux command:

NAME   device name
KNAME  internal kernel device name
MAJ:MIN   major:minor device number
FSTYPE   filesystem type
MOUNTPOINT  where the device is mounted
LABEL  filesystem LABEL
UUID  filesystem UUID
PARTLABEL   partition LABEL
PARTUUID  partition UUID
RA   read-ahead of the device
RO  read-only device
RM   removable device
MODEL device identifier
SERIAL   disk serial number
SIZE   size of the device
STATE  state of the device
OWNER  user name
GROUP  group name
MODE  device node permissions
ALIGNMENT alignment offset
MIN-IO   minimum I/O size
OPT-IO optimal I/O size
PHY-SEC  physical sector size
LOG-SEC logical sector size
ROTA  rotational device
SCHED  I/O scheduler name
RQ-SIZE   request queue size
TYPE   device type
DISC-ALN  discard alignment offset
DISC-GRAN   discard granularity
DISC-MAX   discard max bytes
DISC-ZERO  discard zeroes data
WSAME   write same max bytes
WWN   unique storage identifier
RAND adds randomness
PKNAME  internal parent kernel device name
HCTL  Host:Channel:Target:Lun for SCSI
TRAN   device transport type
REV  device revision
VENDOR   device vendor




For more details use lsblk -help

 

You can find me on Fiverr & LinkedIn 




Monday, February 18, 2019

rhcsa | user and group management


Objective of this part:
  • What is a group? 
  • Group management 
  • User management 
  • How to assign password to users? 
  • How to force user to change password on next logon?




rhcsa | user and group management
What is group?
 
We can say a group is a collection of users. Users are collected together with a name and the name is group. Group is actually for giving some specific permission.
Let us consider a group name “dba” and in this group we have some users like oracle, user1, user2 etc.

This group dba can give some permission to users and this is the concept of group. Hope you clear. If anything else then please feel free to comment below


 



rhcsa | user and group management
Group Management


          We have a group file and location of this group file is following below…
          [root@reyaz ~]# cd /etc/
          [root@reyaz etc]# ls -l group
          -rw-rw-r-- 1 appsdba dba 1008 Feb 11 12:02 group

linux group management




To open this group file and to see all group in this file please use this below command

[root@reyaz etc]# cat group

linux command


From above picture we see a group named “dba” and there are 2 user “appsdba” and “oracle”. Please note that there is a number 1002 and it a group ID of “dba


 
Groups add:

                Now we will create a group and for this I will use the linux command “groupadd”

    [root@reyaz etc]# groupadd test1

    [root@reyaz etc]# groupadd test2

linux command groupadd

after creating group you can check them by using the previous command .Given below again.
  [root@reyaz etc]# cat group
linux command to check group list



Groups delete:

                Now we will delete a group and for this I will use the linux command “groupadel”

    [root@reyaz etc]# groupdel test1
    [root@reyaz etc]# groupdel test2

linux command groupdel


rhcsa | user and group management 
User Management:

               
 At first we will see all the users are present in this system and their storage  location.

[root@reyaz ~]# cd /etc/
[root@reyaz etc]# cat passwd
 

linux command to check user list
 


Create User
                We can create a user by using below command
                 [root@reyaz etc]# useradd user10

                But we can create a user with some attribute also. See below
                 [root@reyaz etc]# useradd -u6001 -d /home/user10 -s /bin/bash user10
                          

linux command create user

 After creating user with some attribute you can check by using this command
                        [root@reyaz etc]# cat passwd
 
linux command to check user



User lock:

                To lock a user use below command
                [root@reyaz ~]# usermod -L user1
linux command user lock -L 




 And to unlock a user please use below command
[root@reyaz ~]# usermod -U user1

linux command -U to unlock user


rhcsa | user and group management 
How to assign password to users?

 To assign a password you have to use the linux command "passwd username"
After that system will ask you to type a new password. then again you have to write your new password. Remember one thing, you can not see your password while you are typing the password. Finally you will get a successful message.

linux command user password

rhcsa | user and group management 
How to force user to change password on next logon?

linux command to force to change password


Here in this picture "0" (zero) used to force user to change the password at the first login. 


Please comment your opinion and suggestion below.  

 

You can find me on Fiverr & LinkedIn