Operating Systems (Mac) - Terminal Basic Commands

This document explains some of the basic commands for the command line interface in Mac OSX's Terminal.

 


When Terminal is first opened a message similar to the follow appears:

Last login: Tue Feb 23 13:00:14 on ttys000

userNameDevice:~ username$

The 'userNameDevice:~ username$ ' line is the prompt that Terminal will give you to enter a command. After this line, you can begin entering commands.


Basic Commands

cd - Stands for 'change directory.' Follow the command with the name of the directory you would like to change to that is within the directory you are currently operating in, such as Desktop or Documents from the User directory.

userNameDevice:~ username$ cd Desktop

userNameDevice:Desktop username$

rm - Stands for 'remove'. This will delete any file specified in the current directory.

userNameDevice:Desktop username$ rm Document1.txt

cp - Stands for 'copy'. This will create a copy of any file specified in the current directory. Just follow the command with the file you would like to copy and then the name you would like the copy to be.

userNameDevice:Desktop username$ cp Document1.txt Document1Copy.txt

mkdir- Stands for 'make directory.' This will create a new folder within the folder you are currently in.

userNameDevice:Desktop username$ mkdir newFolder1

ls - Stands for 'list.' This will list all files and folders within the folder you are currently in.

userNameDevice:~ username$ ls

Applications Downloads Movies Desktop

userNameDevice:~ username$



Keywordsmac terminal command line commands osx   Doc ID61066
OwnerHelp Desk K.GroupUW-Milwaukee Help Desk
Created2016-02-23 14:38:15Updated2023-06-05 13:44:57
SitesUW-Milwaukee Help Desk
Feedback  0   0