Lexicon
⌘K
Explore
ExploreGuidesNotes
WriteMy Library
Sign in
Browse

Networking

  • OSI Model
  • TCP vs UDP
  • TCP/IP Model
  • Layer 2 & Layer 3 Networking

Programming

  • Start Here — How to Solve a Problem
  • From if/else to DSA — The Whole Path
  • Problem Solving
  • DSA Practice — Learn by Solving
  • C Programming
  • Python

Bug Bounty

  • Only Bug Bounty Checklist You'll Ever Need!!!
  • Only Bug Bounty Checklist You'll Ever Need!!! V2

My Notes

  • Python Conditional Statements - The Complete Breakdown
  • Python Data Types - The Complete Breakdown
  • Python Dictionaries - The Complete Breakdown
  • Python Exception Handling - The Complete Breakdown
  • Python Functions - The Complete Breakdown
  • Python Lists vs Arrays — The Real Story
  • Python Loops - The Complete Breakdown
  • Python OOP - The Complete Breakdown
  • The f Thing in Python - f-strings

Python

  • Python String Manipulation Functions - Full Reference
New noteSuggest a guide

Lexicon

a personal knowledge base

← Back to post

Version history

No earlier versions yet — history builds up each time this note is edited.

Current version1 of 1

Linux

Useful Linux filesystem commands

A compact cheat sheet of filesystem commands I keep coming back to on the terminal.

Moving around

pwd            # where am I
ls -lah        # long list, human sizes, include hidden files
cd -           # jump back to the previous directory

Finding things

find . -name '*.log'          # by name
find . -type f -size +100M    # files larger than 100MB
grep -rn 'TODO' src/          # recursive search with line numbers

Disk usage

du -sh *          # size of each item in the current directory
du -sh * | sort -h# same, sorted smallest to largest
df -h             # free space per mounted filesystem

When a disk fills up, du -sh * | sort -h from the root of the offending mount finds the culprit fast.

Permissions

chmod +x script.sh   # make executable
chmod 644 file       # owner read/write, everyone else read
chown user:group file

Copy, move, link

cp -r src/ backup/       # recursive copy
rsync -av src/ dest/     # efficient copy, only changed files
ln -s target linkname    # symbolic link

rsync beats cp for anything large or repeated because it only transfers what changed.