Skip to main content

Posts

Showing posts from December, 2021

shell scripting and important linux questions and answers

 1.echo $0 what it means?     It will show the name of the currently running process Example: prepare test.sh #!/bin/bash echo $0 Then run test.sh after giving permission to chmod 700 test.sh root@ip-172-31-15-196:~# chmod 700 test.sh root@ip-172-31-15-196:~# ./test.sh ./test.sh 2.How to create 100 empty files at a time? touch file-{001..100} 3.What is hardlink and softlink and how it will be work and what is the difference between them? Hard link:  1.If we delete original file our data will be available 2.Inode number of both original file and hard link file both are same 3.Hard links are fast . Soft link: 1.If we delete original file our data will not be available 2.inode of original file and soft link file are different 3.Soft links are slower. 4.soft links can be used for linking directories 5.soft links will work across file systems. 6.File permissions are different. Creating sof link creating a file1.txt [root@ip-172-31-43-210 linux]# echo "ashwika tech" >> file1.

Listout aws ec2 machines.

 1. aws ec2 describe-instances --filters "Name=instance-type,Values=t2.micro" --query "Reservations[].Instances[].InstanceId" 2. aws ec2 describe-instances --filters "Name=instance-type,Values=t2.medium" --query "Reservations[].Instances[].InstanceId" 3.To list out security groups  aws ec2 describe-security-groups --group-ids