터미널과 CLI 기초
터미널은 텍스트 명령어로 컴퓨터를 제어하는 도구입니다. GUI보다 빠르고 강력합니다.
Ghostty 설치
Ghostty는 빠르고 현대적인 터미널 앱입니다. Homebrew로 설치합니다.
brew install --cask ghostty
설치 후 Ghostty를 실행하면 터미널이 열립니다.
현재 위치 확인
pwd는 현재 디렉토리 경로를 출력합니다.
pwd
출력 예: /Users/username
파일 목록 보기
ls는 현재 디렉토리의 파일과 폴더를 보여줍니다.
ls
옵션을 추가해 더 자세한 정보를 볼 수 있습니다.
ls -la
-l: 상세 정보 (권한, 크기, 날짜)-a: 숨김 파일 포함
디렉토리 이동
cd로 디렉토리를 이동합니다.
cd Documents
상위 디렉토리로 이동:
cd ..
홈 디렉토리로 이동:
cd ~
디렉토리 생성
mkdir로 새 폴더를 만듭니다.
mkdir my-project
파일 생성
touch로 빈 파일을 만듭니다.
touch index.html
파일/폴더 삭제
rm으로 파일을 삭제합니다.
rm index.html
폴더 삭제는 -r 옵션이 필요합니다.
rm -r my-project
파일 내용 보기
cat으로 파일 내용을 출력합니다.
cat index.html
파일/폴더 복사
cp로 복사합니다.
cp index.html backup.html
폴더 복사:
cp -r src dist
파일/폴더 이동
mv로 이동하거나 이름을 변경합니다.
mv old.html new.html
화면 정리
clear로 터미널 화면을 정리합니다.
clear
또는 Cmd + K (macOS)를 사용합니다.
필수 명령어 정리
| 명령어 | 설명 |
|---|---|
pwd | 현재 디렉토리 출력 |
ls | 파일 목록 보기 |
cd | 디렉토리 이동 |
mkdir | 디렉토리 생성 |
touch | 빈 파일 생성 |
rm | 파일/폴더 삭제 |
cat | 파일 내용 출력 |
cp | 복사 |
mv | 이동/이름 변경 |
clear | 화면 정리 |
이 명령어들만 알아도 터미널을 사용할 수 있습니다.
The terminal lets you control your computer with text commands. It's faster and more powerful than GUI.
Install Ghostty
Ghostty is a fast, modern terminal app. Install it with Homebrew.
brew install --cask ghostty
Launch Ghostty after installation.
Check Current Location
pwd prints the current directory path.
pwd
Output example: /Users/username
List Files
ls shows files and folders in the current directory.
ls
Add options for more details.
ls -la
-l: Detailed info (permissions, size, date)-a: Include hidden files
Change Directory
cd moves to a different directory.
cd Documents
Go to parent directory:
cd ..
Go to home directory:
cd ~
Create Directory
mkdir creates a new folder.
mkdir my-project
Create File
touch creates an empty file.
touch index.html
Delete Files/Folders
rm deletes files.
rm index.html
For folders, use -r option.
rm -r my-project
View File Contents
cat outputs file contents.
cat index.html
Copy Files/Folders
cp copies files.
cp index.html backup.html
Copy folders:
cp -r src dist
Move Files/Folders
mv moves or renames files.
mv old.html new.html
Clear Screen
clear clears the terminal screen.
clear
Or use Cmd + K (macOS).
Essential Commands
| Command | Description |
|---|---|
pwd |
Print current directory |
ls |
List files |
cd |
Change directory |
mkdir |
Create directory |
touch |
Create empty file |
rm |
Delete file/folder |
cat |
Output file contents |
cp |
Copy |
mv |
Move/rename |
clear |
Clear screen |
These commands are all you need to start using the terminal.
终端让你用文本命令控制电脑。比图形界面更快更强大。
安装Ghostty
Ghostty是一个快速现代的终端应用。用Homebrew安装。
brew install --cask ghostty
安装后启动Ghostty。
查看当前位置
pwd输出当前目录路径。
pwd
输出示例:/Users/username
列出文件
ls显示当前目录的文件和文件夹。
ls
添加选项查看更多详情。
ls -la
-l:详细信息(权限、大小、日期)-a:包含隐藏文件
切换目录
cd移动到不同目录。
cd Documents
返回上级目录:
cd ..
返回主目录:
cd ~
创建目录
mkdir创建新文件夹。
mkdir my-project
创建文件
touch创建空文件。
touch index.html
删除文件/文件夹
rm删除文件。
rm index.html
删除文件夹需要-r选项。
rm -r my-project
查看文件内容
cat输出文件内容。
cat index.html
复制文件/文件夹
cp复制文件。
cp index.html backup.html
复制文件夹:
cp -r src dist
移动文件/文件夹
mv移动或重命名文件。
mv old.html new.html
清屏
clear清除终端屏幕。
clear
或使用Cmd + K(macOS)。
必备命令
| 命令 | 说明 |
|---|---|
pwd |
输出当前目录 |
ls |
列出文件 |
cd |
切换目录 |
mkdir |
创建目录 |
touch |
创建空文件 |
rm |
删除文件/文件夹 |
cat |
输出文件内容 |
cp |
复制 |
mv |
移动/重命名 |
clear |
清屏 |
掌握这些命令就能开始使用终端了。
ターミナルはテキストコマンドでコンピュータを操作するツールです。GUIより速くて強力です。
Ghosttyのインストール
Ghosttyは高速でモダンなターミナルアプリです。Homebrewでインストールします。
brew install --cask ghostty
インストール後、Ghosttyを起動します。
現在位置の確認
pwdは現在のディレクトリパスを出力します。
pwd
出力例: /Users/username
ファイル一覧の表示
lsは現在のディレクトリのファイルとフォルダを表示します。
ls
オプションで詳細情報を表示できます。
ls -la
-l: 詳細情報(権限、サイズ、日付)-a: 隠しファイルを含む
ディレクトリの移動
cdでディレクトリを移動します。
cd Documents
親ディレクトリへ移動:
cd ..
ホームディレクトリへ移動:
cd ~
ディレクトリの作成
mkdirで新しいフォルダを作成します。
mkdir my-project
ファイルの作成
touchで空のファイルを作成します。
touch index.html
ファイル/フォルダの削除
rmでファイルを削除します。
rm index.html
フォルダ削除には-rオプションが必要です。
rm -r my-project
ファイル内容の表示
catでファイル内容を出力します。
cat index.html
ファイル/フォルダのコピー
cpでコピーします。
cp index.html backup.html
フォルダのコピー:
cp -r src dist
ファイル/フォルダの移動
mvで移動または名前を変更します。
mv old.html new.html
画面のクリア
clearでターミナル画面をクリアします。
clear
またはCmd + K(macOS)を使います。
必須コマンド一覧
| コマンド | 説明 |
|---|---|
pwd |
現在のディレクトリを出力 |
ls |
ファイル一覧を表示 |
cd |
ディレクトリ移動 |
mkdir |
ディレクトリ作成 |
touch |
空のファイル作成 |
rm |
ファイル/フォルダ削除 |
cat |
ファイル内容を出力 |
cp |
コピー |
mv |
移動/名前変更 |
clear |
画面クリア |
これらのコマンドだけでターミナルを使い始められます。
El terminal te permite controlar tu computadora con comandos de texto. Es más rápido y poderoso que la GUI.
Instalar Ghostty
Ghostty es una app de terminal rápida y moderna. Instálala con Homebrew.
brew install --cask ghostty
Abre Ghostty después de la instalación.
Ver Ubicación Actual
pwd muestra la ruta del directorio actual.
pwd
Ejemplo: /Users/username
Listar Archivos
ls muestra archivos y carpetas en el directorio actual.
ls
Añade opciones para más detalles.
ls -la
-l: Info detallada (permisos, tamaño, fecha)-a: Incluir archivos ocultos
Cambiar Directorio
cd se mueve a otro directorio.
cd Documents
Ir al directorio padre:
cd ..
Ir al directorio home:
cd ~
Crear Directorio
mkdir crea una nueva carpeta.
mkdir my-project
Crear Archivo
touch crea un archivo vacío.
touch index.html
Eliminar Archivos/Carpetas
rm elimina archivos.
rm index.html
Para carpetas, usa la opción -r.
rm -r my-project
Ver Contenido de Archivo
cat muestra el contenido del archivo.
cat index.html
Copiar Archivos/Carpetas
cp copia archivos.
cp index.html backup.html
Copiar carpetas:
cp -r src dist
Mover Archivos/Carpetas
mv mueve o renombra archivos.
mv old.html new.html
Limpiar Pantalla
clear limpia la pantalla del terminal.
clear
O usa Cmd + K (macOS).
Comandos Esenciales
| Comando | Descripción |
|---|---|
pwd |
Mostrar directorio actual |
ls |
Listar archivos |
cd |
Cambiar directorio |
mkdir |
Crear directorio |
touch |
Crear archivo vacío |
rm |
Eliminar archivo/carpeta |
cat |
Mostrar contenido |
cp |
Copiar |
mv |
Mover/renombrar |
clear |
Limpiar pantalla |
Estos comandos son todo lo que necesitas para empezar a usar el terminal.