I want to be able to use the terminal properly with GitHub but I have only used it once in a meetup (codebar in Birmingham) and it was very useful, but quite a whistle stop tour. I'm going to get my head around terminal and then learn how to use it with GitHub. I found the following at macworld.com, macpaw.com and git-tower.com
- To list the directory you're in
ls
- To show where you currently are (stands for print working directory)
pwd
- To go to your home folder
cd
- To go from the home folder to another one (desktop for instance, type
cd Documents
or
cd Desktop/thefoldername
- To go to the directory above the one you're currently in
cd ..
- To go back to the directory you were in before
cd -
- "~". This sign stands for your user account's home folder. So, instead of typing something like
cd /Users/your-username/projects/
You should use this shorthand form
cd ~/Desktop
-To make a new folder, you call the "make directory" command
mkdir nameofnewfolder
To delete a folder you type rm -r then the file path e.g.
rm -r ~/downloads/nameofthefolder
(the -r stands for recursive)
- To go to the root level of your startup disk. Don't fiddle around with this though unless you know what you're doing.
cd /,
Type bc to get a calculator working!
Vocab:
relative path = is path relative to the directory you're currently in - jumping from one to next
absolute path = is the path relative to the root -giving the whole address thing
Top comments (6)
Great summary of the most used commands!
How are you finding the new career so far?
Thank you! I hope they’re all right?!
Not in the new one yet. I’ve applied to bootcamp and have got to the second round. Keeping fingers crossed!
How are you?
They are all good! Another really useful command is the
man
command.man
is short for manual, it gives the full docs and how to use every (native) terminal command.Eg:
man mkdir
Things are busy as ever haha, what’s next on your list of learning then?
Ooh thanks I’ll have to try it out! Well I set up my own github site so I might go through the HTML & continue css on codecademy and at the same time use it to make stuff on that. And then JavaScript with watch and code. Got into the second round of bootcamp, hooray!
Sounds awesome! Let me know if you need help with anything or want a mini code review or something 🤷♀️
Ah that’d be good! Thank you!