Basic Terminal Usage - Cheat Sheet to make the command line EASY
Skills:
Linux & CLI90%
Key Takeaways
Provides a cheat sheet for basic terminal usage and command line navigation
Full Transcript
all right a big part of being a web developer these days is using the terminal uh the terminal is something that creative and visual people kind of avoid uh in a lot of ways because it kind of there's no instruction manual there's no buttons to it and you it it feels like it's hard to wrap your mind around what all the terminal is we're going to break that down to a very low level it's very simple it's just a few basic commands uh to be really comfortable in the terminal so we're going to do that today and this will hopefully really help you out if you need to open it you've never opened it before you're going to go applications uh utilities and then terminal and there it is and I'll drag terminal onto my doc so it's saved there um and here we are at our terminal and by default it's going to open us up to our Tilda directory which is our users's home directory let's get into our first command our first command is LS um and if you're on Windows that's going to be dir for the most part these commands are going to be the same uh but this is really a Mac Linux um tutorial you may have to Google you know what the commands are but the principles are all exactly the same so here we go LS you can see this is my home directory for my user um and so LS is going to show me my list of all the files and the folders the next command we're going to use is CD CD is change directory I can go CD space pictures and LS and you can see this is my pictures directory for my home users I don't really have any pictures just my my photo library and my photo booth Library um and then I can also go CD do dot which is going to go up a level into my previous directory so now I'm back to my user directory uh a hot key that you can do is command K Apple K which clears out your terminal uh which is very useful command um you can see so I'm back to my home directory um you can also go CD forward slash which is going to take me to my root directory which is the same as just going Macintosh h D you can see that's this applications Library System blah blah blah that I'm now at my root directory so I can go back to my user directory or I can go there the long way which is CD space users cmn there we go I'm back at my cmn my home login directory so if I want to go to multiple directories at a time I can go CD space code I know I have a code directory sandbox I have a Sandbox directory test I just went into a up a level to code up a level to sandbox up a level to test I just went into that folder and if I hit LS I have one folder here called another folder so let's go ahead and make another directory here it's mkdir make directory mkdir yet another folder so if I hit LS there we go yet another folder um I'm actually going to open this test folder that I'm in right now so you can see I made yet another folder let's make another one and again there we go and again so now I have three folders in here um if I want to remove a folder I can RM and again oh it's a it's a full directory so I have to use RMR which is recursive and again there we go so if I want to actually remove a file I can just use RM for remove um or I can use RM R which will remove recursively anything inside of that entire directory so we're almost out of commands I know you're probably freaking out that this is all the terminal is it's LS it's CD it's make directory and it's RM that's pretty much it I'll get to show you a couple cool commands here but let's do one more and that is touch that will create a file for me so I touched index.html why put it under there I have no idea so I touched index.html that made a blank file called index.html I can open index.html and it will open it in whatever my default program for that is which in this case is Chrome so I get an empty page I can open index.html and if I do- a and then in these quotes I can put a program name it does it is case sensitive so I can't do lowercase Sublime Text I have to do uppercase Sublime upper case text and there we go here's my index.html so I can just kind of go I'm a web page save it close it so now if I open index HTML I'm a web page there we go um and I can also open it up in Sublime Text again and there it is I can edit it and save it this is actually pretty convenient uh I I'm using all the time now open commands from the command line because it's really conven vent uh one thing you'll notice I'm doing is when I hit the up and down arrows it goes through all my previous commands another thing that's very very very useful uh because lots of times you'll just want to do a command over and over and over again and it's a lot easier to hit up um another thing you can do is open Dot that's going to open my current folder that I'm in which is test so if I hit open Dot it's going to open it in finder which is the default so let me show you again open Dot opens finder if you're ever in the com the command line and there's just something you want to do that's more convenient for you in in finder like say rename this yet another folders you know sometimes that's just easier for you to do in finder uh if you're not comfortable with a command line and you just want to open Dot I can also open Dot with application Sublime Text and that's going to take me to my whole folder you know so I got my whole folder viw now in Sublime Text very very useful I can do that in any other program I want um and so that's a great command gosh we're almost out of basic command line commands uh pretty much the only other thing that we're going to want to do let's see we've done RM so let me list I will open Dots so we can see this happen in action so I can RM index.html let's delete it there we go I can rm- R my yet another folder uh whoops it's just called yet it's yet another folder Z I renamed it and if you want to rename things let me touch index.html again there it's back so what I can do is I can rename it that's MV it's called it's for move uh but move is actually how you rename it I'm going to rename index.html to index 2html there we go it just got renamed I can rename another folder this folder there we go it just got renamed so the MV is your rename that's kind of counterintuitive to a lot of people but you're really not renaming the file you're moving the file to a different location uh as far as the command lines concerned you're moving it to a different URL or path so to speak uh so that's pretty much that I'll show you one more cool trick and we'll be done with this is at any point in time you can hit tab to autocomplete so if I wanted to open in if I just hit I in and hit tab it's going to autocomplete that for me ah that saves so many typos especially if you have complex file names so if I go open in index 2html there we go it opened it if I go open I can't do it on uh program names unfortunately uh but I was able to autocomplete that for there and then I can also open this I can just hit tab this folder a there we go this folder is now open in Sublime Text so that's pretty much the commands CD you can go cd/ to go to your root directory you can go cd/ Tilda to go to your user directory LS is going to show you your file names mkd iir and these will all be in the description uh as your cheat sheet make directory rename a file or should I say move a file um and remove a file uh which you have to do SLR for directories that's your intro to the terminal do it play around use some commands have fun and know that you don't have to be afraid of the terminal anymore thanks have a great day
Original Description
Freak out no more...here's how to use the terminal/command line! Using the terminal is EASY, and more importantly, it's a HUGE part of being a web developer these days. If you avoid the terminal, it will only hold you back. This tutorial will teach you how to use the command line in a few easy steps. You'll be comfortable in no time.
ls - list files
cd {directory name} - change directory
cd / - go to root (top) directory
cd ~ - go to user home directory
cd .. - go up a level
mkdir {file name} - make a directory
touch {filename} - create an empty file
rm {filename} - remove a file
rm -r {directory name} - remove a directory and all files within
mv {filename} {new filename} - rename a file or folder
open {filename} - open file in default program
open {filename} -a "{program name}" - open file in specific application
open . - open current directory
HOT KEYS
Command+k - clear the terminal screen
Tab - autocomplete (if more than one files match, nothing happens, you will need to add more characters)
Up/Down Arrows - previous commands
-~-~~-~~~-~~-~-
Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device"
https://www.youtube.com/watch?v=fgOO9YUFlGI
-~-~~-~~~-~~-~-
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from LearnCode.academy · LearnCode.academy · 33 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
▶
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Web Development Tutorial for Beginners (#1) - How to build webpages with HTML, CSS, Javascript
LearnCode.academy
Web Development Tutorial for Beginners (#2) - Basic CSS - How to build a website with HTML & CSS
LearnCode.academy
How to create CSS Layouts - Web Development Tutorial for Beginners (#3) - with HTML & CSS
LearnCode.academy
Bootstrap Tutorial For Beginners - Responsive Design with Bootstrap 3 - Responsive HTML, CSS
LearnCode.academy
Angularjs Tutorial for Beginners - learn Angular.js using UI-Router
LearnCode.academy
CSS Tutorial - Web Development Tutorial for Beginners (#5)
LearnCode.academy
Node.js tutorial for beginners - an introduction to Node.js with Express.js
LearnCode.academy
Github Tutorial For Beginners - Github Basics for Mac or Windows & Source Control Basics
LearnCode.academy
Javascript Tutorial - Programming Tutorial for Beginners Pt 1
LearnCode.academy
Javascript Tutorial - jQuery Tutorial for Beginners Pt 2
LearnCode.academy
AngularJS Directives Tutorial - Part 1 - Demystifying Angular Directives
LearnCode.academy
WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice
LearnCode.academy
YEOMAN TUTORIAL - Master Front-End Workflow with Yeoman, Grunt and Bower
LearnCode.academy
BOWER! - Streamline Web Workflow with Bower Package Manager
LearnCode.academy
Chrome DevTools for CSS - Better CSS Coding & CSS Debugging with Developer Tools
LearnCode.academy
GITHUB ATOM - Why Atom.io will be your favorite Text Editor!
LearnCode.academy
GITHUB PULL REQUEST, Branching, Merging & Team Workflow
LearnCode.academy
Pimp that Terminal - Add shortcuts and functions to your .bash_profile to simplify routine tasks
LearnCode.academy
jQuery Tutorial #3 - Writing Smarter, Better Code - jQuery Tutorial for Beginners
LearnCode.academy
jQuery Tutorial #2 - Event Binding - jQuery Tutorial for Beginners
LearnCode.academy
jQuery Tutorial #1 - jQuery Tutorial for Beginners
LearnCode.academy
Node.js MongoDB Tutorial using Mongoose
LearnCode.academy
Node.js tutorial for beginners 2014 - an introduction to Node.js with Express.js
LearnCode.academy
WEB DEVELOPMENT - SECRETS TO STARTING A CAREER in the Web Development Industry
LearnCode.academy
jQuery Tutorial #4 - DOM Traversal with jQuery
LearnCode.academy
jQuery Tutorial #5 - Building a jQuery Tab Panel Widget
LearnCode.academy
jQuery Tutorial #6 - Building a jQuery Image Slider
LearnCode.academy
jQuery Ajax Tutorial #1 - Using AJAX & API's (jQuery Tutorial #7)
LearnCode.academy
jQuery Ajax Tutorial #2 - Posting data to backend (jQuery tutorial #8)
LearnCode.academy
jQuery Ajax Tutorial #3 - Delegating Events & Mustache.js Templating (jQuery tutorial #9)
LearnCode.academy
jQuery Ajax Tutorial #4 - "Edit" modes & Better Mustache.js Templating (jQuery tutorial #9)
LearnCode.academy
How to put your website online - how to FTP to a domain & upload files to a webhost
LearnCode.academy
Basic Terminal Usage - Cheat Sheet to make the command line EASY
LearnCode.academy
SSH Tutorial - Basic server administration with SSH
LearnCode.academy
Vagrant Tutorial - Running a VM For Your Local Development Environment
LearnCode.academy
Sublime Text Favorite Packages and Workflow
LearnCode.academy
What Makes Javascript Weird...and AWESOME - Pt 1
LearnCode.academy
Javascript is Event-Driven - What makes Javascript Weird...and Awesome Pt 2
LearnCode.academy
Javascript Closures Tutorial - What makes Javascript Weird...and Awesome Pt 3
LearnCode.academy
FREE REST API - Practice Developing Javascript AJAX Apps with this API
LearnCode.academy
Javascript Scope Tutorial - What Makes Javascript Weird...and Awesome Pt 4
LearnCode.academy
Javascript Context Tutorial - What makes Javascript Weird...and Awesome Pt5
LearnCode.academy
Nginx Tutorial - Proxy to Express Application, Load Balancer, Static Cache Files
LearnCode.academy
Live Reload Sublime, Chrome, Anything - Fast and easy with Live-Server
LearnCode.academy
Are you bad, good, better or best with Async JS? JS Tutorial: Callbacks, Promises, Generators
LearnCode.academy
Javascript Generators - THEY CHANGE EVERYTHING - ES6 Generators Harmony Generators
LearnCode.academy
Web Development Advice - Interview with Dev Tips
LearnCode.academy
How the Internet Works for Developers - Pt 2 - Servers & Scaling
LearnCode.academy
How the Internet Works for Developers - Pt 1 - Overview & Frontend
LearnCode.academy
HAPROXY vs NGINX - 10,000 requests while killing servers
LearnCode.academy
Node.js Cluster - Boost Node App Performance & Stability with Clustering
LearnCode.academy
Web Dev Training with Treehouse
LearnCode.academy
What is Node.js Exactly? - a beginners introduction to Nodejs
LearnCode.academy
How to deploy node.js applications #1 - spin up a server
LearnCode.academy
Deploying node.js applications #2 - provision server & setup flightplan
LearnCode.academy
Deploying Node.js Applications - Deploy Node the right way - as an Upstart Service
LearnCode.academy
Mobile Web Design - Coding Workflow For Mobile Websites
LearnCode.academy
WHY YOU NEED A BUILD SYSTEM LIKE GRUNT, GULP, BRUNCH FOR YOUR WEBSITE
LearnCode.academy
GRUNT TUTORIAL - Grunt makes your web development better!
LearnCode.academy
STOP USING FTP! - How to Deploy with Flightplan over SSH
LearnCode.academy
More on: Linux & CLI
View skill →Related Reads
📰
📰
📰
📰
Why AI Makes Legacy Modernization More Feasible But Not More Automatic
Forbes Innovation
AI Stack Online Training | New Batch Starts Soon!
Medium · Python
I Started Tracking How Much Time I Spent Correcting AI Output. The Number Changed Everything.
Dev.to · Avery
The Top 5 AI Tools You Can Use Every Day to Save Hours
Medium · ChatGPT
🎓
Tutor Explanation
DeepCamp AI