Essential Linux Tools

Essential Linux Tools

Linux Terminal Tools

Text Editors

nano - Beginner-Friendly Editor

nano filename.txt

Basic controls:

  • Ctrl + O - Save (Write Out)
  • Ctrl + X - Exit
  • Ctrl + K - Cut line
  • Ctrl + U - Uncut (paste)

vim - Powerful Text Editor

vim filename.txt

Basic controls:

  • i - Insert mode
  • Esc - Command mode
  • :w - Save
  • :q - Quit
  • :wq - Save and quit
  • :q! - Quit without saving
Pro tip: Type vimtutor to learn vim interactively.

File Operations

find - Search for Files

find /home -name "*.txt"
find . -type d -name "projects"

grep - Search Inside Files

grep "search-term" file.txt
grep -r "search-term" folder/
grep -i "search" file.txt  # Case insensitive

wc - Word Count

wc -l file.txt    # Count lines
wc -w file.txt    # Count words
wc -c file.txt    # Count characters

System Information

uname - System Information

uname -a           # All information
uname -r           # Kernel version
uname -m           # Machine hardware

df - Disk Space

df -h              # Human-readable sizes
df -h /mnt/c       # Specific drive

du - Directory Size

du -sh folder/     # Total size
du -h --max-depth=1 # Size of subdirectories

free - Memory Usage

free -h            # Human-readable

top/htop - Process Monitor

htop                # Interactive process viewer
top                 # Built-in process viewer

Networking

ping - Test Connection

ping google.com
ping -c 4 google.com  # Stop after 4 pings

ip - Network Configuration

ip addr             # Show IP addresses
ip link             # Show network interfaces

curl and wget - Download Files

curl -O file.url
wget file.url

Compression

zip and unzip

zip -r archive.zip folder/
unzip archive.zip

tar - Archive Files

tar -cvf archive.tar folder/
tar -xvf archive.tar
tar -czvf archive.tar.gz folder/  # Compressed

Redirection and Piping

Output Redirection

command > file.txt     # Overwrite
command >> file.txt    # Append
command 2> error.txt   # Errors only

Pipes

ls -la | grep "txt"   # Filter output
cat file | wc -l      # Count lines in file

Useful Shortcuts

Terminal Shortcuts:

ShortcutAction
Ctrl + CCancel current command
Ctrl + ZSuspend current command
Ctrl + LClear screen
Ctrl + AMove to beginning of line
Ctrl + EMove to end of line
Ctrl + UClear line before cursor
Ctrl + KClear line after cursor
TabAuto-complete
Tab + TabShow all completions

Practice Exercise

Try these commands:

# Check system info
uname -a

See disk usage

df -h

Find all .txt files

find ~ -name "*.txt"

Count lines in a file

wc -l /etc/passwd

Search in a file

grep "root" /etc/passwd

Summary

These essential tools will make you productive in Linux:

  • nano/vim - Text editing
  • find/grep - File searching
  • df/du/free - System monitoring
  • curl/wget - Downloading
  • tar/zip - Compression
Practice these commands to become comfortable with the Linux terminal.

Next Lesson

In the final lesson, you'll complete a practical project and review what you've learned.

Quiz - Quiz - Essential Linux Tools

1. Which command searches for text inside files?

2. Which command shows disk space usage?

3. What does the '|' symbol do in terminal?

4. Which keyboard shortcut clears the terminal screen?

Installing Software with apt