일. 7월 27th, 2025

Getting Started with Linux Terminal

The Linux command line (Terminal) is a powerful tool for controlling your system. Here are fundamental commands every beginner should learn:


🗂️ Navigating & Exploring

  1. pwd (Print Working Directory)
    Shows your current folder path.
    Example: pwd/home/username/Documents

  2. ls (List)
    Lists files/folders in your current directory.
    Flags:

    • ls -a → Shows hidden files (starting with .)
    • ls -l → Detailed list with permissions
  3. cd (Change Directory)
    Moves between folders.
    Examples:

    • cd Documents → Enters “Documents”
    • cd .. → Goes back one folder
    • cd ~ → Returns to home directory

📂 Managing Files & Folders

  1. mkdir (Make Directory)
    Creates a new folder.
    Example: mkdir Projects

  2. touch
    Creates an empty file.
    Example: touch notes.txt

  3. cp (Copy)
    Copies files/folders.
    Example: cp file.txt ~/Backup/

  4. mv (Move/Rename)
    Moves files or renames them.
    Examples:

    • mv old.txt new.txt (Renames)
    • mv file.txt ~/Documents/ (Moves)
  5. rm (Remove)
    Deletes files/folders. ⚠️ Use carefully!
    Flags:

    • rm file.txt → Deletes a file
    • rm -r folder/ → Deletes a folder recursively

📝 Viewing & Editing Files

  1. cat (Concatenate)
    Shows full file content in the terminal.
    Example: cat config.txt

  2. less
    Views large files page-by-page (press q to quit).
    Example: less long_log.log

  3. nano
    Simple text editor.
    Example: nano file.txt → Edit & save with Ctrl+XY


🔍 Finding Content

  1. grep (Global Regular Expression Print)
    Searches text patterns in files.
    Example: grep "error" log.txt → Shows lines containing “error”

  2. find
    Locates files/folders by name.
    Example: find . -name "*.jpg" → Searches JPEGs in current directory


⚙️ System & Permissions

  1. chmod (Change Mode)
    Modifies file permissions.
    Example: chmod +x script.sh → Makes “script.sh” executable

  2. sudo (SuperUser Do)
    Runs commands with admin privileges. ⚠️ Requires password

  3. man (Manual)
    Shows help for any command.
    Example: man ls → Displays full guide for ls


💡 Pro Tips

  • Use Tab to auto-complete file/folder names.
  • Press Ctrl+C to force-stop any running command.
  • Chain commands with && (e.g., mkdir data && cd data).

Practice these in a safe environment, and you’ll master Linux basics quickly! 🐧

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다