Type ls to terminal to list files in current directory

Beginner terminal commands

Ever since I have started using Github more, I have started using few terminal commands regularly.

If you are a beginner, these terminal commands might be useful to you too.

Browsing through files

cd stands for change directory

When you want to work with a certain directory, you need to find it with your terminal. This means that you need to know a location of that specific file.

  1. Type cd (=change directory) to terminal.
  2. Write the path to the directory after cd

How to make sure that you are in the right folder?

Easy, type ls to terminal and you see a list of the files in the current directory.

Type ls to terminal to list files in current directory

What if I accidentally went to a wrong directory?

Type cd to change directory. Then after cd type ../ if you want to go one step backwards in your path. Type cd ../../ if you want to go two steps backward, cd ../../../ goest three steps and so on.

How to go one step backwards in files with terminal

Github commands

These are usually my steps when I push changes to Github. I’m working on my project alone so I push straight to master. This page helped me to understand the basics of git: git- the simple quide

  1. git status = Ask for a status of the current directory. You get a list of files that have been changed.
  2. git add filename.html = Add a file that you want to add to be committed.
  3. git add . = Add all files that have been changes.
  4. git commit -m “my message here” = Commit changes -m stand for a message that is linked to your commit
  5. git push origin master = push changes to master and see your changes in Github