Computer And Technologies

Computer And Technologies: Different Linux command @faced in Interview

Tuesday 18 August 2009

Different Linux command @faced in Interview

>chage :-
chage (1) - change user password expiry information

amaresh@eOdissa-desktop:~$ chage -l amaresh
Last password change : Jul 08, 2009
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7

>seq:-
seq (1) - print a sequence of numbers

amaresh@eOdissa-desktop:~$ seq 1 4
1
2
3
4
amaresh@eOdissa-desktop:~$ seq 1 2 6
1
3
5
amaresh@eOdissa-desktop:~$ seq 6
1
2
3
4
5
6
amaresh@eOdissa-desktop:~$ seq 1 3 9
1
4
7

>vmstat :-
vmstat (8) - Report virtual memory statistics

usage: vmstat [-V] [-n] [delay [count]]
-V prints version.
-n causes the headers not to be reprinted regularly.
-a print inactive/active page stats.
-d prints disk statistics
-D prints disk table
-p prints disk partition statistics
-s prints vm table
-m prints slabinfo
-S unit size
delay is the delay between updates in seconds.
unit size k:1000 K:1024 m:1000000 M:1048576 (default is K)
count is the number of updates.

Q:What command do you use to get the information about disk statistics?
Ans:- vmstat -d

amaresh@eOdissa-desktop:~$ vmstat -d
disk- ------------reads------------ ------------writes----------- -----IO------
total merged sectors ms total merged sectors ms cur sec
ram0 0 0 0 0 0 0 0 0 0 0
ram1 0 0 0 0 0 0 0 0 0 0
ram2 0 0 0 0 0 0 0 0 0 0
ram3 0 0 0 0 0 0 0 0 0 0
ram4 0 0 0 0 0 0 0 0 0 0
ram5 0 0 0 0 0 0 0 0 0 0
ram6 0 0 0 0 0 0 0 0 0 0
ram7 0 0 0 0 0 0 0 0 0 0
ram8 0 0 0 0 0 0 0 0 0 0
ram9 0 0 0 0 0 0 0 0 0 0
ram10 0 0 0 0 0 0 0 0 0 0
ram11 0 0 0 0 0 0 0 0 0 0
ram12 0 0 0 0 0 0 0 0 0 0
ram13 0 0 0 0 0 0 0 0 0 0
ram14 0 0 0 0 0 0 0 0 0 0
ram15 0 0 0 0 0 0 0 0 0 0
sr0 0 0 0 0 0 0 0 0 0 0
sda 129824 12599 1675591 430108 108073 14333 979288 2993424 0 36


Q:What command do you use to get the information about disk table?
Ans:-vmstat -D

amaresh@eOdissa-desktop:~$ vmstat -D
18 disks
5 partitions
129824 total reads
12599 merged reads
1675591 read sectors
430108 milli reading
107383 writes
13450 merged writes
966704 written sectors
2990880 milli writing
0 inprogress IO
366 milli spent IO

Q:What command do you use to get the information about no of forking ?
Ans:- vmstat -f

amaresh@eOdissa-desktop:~$ vmstat -f
11008 forks


>What command do you use to create swap space?

No comments:

Post a Comment