Skip to content

Latest commit

 

History

History
44 lines (39 loc) · 1.62 KB

04_basic_commands.md

File metadata and controls

44 lines (39 loc) · 1.62 KB

Basic Commands

Memorize these commands and their basic usage. These will help you navigate, and view and manage files.

  • pwd - print current working directory
  • cd - change directory
  • mkdir - make directory
  • ls - list
  • cp - copy
  • mv - move (a.k.a. rename)
  • rm - remove
  • less - page back and forth through a file without opening up a text editor
  • cat - concatenates files and prints them
  • man - view the man pages for a command
  • touch - change the timestamp of a file (or creates it if it doesn’t already exist)
  • grep - find a string within directory/files
  • echo - print something out
  • history - prints out your command history
  • exit - exits the terminal

Tips to Navigating the Command Line

  • up arrow - recall a previous command
  • !123 - recall command number 123
  • tab key - auto-complete a command or file name; hit tab twice to show options
  • clear - command to clear the screen
  • CTRL-a - go to the beginning of the line
  • CTRL-e - go to the end of the line
  • CTRL-_ - undo last change
  • CTRL-u - put everything back to the beginning of the line in your shell's copy buffer
  • CTRL-y - bring back everything from the shell's copy buffer and add it your commands
  • CTRL-k - kill/delete to the end of the line
  • CMD-t - creates a new tab in Terminal (OSX); do this manually via mouse in Nitrous.io
  • q - quit commands like less or man to return to the command line
  • CTRL-c - stop running commands
  • Let’s play around with these commands and keystrokes.

Experiment!

Try this now:

action@cli-crash-course-197957:~$

Back: Basics of the Bash Shell Forward: How to Not Hate Vim