Terminal Basic Operation Manual
What is a Terminal?
A terminal is a tool for operating computers in a text-based manner. It gives instructions to the computer by directly entering command statements.
Launching Terminal
Windows
- Use third-party software like Git Bash
- Windows Subsystem for Linux (WSL): Search for WSL distribution name (e.g., “Ubuntu”) in Start menu
Linux (Ubuntu etc.)
- Shortcut: Ctrl + Alt + T
- Application menu: Search for “Terminal”
macOS
- Spotlight: Command + Space → Type “Terminal”
- Applications: Applications > Utilities > Terminal
Basic Usage
Command Input
When terminal launches, a prompt is displayed. Enter a command and press Enter to execute.
lsOptions and Arguments
- Options: Strings starting with
-or--. Modify command behavior - Arguments: Target (file or directory) that command acts upon
ls -lCommand History
| Key | Action |
|---|---|
| ↑ | Display previously entered command |
| ↓ | Display next command |
| history | Display list of recently executed commands |
Tab Completion
While entering command or file name, pressing Tab key automatically completes the name.
cd Doc[Tab]→ Completes to Documents if it exists
Cancel Command
Ctrl + C: Cancels running command
Command Cheat Sheet
⚠️ Note: Commands are executed only in current directory.
Directory Operations
| Command | Description |
|---|---|
pwd | Display path to current directory |
cd directory_name | Move to other directory |
cd .. | Move to parent directory |
mkdir name | Create new directory |
rmdir name | Delete empty directory |
File Operations
| Command | Description |
|---|---|
ls | List contents of current directory |
ls -l | Detailed display |
ls -a | Include hidden files |
cp [source] [destination] | Copy file/directory |
mv [source] [destination] | Move or rename |
rm filename | Delete file ⚠️ |
rm -r dirname | Delete directory and contents ⚠️ |
find | Search for files and directories |
cat filename | Display file contents |
⚠️ Warning: Files deleted with rm don’t go to trash and cannot be restored. Execute carefully.
Other
| Command | Description |
|---|---|
man command_name | Open command manual |
clear | Clear screen |
Directory Notation
| Symbol | Meaning |
|---|---|
. | Current directory |
.. | Parent directory (one level up) |
~ | Home directory |
../../ | Two levels up |
Precautions and Dangerous Commands
| Item | Description |
|---|---|
| Pre-execution check | Double-check content and target for rm and sudo |
| Administrator privilege | Fully understand command meaning before using sudo |
| Backup | Always backup important files beforehand |
| Error messages | Messages on failure are hints for problem solving |
Troubleshooting
| Problem | Solution |
|---|---|
| Command doesn’t respond | Check if you pressed Enter. Check for spelling mistakes and half-width input |
Want to restore file deleted with rm | Basically cannot be restored. Backup beforehand |
| Japanese characters garbled | Change terminal character encoding to “UTF-8” |
Can’t move with cd | Check directory name spelling and case. Confirm correct name with ls |
| Want to change background/text color | Customize from terminal settings |
