Summary

Author

Government Analysis Function and ONS Data Science Campus

In this course we have covered basic command line usage for both UNIX-like and Windows command line interfaces. Command line interfaces allow you to directly access your computer’s file system and programs. You will now have seen and had experience navigating directories, manipulating directory contents and interacting with computer programs.

1 Additional Resources

If you would like some additional resources to reinforce the material here or to go a bit deeper into command line interfaces, here are some recommendations:


Our team is trying to maintain a high response rate to our post-course survey to ensure we keep delivering quality training. Please go to the course on the learning hub and complete the “Post-Course Survey”.


2 Command Glossary

Below is a collection of the commonly used commands to be used for reference.

fp - “filepath”

Command Purpose
man <command> “Manual” - provides information about a specified command
pwd “Present Working Directory” - returns the path to the current directory
ls “List” - lists the contents of the current directory
ls -a lists all contents of the current directory including hidden items
cd <path> “Change Directory” - changes the current directory to the path specified
cd .. Changes the directory to one level above the current
cd D Changes to the D drive when in the root directory
ls -r Recursively lists the contents of directories and sub-directories
mkdir <foldername> “Make Directory” - creates a directory at a specified location
touch <filename> Creates a new empty file
mv <source fp> <destination fp> “Move” - moves the source file to the destination
cp <source fp> <destination fp> “Copy” - copies and pastes the source file to the destination
rm <item filepath> “Remove” - removes the file from the file system
<output command> > <fp> Redirects the output of a command into the specified file
cat [options] <fp> Allows you to display or add to a file
Command Purpose
help [command] Provides information about a specified command or general advice
cd Returns the path to the current directory
dir “Directory” - lists the contents of the current directory
dir /AH lists all contents of the current directory including hidden items
cd <path> “Change Directory” - changes the current directory to the path specified
cd .. Changes the directory to one level above the current
D: Changes to the D drive when in the root directory
tree [/F] Displays a tree diagram of all sub-folders, optionally includes files
mkdir <foldername> “Make Directory” - creates a directory at a specified location
echo. > <fp> Creates a new empty file
move <source fp> <destination fp> Moves the source file to the destination
copy <source fp> <destination fp> Copy and pastes the source file to the destination
rmdir [/s] <fp> “Remove Directory” - removes the directory and optionally the contents of it’s sub folders
del <fp> “Delete” - deletes the file in the filepath
<output command> > <fp> Redirects the output of a command into the specified file
copy con <fp> Allows you to overwrite an existing file
type <fp> Returns the contents of a file

Reuse

Open Government Licence 3.0