Friday, 11 September 2020

LINUX - HOW TO DELETE A USER IN LINUX

LINUX - HOW TO DELETE A USER IN LINUX

 

Please find the command to delete a user in linux:-

 Command :- sudo userdel john


LINUX - HOW TO ADD A USER IN LINUX

LINUX - HOW TO ADD A USER IN LINUX

 

Please find the command to add a user in linux:-

 Command :- sudo useradd john

 

In the above example, we have created a user john.

Friday, 26 June 2020

DOCKER - HOW TO REMOVE A DOCKER IMAGE FROM OUR HOST

HOW TO REMOVE A DOCKER IMAGE FROM OUR HOST


In order to remove a docker image from our system:-

run the command :- docker rmi (Name of the Image)

 

  

 

In my example, I have deleted the image - docker/whalesay which I downloaded earlier.

 

Note:- Before deleting an image, please make sure that no container is using that image. 

 

You need to stop and delete all the containers using this image, before deleting this image.

DOCKER - HOW TO SEE A LIST OF IMAGES PRESENT ON THE HOST

HOW TO SEE A LIST OF IMAGES PRESENT ON THE HOST

 

 In order to see the list of all the docker images and their sizes, run the command - docker images

 

 

 

DOCKER - HOW TO REMOVE A CONTAINER PERMERANTLY

HOW TO REMOVE A CONTAINER PERMANENTLY


If we want to remove the docker container permanently, 

run the command - docker rm (Provide the name of the container or ID)


In the below example, we see that we have 2 exited containers


Now we will delete the 2 exited comtainers:- flamboyant_hodgkin and sleepy_swirles

We can verify if the both the containers are deleted, by running 
the command - docker ps -a

DOCKER - HOW TO STOP A RUNNING CONTAINER

HOW TO STOP A RUNNING CONTAINER

 

 If we want to stop the running container running on our system, 

run the command :- docker stop (Provide the container name or container id )

We can get the details of the container by running the command - docker ps -a

 

 

DOCKER - HOW TO SEE RUNNING DOCKER CONTAINERS

HOW TO SEE RUNNING DOCKER CONTAINERS

 

 In order to list all the docker containers, run the command - docker ps


 

Now if we want to see the previous containers which may be stopped or exited, you need

to run the below command:- docker ps -a.  Hence we see that we ran a previous container 

by the name - whalesay.