cd [directory]
: change directoryls [directory]
: list files & directoriescp [src] [dst]
: copy src to dstrm [file or directory]
: remove file or directorymkdir [directory]
: create directoryln -s [target] [symlink]
: create a symlinktouch [file]
: create empty file, mark file as newly editedsource [file]
: execute a .sh
file within the current shellcat [file]
: print file to the screentree -a
: print directory hierarchytail -n [num of lines] [file]
: show last N lines of a filefile [file]
: get file typestat [file]
: get file infoman [cmd]
: show manual for cmdpwd
: show current directorywhich [cmd]
: show where cmd is locatedfind
: find filesfind [directory] -name [file]
: find file in directoryfind [directory] -name *.[ext]
: find all files of a given typefind [directory] -type f -exec grep "[text]" '{}' \; -print
: find text in filessudo [cmd]
: run a cmd as rootchmod [file]
: change file permissionschown [owner]:[group] [file]
: change the owner of a filegroups [user]
: list groups of a usercat /etc/group
: list all groupsexport [var]=[name]
: set an env variableecho $[var]
: print env variableecho $PATH
: show system PATHexport PATH=$PATH:[directory path]
: add directory to system PATHecho "export PATH=$PATH:[directory path]" >> ~/.bashrc
: change the system PATH permanentlyssh -p [port] [user]@[ip]
: login to SSHscp [src path] [user]@[ip]:[dst path]
: copy file to remotescp [user]@[ip]:[src path] [dst path]
: copy file from remotereboot
: reboot systempoweroff
: shutdown systemwget
: ?tar -czvf [output file] [input dir]
: create tar file (tar.gz
)tar -xvf [input file] -C [output dir]
: extract tar filezip
: ?unzip
: ?hexdump
: dump file as hexafind . -name [file] | entr [cmd]
: run a cmd whenever a file changeslsblk
: list diskfdisk -l
: disk infofdisk [disk]
: partition diskmount [disk name] [directory]
: mount diskumount [directory]
: unmount diskcat /proc/mounts
: mount infofastfetch
: system infouname -a
: show kernel versionlscpu
: list CPU infolspci
: list PCI devices (Bus:Device.Function)lsusb
: list USB devicesnvidia-smi
: show GPU infoifconfig
: show network infoiftop
: list TCP socketsnetstat -nat
: list TCP socketsdf -shc * | sort -rh
: show disk usagefree -h --si
: show how much RAMhtop
: list process, kill processsensors
: show temperaturewatch -t -n 1 "sensors | grep 'Core 0:'"
: show CPU temperaturenmap -Pn -p- -v [ip]
: find open portsstrace
: trace syscallscat /proc/[pid]
: procfs, running processescat /proc/meminfo
: memory infocat /proc/cpuinfo
: CPU info (CPUID)cat /proc/interrupts
: interrupts incat /proc/ioports
: IO portscat /proc/iomem
: MMIOcat /proc/driver/nvidia/
: GPU infocat /proc/stat
: all process statscat /proc/[pid]/stat
: process statslsmod
: list kernel modulescat /proc/modules
insmod [module].ko
: install kernel modulermmod [module]
: remove kernel modulemodinfo -F [info] [module]
: get info about kernel moduledmesg | tail -n 5
: show kernel logls -l /dev
: list device filescat /proc/devices
: list assigned device numbersmknod [device] c [major] [minor]
: create character devicermnod [device]
head -c 1 [file]
: output the first byte of a file.
: current directory..
: parent directory~
: home directory../relative/path
: relative path/absolute/path
: absolute pathA | B
: run A and transfer its output to BA & B
: run A then BA && B
: run A then B only if A succeeds| grep [some string]
: filter out stdout>
: stdout<
: stdin&>
: stdout + stderr0>
: stdin1>
: stdout2>
: stderr2>&1
: stderr to stdout, can use cmd | tee out.txt
to also print on screen~/.bashrc
~/.bash_profile
~/.bashrc
/proc
: procfs, running processes/dev
: udev, devices files/sys
: sysfs, devices/bus/drivers/kernel/sys/bus/pci/devices
dnf search [package]
: search for package in reposdnf info [package]
: get info about packagednf install [package]
: install packagednf remove [package]
: remove packagednf erase [package]
: remove package+deps+config (careful!)dnf list installed
: list installed packagesdnf list available
: list all availables packagesdnf list installed *pattern*
: list packages with patterndnf upgrade
: upgrade/update all packages-v
: verbose--exclude=kernel*,*nvidia*
: exclude some packagesdnf autoremove
: remove unused packagesdnf clean all
: clear cached packagesdnf history
: show dnf historydnf repolist all
: list reposdnf config-manager --add-repo [some_repo.repo]
: add repodnf config-manager --set-enabled [repo]
: enable repodnf config-manager --set-disabled [repo]
: disable reporm /etc/yum.repos.d/[repo]
: remove repodnf repository-packages [repo] list --installed
: list all packages installed from specific repodnf provides [file]
: find package that provides a filednf repoquery -l [package]
: list files in packagednf repoquery --requires [package]
: list dependencies of packagednf repoquery --whatrequires [package]
: list packages that depends on a packagesystemctl status [service]
: get status of servicesystemctl enable [service]
: enable service at bootsystemctl disable [service]
: disable service at bootsystemctl start [service]
: start servicesystemctl stop [service]
: stop servicesystemctl restart [service]
: restart servicesystemctl list-units
: list services runningpip list
: list installed python libspip install --user [lib]
: install python libpip install --user -r requirements.txt
: install all python libs in requirements filepipreqs requirements.txt
: create requirements.txt for current projectpython -m http.server
: run HTTP serverpython -m venv [venv]
: create venvsource [venv]/bin/activate
: enable venvpip freeze > requirements.txt
: create requirements.txtdeactivate
: disable venvrm -rf [venv]
: remove venv?