Part 1: Getting Started - Your First Commands
Table of Contents
Learn essential navigation and file operation commands in the Linux terminal Welcome to Part 1 of the Linux Command-Line Workshop! Haven’t set up your environment yet? Go back to Part 0: Setting Up Your Environment first! In this post, you’ll learn the fundamental commands that every developer needs to navigate and manipulate files in the terminal. Before we dive in, let’s understand what a command looks like: Example: Shows you where you currently are in the filesystem. Exercise 1.1: Open your terminal and run The most-used command. Shows files and folders in your current location. Basic usage: Important flags: Exercise 1.2: Pro tip: You can combine short flags: Move around the filesystem. Basic usage: Important paths: Exercise 1.3: Create new folders. Exercise 1.4: Creates a new empty file or updates timestamp of existing file. Exercise 1.5: Exercise 1.6: Exercise 1.7: ⚠️ Warning: There’s no trash/recycle bin. Deleted = gone forever! Exercise 1.8: Navigation in Exercise 1.9: Run Most commands support Ready to practice? Complete the hands-on challenge in the workshop repository: Challenge: Build a complete web project structure using only the commands you learned. The challenge includes: Clone the repository and give it a try: You’ve learned: These are the foundation of everything you’ll do in the terminal! In Part 2: Reading & Searching, we’ll learn how to:Navigation
The Anatomy of a Command
ls)-a, -l)
)
)
)
Navigation Commands
pwd - Print Working Directory
# Output: /home/bakayu
pwd. What directory are you in?ls - List Directory Contentsls in your home directoryls -a - do you see any new files? (Hint: look for .bashrc, .profile)ls -lh - what’s the size of your largest file?ls -lah is the same as ls -l -a -hcd - Change Directory/ - Root directory (top of filesystem)~ - Your home directory (shortcut for /home/username). - Current directory.. - Parent directorycd ~cd /lscd ~cd Documents (if it exists) then cd .. then cd -File Operations
mkdir - Make Directory
touch - Create Empty File
cp - Copy Files
mv - Move/Rename Files
rm - Remove Files
Getting Help
man - Manual Pagesman:SPACE to go down one pageb to go back one page/ to search (type your search term, press Enter)q to quitman ls and find what the -R flag does.--help Flag--help:
Hands-On Challenge
Summary
pwd, ls, cdmkdir, touch, cp, mv, rmman, --helpNext Steps
cat, less, head, tail)grep)|)Quick Reference Card
# Navigation
# Where am I?
# File Operations
# Help