Labels

Thursday, 16 February 2017

Useful linux commands

Hey guys, Iam going to share with  you good linux Commands i hope it will help you
                                                       
                                      1- top command
This command give you information about

  • The time
  • How long the computer has been running
  • Number of users
  • Load average
  • Total number of tasks
  • Number of running tasks
  • Number of sleeping tasks
  • Number of stopped tasks
  • Number of zombie tasks
  • CPU usage as a percentage by the user
  • CPU usage as a percentage by system
  • CPU usage as a percentage by low priority processes
  • CPU usage as a percentage by idle processes
  • CPU usage as a percentage by io wait
  • CPU usage as a percentage by hardware interrupts
  • CPU usage as a percentage by software interrupts
  • CPU usage as a percentage by steal time 
                                    
                                        2-Linux ps command
The ps command on linux is one of the most basic commands for viewing the processes running on the system. It provides a snapshot of the current processes along with detailed information like user id, cpu usage, memory usage, command name etc. It does not display data in real time like top or htop commands. But even though being simpler in features and output it is still an essential process management/monitoring tool that every linux newbie should know about and learn well.
In this post we are going to revise the basics of using the ps command to check the processes and filter and sort them in different ways to suit better
.
Note on syntax
The ps command comes with an unusual set of 2 syntax styles. That is BSD and UNIX both. New users are often confused with and mis-interpret the two styles. So here is some basic info to get it clear before moving on.
Note : "ps aux" is not the same as "ps -aux". For example "-u" is used to show process of that user. But "u" means show detailed information.
BSD style - The options in bsd style syntax are not preceded with a dash.

                           3-User add command 
When we run ‘useradd‘ command in Linux terminal, it performs following major things:

  1. It edits /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow files for the newly created User account.
  2. Creates and populate a home directory for the new user.
  3. Sets permissions and ownerships to home directory.