惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
博客园 - 司徒正美
D
Docker
B
Blog
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
S
SegmentFault 最新的问题
小众软件
小众软件
J
Java Code Geeks
美团技术团队
腾讯CDC
MyScale Blog
MyScale Blog
爱范儿
爱范儿
H
Help Net Security
宝玉的分享
宝玉的分享
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
博客园 - 【当耐特】

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Linux Basics: Essential File System Commands
yuna song · 2026-06-27 · via DEV Community

yuna song

1. cd — Change Directory

Changes the current working directory.

Syntax

cd <path>

Common Usage

cd /              # Go to the root directory
cd ~              # Go to the current user's home directory
cd ..             # Move up one directory
cd -              # Return to the previous directory
cd ./Documents    # Relative path
cd /var/log       # Absolute path

Path Types

  • Absolute path: Starts with / and specifies the full path from the root directory.
  • Relative path: Starts from the current directory (e.g. ./, ../, or a directory name).

Tips

  • Press Tab for auto-completion.
  • Use quotes for directory names containing spaces.
cd "My Folder"


2. ls — List Files and Directories

Displays the contents of a directory.

Syntax

ls [options] [path]

Common Options

ls          # List files
ls -l       # Long format
ls -a       # Include hidden files
ls -la      # Long format + hidden files
ls -lh      # Human-readable file sizes
ls -t       # Sort by modification time
ls -S       # Sort by file size
ls -r       # Reverse sort order
ls -R       # Recursive listing
ls -d */    # Show directories only

Useful Combinations

ls -altr    # Hidden files, long format, time sort, reverse order
ls -alF     # Append indicators (/, *, etc.)
ls -lthr    # Human-readable, time sort, newest at the bottom


3. pwd — Print Working Directory

Displays the absolute path of the current directory.

Syntax

pwd

Options

pwd -L      # Logical path (default)
pwd -P      # Physical path (resolve symbolic links)

Example:

/home/user/workspace


4. mkdir — Make Directory

Creates one or more directories.

Syntax

mkdir [options] <directory>

Common Usage

mkdir project
mkdir dir1 dir2 dir3
mkdir -p parent/child/grandchild
mkdir -v new_folder
mkdir -m 755 secure_folder

Useful Options

  • -p : Create parent directories if needed.
  • -v : Show created directories.
  • -m : Set permissions when creating the directory.

5. rm — Remove Files and Directories

Deletes files or directories permanently.

Warning: Deleted files cannot be recovered from the Trash.

Syntax

rm [options] <file>

Common Usage

rm file.txt
rm -i file.txt
rm -r directory
rm -f file.txt
rm -rf directory

Multiple Files & Wildcards

rm file1.txt file2.txt
rm *.log

Important Options

  • -i : Ask for confirmation.
  • -r : Remove directories recursively.
  • -f : Force deletion without prompts.

Never run

sudo rm -rf /

This command can destroy the entire operating system.


6. cp — Copy Files and Directories

Copies files or directories while keeping the original intact.

Syntax

cp [options] <source> <destination>

Common Usage

cp file1.txt file2.txt
cp -r dir1 dir2
cp file1.txt file2.txt ~/backup/
cp -a /etc/config.conf ~/backup/

Useful Options

  • -r / -R : Copy directories recursively.
  • -a : Archive mode (preserve attributes, permissions, timestamps, and symbolic links).
  • -p : Preserve file metadata.
  • -i : Confirm before overwriting.
  • -f : Force overwrite.

7. mv — Move or Rename Files

Moves files/directories or renames them.

Syntax

mv [options] <source> <destination>

Common Usage

mv file1.txt ~/Documents/
mv file1.txt file2.txt
mv folder1 ~/backup/
mv file1.txt file2.txt ~/backup/

Useful Options

  • -i : Confirm before overwriting.
  • -f : Force overwrite.
  • -n : Never overwrite existing files.
  • -v : Show each move operation.