Balaji Vajjala's Blog

A DevOps Blog from Trenches

11

  • Commands
    • Git
    • SSH
    • Linux

Commands

Git

  1. Clone a Git repository.

    “` $ git clone git@github.com:student29/continuous_integration_example.git

    “`

  2. Add a file.

    “` $ git add readme.txt

    “`

  3. Commit a file.

    “` $ git commit -m “added readme file” readme.txt

    “`

  4. Push a file up to the Git master.

    “` $ git push

    “`

SSH

  1. SSH into an EC2 instance.

    “` $ ssh -i cd29.pem ec2-user@ec2-23-22-209-222.compute-1.amazonaws.com

    “`

Linux

  1. List files in a directory.

    “` $ ls -las

    “`

  2. Change permissions on a private key file.

    “` $ chmod 400 cd29.pem

    “`

  3. Open a file in vim.

    “` $ sudo vim filename.txt

    “`

  4. Close a file in vim without saving.

    “` $ :q!

    “`

  5. Save and close a file in vim.

    “` $ :wq!

    “`