Some useful linux command of ubuntu

#For configuring SSL in apache
sudo apt-get install openssl
sudo apt-get install libssl-dev

openssl x509 -outform der -in certificates.pem -out your-cert.crt

#reset commit and commit file again
git reset HEAD~ –soft

#git command for command line
#clone a repository
git clone

#commit all file
git add .
git add -A
git commit -m “some message”

#pull file
git remote add origin
git pull origin master
git pull

#see all local branch
git branch

#fetch a specific remote branch
git fetch origin akash-first-deployment-picture-removed
git checkout akash-first-deployment-picture-removed

#push it to remote repository
git checkout -b akash-dev #if you want to create newbranch
git checkout akash-dev #else

#Change working branch :
git checkout akash-dev
git push -u origin akash-dev

#see all diff
git diff [fileName] or
git diff –cached [fileName] or

git diff –cached

git diff HEAD *

#After conflict
git commit -am ‘Conflicts resolved’

#reverting all to master branch
git fetch origin
git reset –hard origin/master


#remote connect to aws vps
ssh-keygen -t rsa

ssh -i /akash.pem

#add public key to server to ssh login
cat ~/.ssh/ | ssh -i /akash.pem “mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && sudo service ssh restart”

reload ssh

#Add ssh key to github
xclip -sel clip < ~/.ssh/ Add ->profile ->SSH key+name +paste

#add user as super user

How to Add a User and Grant Root Privileges on Ubuntu 14.04

Leave a Reply

Your email address will not be published. Required fields are marked *