Essential Docker, Git, and AWS CLI Commands
Essential Docker, Git, and AWS CLI Commands
-------------------------------------------
Docker Commands:
----------------
- docker --version : Check Docker version
- docker pull <image> : Download image from Docker Hub
- docker images : List downloaded images
- docker run -it <image> : Run a container interactively
- docker ps : List running containers
- docker ps -a : List all containers (including stopped)
- docker stop <container_id> : Stop a running container
- docker rm <container_id> : Remove a container
- docker rmi <image_id> : Remove an image
- docker build -t name . : Build image from Dockerfile
- docker exec -it <id> bash : Access running container shell
Git Commands:
-------------
- git --version : Check Git version
- git config --global user.name "Your Name"
- git config --global user.email "you@example.com"
- git init : Initialize a Git repository
- git clone <repo_url> : Clone a repository
- git status : Check file status
- git add <file> : Stage file for commit
- git commit -m "message" : Commit with message
- git push origin main : Push changes to main branch
- git pull origin main : Pull latest changes from remote
- git log : Show commit history
AWS CLI Commands:
-----------------
- aws configure : Set up access key, secret, region
- aws s3 ls : List S3 buckets
- aws s3 cp file.txt s3://bucket-name/ : Upload file to S3
- aws ec2 describe-instances : List EC2 instances
- aws ec2 start-instances --instance-ids <id> : Start instance
- aws ec2 stop-instances --instance-ids <id> : Stop instance
- aws iam list-users : List IAM users
- aws cloudwatch describe-alarms : List CloudWatch alarms
- aws help : Show AWS CLI help
Note:
Make sure AWS CLI is installed and configured using `aws configure` before running commands.