If you’re working in Terminal on your Mac, you need to know the most important UNIX commands: those that work with directories, those that work with files, and miscellaneous but commonly used commands.
Folders are called directories in UNIX. Commands that refer to filenames, as most do, assume that you’re talking about files in the working directory. When you open the Terminal window, the working directory is set to your home directory, abbreviated ~. Bash shows you the current working directory and your username to the left of its prompt. The following table lists common directory-related commands.
Command | What It Does |
---|---|
ls | Lists the names of the files in the working directory. For more complete information, use ls –alF (. |
cd directoryname | Changes the working directory to the one you named. |
cd . | Brings you up one directory level. |
cd | Returns you to your home directory. |
pwd | Displays the pathname of the current directory. |
mkdir newdirectoryname | Makes a new directory. |
rmdir directoryname | Removes (deletes) an empty directory. |
![Apple Computer Commands Apple Computer Commands](https://cdn.osxdaily.com/wp-content/uploads/2011/11/reveal-wallpaper-path-mac-desktop-610x357.jpg)
As in Windows, you can redirect the output of a command to a text file. So if you want a record of the files in a folder, type cd, followed by a space, drag the folder’s icon to the Terminal window, and press Return. Type ls > mydirectorylist.txt and press Return again. A file named mydirectorylist.txt will appear in the folder you chose. You can open the file in TextEdit to see a list of the files in that directory.
- Voice-to-text is a helpful feature for those who are often out and about. And for those who have a Mac computer, you can take that feature and use it in your everyday workflow. The key is a built.
- To log into your Mac on another Mac, execute the command: 1. Ssh -l username remote-address. Replace username with the username you'd use to log into OS X and remote-address with the IP address given to you in the Sharing pane. You can now control your Mac and execute Terminal commands remotely, a.
Will sims 3 run on macbook air. This table lists commands commonly used when working with files in the Terminal window.
If you’re working in Terminal on your Mac, you need to know the most important UNIX commands: those that work with directories, those that work with files, and miscellaneous but commonly used commands. Folders are called directories in UNIX. Commands that refer to filenames, as most do, assume that you’re talking about files in the.
Command | What It Does |
---|---|
cp filename1 filename2 | Copies a file. |
chmod | Changes permissions for access to a file. Study the man page before using this one. |
diff | Compares two files line by line (assumes text). |
more filename | Displays a text file one page at a time. Press the spacebar to see the next page; press Q to quit. The man command works through more. |
mv filename1 filename2 | Moves a file or changes its name. |
rm filename | Removes (deletes) a file. |
This last table explains other handy commands that anyone getting started in Terminal will likely want to know.
Command | What It Does |
---|---|
Control+C | Terminates most operations. |
date | Displays the current date and time. |
echo | Repeats whatever appears after the command (after expansion). |
help | Displays a partial list of bash commands. |
history | Displays the last commands you typed. You can redo a command by typing an exclamation point (!) followed immediately (no space) by the number of that command in the history list. To repeat the last command, type !!. To repeat the last filename, type !*. |
pico | A simple UNIX text editor. |
ps | Displays a list of running processes. |
sudo | Lets you carry out commands for which the account you are using lacks authority. You will be asked for an administrator’s password. |
When you’re working in Terminal, you don’t have a Trash Can to which deleted files are moved pending ultimate disposal. Delete it, and it’s gone. In general, UNIX has no Undo function.
Shortcut keys ABCs
Apple Command Codes
Shortcut keys help provide an easier and quicker method of navigating and executing commands in the computer software. Shortcut keys are commonly accessed by using the Alt key (on IBM compatible computers), Command key (on Apple computers), Ctrl key, or Shift key in conjunction with another key. The de facto standard for listing a shortcut is listing the modifier key, a plus symbol, and another key. In other words, 'Ctrl+S' is telling you to press and hold the Ctrl key, and then press the S key too.
You can also find the shortcut keys in popular programs by looking for underlined letters in their menus. For example, the file menu image has an underline on the 'F' in File, which means you can press the Alt key and 'F' key to access the file menu.
![Computer Computer](https://upload.wikimedia.org/wikipedia/commons/thumb/7/78/Appleterminal2.png/1200px-Appleterminal2.png)
Some programs require the user to press and hold Alt to see the underlined characters. In the image above, you can see that some of the common features, such as Open (Ctrl+O) and Save (Ctrl+S), have shortcut keys assigned to them. As you begin to memorize shortcut keys, you'll notice that many applications share them. We have a list of the most commonly shared ones in the basic PC shortcut keys section.
NoteNon-English versions of Microsoft Windows may not be able to use all of the below shortcut keys.
Basic PC shortcut keys
Below is a list of some of the most commonly used basic shortcut keys that work with IBM compatible computers and software. We highly recommended that all users keep a reference to these shortcut keys or try to memorize them. Doing so will dramatically increase your productivity.
TipBesides the special character shortcuts listed here, some are also on the number keys (below the F1 - F12 keys). You can enter these special characters by pressing the Shift key and the number key that has the special character listed on it.
Shortcut Keys | Description |
---|---|
Alt+F | File menu options in current program. |
Alt+E | Open Edit options in current program. |
Alt+Tab | Switch between open programs. |
F1 | View help information (F1 is used by almost every Windows program to display help). |
F2 | Rename a selected file. |
F5 | Refresh the current program window. |
Ctrl+D | Bookmarks the current page in most Internet browsers. |
Ctrl+N | Create a new or blank document in some software, or open a new tab in most Internet browsers. |
Ctrl+O | Open a file in the current software. |
Ctrl+A | Select all text. |
Ctrl+B | Change selected text to be bold. |
Ctrl+I | Change selected text to be in italics. |
Ctrl+U | Change selected text to be underlined. |
Ctrl+F | Open find window for current document or window. |
Ctrl+S | Save current document file. |
Ctrl+X | Cut selected item. |
Shift+Del | Cut selected item. |
Ctrl+C | Copy selected item. |
Ctrl+Ins | Copy selected item |
Ctrl+V | Paste |
Shift+Ins | Paste |
Ctrl+Y | Redo last action. |
Ctrl+Z | Undo last action. |
Ctrl+K | Insert hyperlink for selected text. |
Ctrl+P | Print the current page or document. |
Home | Goes to beginning of current line. |
Ctrl+Home | Goes to beginning of document. |
End | Goes to end of current line. |
Ctrl+End | Goes to end of document. |
Shift+Home | Highlights from current position to beginning of line. |
Shift+End | Highlights from current position to end of line. |
Ctrl+Left arrow | Moves one word to the left at a time. |
Ctrl+Right arrow | Moves one word to the right at a time. |
Ctrl+Esc | Open the Start menu. |
Ctrl+Shift+Esc | Open Windows Task Manager. |
Alt+F4 | Close the currently active program. |
Alt+Enter | Open the properties for the selected item (file, folder, shortcut, etc.). |
Apple Computer Commands
PC shortcut keys for special characters
Many special characters can be created using keyboard shortcuts. Below are some of the more common and popular special characters and the keyboard shortcuts to create them.
Shortcut Keys | Special Character |
---|---|
Alt+0224 | à |
Alt+0232 | è |
Alt+0236 | ì |
Alt+0242 | ò |
Alt+0241 | ñ |
Alt+0228 | ä |
Alt+0246 | ö |
Alt+0252 | ü |
Alt+0248 | ø |
Alt+0223 | ß |
Alt+0198 | Æ |
Alt+0231 | ç |
Alt+0191 | ¿ |
Alt+0176 | ° (degree symbol) |
Alt+0177 | ± (plus/minus symbol) |
Alt+0153 | ™ |
Alt+0169 | © |
Alt+0174 | ® |
Alt+0128 | € (Euro currency) |
Alt+0162 | ¢ (Cent symbol) |
Alt+0163 | £ (British Pound currency) |
Alt+0165 | ¥ (Japanese Yen currency) |