DEV Community

Cover image for Reference Guide: Common Commands for Terminal
kymiddleton
kymiddleton

Posted on • Edited on

23 12

Terminal Commands Reference Guide: Common Commands for Terminal

Have you ever walked out of a room and then couldn't remember what you started to do? Have you ever convinced yourself a trip to the grocery store can be accomplished without a list only to arrive home without the one single item that was most needed? It happens to me, more than I'd like to admit, and I'm fairly certain I'm not alone. Throughout my career, I've developed a strategy to set myself up for success when moments of brain overload strike.

There are certain job responsibilities or steps of a process that are difficult to remember when performed on an infrequent basis or when learning them for the first time. This is where a quick reference list or guide can be a lifesaver. As a newbie to web development there are numerous steps to remember and until they've been committed to memory reference materials are my go-to. In case someone else is in need too I wanted to share the steps I've created for a few common processes needed as a new web developer.

Terminal:
The Terminal program is built-in on Mac computers and uses text commands to operate the computer without using the user interface. Terminal commands for GitHub will all begin with the prefix git followed by the command.

Terminal

Common Commands:

  • ~ Indicates the home directory
  • pwd Print working directory (pwd) displays the path name of the current directory
  • cd Change Directory
  • mkdir Make a new directory / file folder
  • touch Make a new file
  • .. Go up one level / directory
  • cd ~ Return to home directory
  • clear Clears information on the display screen to provide a blank slate
  • ls List provides a list of all files with a directory
  • ls -l Displays a long list vertically with file permissions, date modified and file name
  • ls -la Displays all files

Auto Complete File Names:
Enter the first couple of lines of the file name followed by the tab key and it will auto complete the rest of the file path name.

Next up: Part 2 Create a GitHub Repository

For the completed Reference Guide Series:

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (6)

Collapse
 
gypsydave5 profile image
David Wickes

Small typo - cd~ will do nothing, cd ~ will return to the home directory. But you might prefer to just type cd on its own, which will also return to the home directory.

For a pc, I think it's called the Windows Command Prompt.

I'd really leave out Windows from your tutorial - it uses different commands to the ones you're using here. But they will still (mostly) apply to Linux users.

Finally, you've got to add ls -la - showing all files can be very useful!

Collapse
 
kymiddleton profile image
kymiddleton

Thanks for the feedback! I'll make some updates. :)

Collapse
 
vguarnaccia profile image
Vincent Guarnaccia

Two keyboard shortcuts I find very helpful are Ctrl+l, which clears the screen, and Ctrl+r which searches through the command history for recently used commands.

Collapse
 
kymiddleton profile image
kymiddleton

I love learning new tips! Thanks for sharing.

Collapse
 
kymiddleton profile image
kymiddleton

I'm not familiar with these but I'll look them up and add them to my list. Thanks so much for sharing!!

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay