Skip to main content

Linux commands

1. netstat --listen

To check which ports are in listening in Linux Server


2.lsof

lsof means List of file, we can know which file is opened by which process.



3.systemctl status

To check status of the service



4. ps -ef | grep httpd

To check process

5. top

By this top command to determine which processes are running and how much memory and CPU they are consuming.

6.df

   df stands for display free disk space we can use df command to troubleshoot disk space issues.


7.df -h 
This command show free space on mounted file systems.
   

8.fdisk -l
 fdisk -I command show disks partitions sizes and types.


9.free - h

free command gives you a summary of the memory usage with our computer. It does this for both the main Random Access Memory (RAM) and swap memory also.

10. kill
kill command allows you to terminate a process from the command line.


11. ping google.com

ping command lets  verify that you have network connectivity with another network device. 


12. find command by using this you can find the file if you forgot where you place

13.How to change file permissions?
Here we have file1 file permission of this file is taken by
Permission numbers are:

0 = ---
1 = --x
2 = -w-
3 = -wx
4 = r-
5 = r-x
6 = rw-
7 = rwx

file1 permission is 644
Now i am going to change file permission for this file1


so now our file1 permission is 755 after using chmod 755 file1

Comments

Post a Comment

Popular posts from this blog

How to copy files from one server to another server by using ansible copy module

 We have two servers 1.master 2.worker1 create playbook example: play.yml ---   - hosts: all     tasks:     - name: Ansible copy file to remote server       copy:        src: ~/kube-cluster        dest: /root Run ansible playbook  ansible-playbook play.yml

Kubernetes interview questions and answers

1.H ow to setup kubernetes dashboard on ubuntu16.04 cluster? To create kubernetes dashboard follow below link https://docs.aws.amazon.com/eks/latest/userguide/dashboard-tutorial.html To deploy the Metrics Server kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml kubectl get deployment metrics-server -n kube-system Deploy the dashboard kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml root@ip-172-31-43-76:~# kubectl get svc -n kubernetes-dashboard NAME                        TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)         AGE dashboard-metrics-scraper   ClusterIP   10.102.6.123   <none>        8000/TCP        120m kubernetes-dashboard  ...

Docker with jenkins troubleshooting

1.When a docker machine is integrated with jenkins after running a build it shows unstable for that how you can make trouble shoot? To avoid these permission issues run the following command sudo chmod 666 /var/run/docker.sock 2.What is docker? Docker it is a tool designed to make it easier to create, deploy, and run applications by using containers. 3.What is docker file? A Dockerfile is a text document it contains all the commands a user could call on the command line to assemble an image.  4.what is docker image? Docker images are executable packages that include everything needed to run an application — the code, a runtime, libraries, environment variables, and configuration files. 5.what is container? container it is nothing but a running state of image 6.Docker commands