Linux Command Line Cheatsheet - gecko-8/devwiki GitHub Wiki

Up

General

Put Linux in Debug Mode

set -x

Take Linux Out Of Debug Mode

set +x

Refresh .bashrc

source ~/.bashrc

File Management

Copy Directory and Contents

cp -r <src> <dest>

Delete Directory and Contents

rm -d -r <directory>

Recursively Find Files by Name

find <root folder> -name "<search term with wildcards>"

e.g. Find all files beneath current directory with names ending with .env

find . -name "*.env"

View Drive Usage

NOTE: -h outputs in "human-readable" values (GB, MB, etc.)

df -h

General

View CPU Usage

top

Apt

Prevent Updating of Package

sudo apt-mark hold <package name>

Re-enable Updating of Package

sudo apt-mark unhold <package name>
⚠️ **GitHub.com Fallback** ⚠️