Note: If in need of a lightweight Linux distro, consider Xubuntu. An online Fedora 33 bash emulator can also be found at bellard.org/jslinux, although it does not contain all of the commands in this repository. For some sample bash networking scripts, see this repo.
bash Commands:
Command | Purpose | Category |
---|---|---|
apt-get | Package managing utility, such as for adding, removing, and updating packages. | Packages |
awk | [see 'gawk' command] Original interpreter of the AWK programming language. | Text |
blkid | Locates and prints block device attributes. | Drives/Devices |
cat | Concatenates files. Prints using standard output stream. | Text |
cd | Changes directory. | Files/Directories |
chgrp | Changes group ownership association. | Permissions |
chmod | Changes file permissions for users, groups, and others. | Permissions |
chown | Changes file owner and group owner. | Permissions |
compress | Reduces file size using Lempel-Ziv algorithmic logic. | Compression |
cp | Copies files and directories as specified. | Files/Directories |
cpio | Copies files in and out of archives via copy-in and copy-out modes. | Compression |
cron | Executes/runs commands as scheduled. | Processes |
curl | Utility to transfer data (URL) to/from a server. | Data Transfer |
cut | Removes specified sections from each text input line. | Files/Directories |
dd | Copies and converts files, and can backup disks. | Files/Directories |
df | Displays 'disk free'/space usage of filesystems. | Drives/Devices |
diff | Performs a line-by-line comparison of files. | Files/Directories |
dnf | 'Dandified YUM'. Package manager for Fedora, RHEL, and CentOS. | Packages |
du | Displays disk space usage for directories and files. | Drives/Devices |
echo | Displays strings using standard output stream. | Text |
exit | Invokes normal termination of process/task. | Processes |
fdisk | Utility for creating and modifying partition tables. | Drives/Devices |
file | Returns file data type. | Files/Directories |
find | Scans directory hierarchy for files. | Files/Directories |
ftp | Enables usage of File Transfer Protocol. | Data Transfer |
gawk | [see 'awk' command] The GNU implementation (for scanning and processing) of the AWK pattern programming language in GNU. | Text |
getfacl | Retrieves file names, owners, group owners, and Access Control List permissions. | Permissions |
grep | Searches input files for lines that match a specified pattern. | Text |
gunzip | Decompresses files generated by zip, gzip, compress, and pack. | Compression |
gzip | Reduces file size using the LZ77 lossless compression algorithm. | Compression |
head | Outputs first lines of file (10 by default). | Text |
history | (The GNU history command) Recalls commands previously entered in session. | Processes |
hwinfo | Displays information about system hardware. | Drives/Devices |
kill | Sends terminate signal to process/task. | Processes |
less | [see 'more' command] plus enables user to scroll backwards. | Text |
locate | Retrieves file (by file name). | Files/Directories |
ln | Creates links between files. | Files/Directories |
ls | Displays (lists) the contents of a specified directory. | Files/Directories |
lsblk | Displays information about block devices. | Drives/Devices |
make | Automation tool for recompiling parts of large programs by using makefiles. | Files/Directories |
man | Documentation for commands, functions, system calls, and other features. | Documentation |
mkdir | Creates directories. | Files/Directories |
more | Allows for paging through text output one screen at a time. | Text |
mount | Attaches file system of a drive to a target directory. | Drives/Devices |
mv | Moves/renames files (similar to a cut/paste of files). | Files/Directories |
nano | Launches the GNU nano text editor. | Text |
parted | Partitions and resizes disks. | Drives/Devices |
patch | Modifies file based on source (patch) file instructions produced by the diff utility. | Text |
ping | Sends an ICMP ECHO_REQUEST datagram to a specified destination. | Drives/Devices |
ps | Displays a report on currently running tasks/processes. | Processes |
pwd | Prints working directory to standard output stream. | Files/Directories |
rm | Deletes files or directories. | Files/Directories |
rpm | The Red Hat Packet Manager, commonly used in Red Hat distributions such as CentOS and Fedora. | Packages |
rmdir | Deleted empty directories. | Files/Directories |
rsync | A high-speed utility for remote file copying. | Data Transfer |
scp | Uses ssh data transfer and authentication for remote file copying. | Data Transfer |
sed | Filters and modifies input stream text. | Text |
setfacl | Sets Access Control List permissions for files and directories. | Permissions |
sftp | Enables usage of a secure file transfer protocol using SSH transport encryption. | Data Transfer |
sort | Arranges lines of text for display via the standard output stream. | Text |
ssh | Launches the SSH remote communication protocol. | Data Transfer |
sudo | Allows user to execute commands as the superuser (or another user). | Permissions |
tail | Outputs last lines of file (10 by default). | Text |
tac | Concatenates files. Prints (in reverse) using standard output stream. | Text |
tar | Creates compressed files as a single disk archive or tape, and extracts compressed files. | Compression |
tee | Reads from input stream and writes to output stream/files. | Text |
telnet | Launches user interface for the TELNET remote communication protocol. | Data Transfer |
top | Provides a realtime display of running tasks. | Processes |
touch | Creates blank files and updates file timestamps. | Files/Directories |
umount | Unattaches file system of a drive from a directory. | Drives/Devices |
uncompress | Decompresses files that were compressed by the compress utility. | Compression |
uniq | Detects and omits repeated adjacent lines. | Text |
unzip | [see 'zip' command] Unpackages ZIP files. | Compression |
vi | Launches the vi text editor. | Text |
wc | Outputs byte, word, and newline counts for files. | Text |
wget | HTTPS, HTTPS, and FTP utility for non-interactive web downloads. | Data Transfer |
whereis | Locates manuals and sources/binaries for files. | Files/Directories |
which | Displays absolute path of shell commands. | Files/Directories |
xz | Compresses/decompresses .lzma and .xz files. | Compression |
yum | 'Yellowdog Updater Modified'. A Red Hat based Package Manager. | Packages |
zcat | Displays contents of a compressed file to the command line. | Compression |
zip | Compresses/archives and packages files. PKZIP compatible. | Compression |
bash Keyboard Shortcuts:
Shortcut | Purpose |
---|---|
!! |
Runs the Previous Command |
CTRL + C |
Terminates a Command Process |
CTRL + L |
Clears the Terminal Screen |
CTRL + Z |
Stops (Suspends) a Command Process |
Nano Keyboard Shortcuts:
Shortcut | Purpose | Category |
---|---|---|
Ctrl + O |
Writes File with Specified Name | File Operations |
Ctrl + R |
Inserts Contents of a File | File Operations |
Ctrl + S |
Saves File | File Operations |
Ctrl + X |
Exits Nano Editor | File Operations |
TODO #1: Add a text file for each command, each including use cases and options/arguments.
TODO #2: Add keyboard shortcuts lists for bash terminal, Nano, and vim.