Command Line Basics for Everyday Use

  1. Precision — the command line allows you to fine-tune your actions in ways that simply aren’t possible in general user interfaces.
  2. Portability — if you are using SSH to access a remote machine, for example, your only option will often be to interact with that machine through its command line.
  3. Speed — once you are comfortable interacting with the command line everyday tasks simply take less time.

Common Terms

Anatomy of a Command

$ curl -v --fail --data "foo=bar" http://localhost:3000

Exploring Directories

$ cd foobar
$ cd ..
$ cd ../foobaz
$ ls -altotal 0
drwxr-xr-x@ 9 root wheel 288 Sep 20 21:01 .
drwxr-xr-x 29 root wheel 928 Dec 15 08:21 ..
drwxr-xr-x 971 root wheel 31072 Dec 15 08:19 bin
drwxr-xr-x 304 root wheel 9728 Dec 15 08:19 lib
drwxr-xr-x 248 root wheel 7936 Dec 15 08:19 libexec
drwxr-xr-x 14 root wheel 448 Oct 25 14:03 local
drwxr-xr-x 239 root wheel 7648 Dec 15 08:19 sbin
drwxr-xr-x 46 root wheel 1472 Oct 25 13:56 share
$ less filename.txt

Manipulating Directories and Files

mkdir my_new_directory
rm filename.txt
rm -rf sample_directory
mv filename.txt ~/sample/path/filename.txt
mv filename.txt newname.txt

Creating and Editing Files

$ touch newfile.txt
$ echo "A sample sentece" >> newfile.txt
$ vim filename.txt

Full stack software developer by day. Writer, illustrator, and general creative dabbler by night.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Enhanced OpenShift CLI: More Stories

My Most Meaningful Ten Lines of Code

What Is A PHP Proxy?

SQLAlchemy ORM Connecting to PostgreSQL, from scratch, Create, Fetch, Update and Delete.

OmiseGO: A recap of OmiseGo time at Devcon4, collaboration with MVLchain to develop a POC for TADA…

Squirrels in Traffic: How I Cracked the Code

Day 6 Of Coding Every Day Until I Get A Job In Tech

Deploying Go App with HAProxy + Docker to Google Compute Engine

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Edward Saavedra

Edward Saavedra

Full stack software developer by day. Writer, illustrator, and general creative dabbler by night.

More from Medium

Fetching Git to GitHub

Git — Useful Commands

Git Guide 01

GIT CRASH COURSE