Friday 20 December 2013

Linux important commands.

1. Display the utilization of each CPU individually.
$mpstat -P all

2. display the top 10 process which consume CPU.
$ps -eo pcpu,pid,user,args | sort -k 1 -r | head -r

3. display hte memory details.
$cat /proc/meminfo

4. display the memory usage.
$free -m
$vmstat

5 display the number of cpu.
$cat /proc/cpuinfo | grep processor | wc -l
6. display the shared memory parameters.
$ipcs -m

7. display the share memory limits.
$ipcs -lm

8. display the disk activity.
$iostat

9. display the users logged on to the system.
$w

10. display how long the system is running.
$uptime

11. display which shell is using.
$ps -P $$
$echo $SHELL
$echo $$
12. display the awk version.
$awk --version

13. display the page size.
$getconf getsize

14. free the shared memory space.
$ipcs -m     -> it gives the shm id.
$ipcrm <shmid>
$15. memory mapping of the process.
pmap -d pid

16. list all the users.
$cat /etc/passwd

17. display the mounted file system
$cat //proc/mounts

18. to know the swap allocated.
$cat ./proc/swaps

19. display the version of teh kernel.
$cat /proc/version

20 to know whether 32 bit or 64 bit.
$arch
21. to check the available shells.
$cat /etc/shells

No comments:

Post a Comment