Print a line of text.
dev
Syntax: echo [OPTIONS] [STRING...]
Examples
echo $PATH
echo 'deb [arch=amd64] https://...' | sudo tee /etc/apt/sources.list.d/extra.list
echo -n 'no newline'
Mark shell variables for child processes.
dev
Syntax: export NAME[=VALUE]...
Examples
export NODE_ENV=production
export PATH=$HOME/bin:$PATH
export -p | grep AWS
Run a command in a modified environment.
dev
Syntax: env [OPTIONS] [NAME=VALUE...] [COMMAND]
Examples
env | sort
env -i HOME=$HOME PATH=$PATH bash --noprofile
env PYTHONPATH=./src python app.py
Define command shortcuts in the shell.
dev
Syntax: alias NAME='VALUE'
Examples
alias ll='ls -la'
alias k='kubectl'
unalias ll
💡
Pro Tip: Put aliases in ~/.bashrc; they don't apply in non-interactive scripts.
Execute commands from a file in the current shell.
dev
Syntax: source FILE (or . FILE)
Examples
source ~/.bashrc
source venv/bin/activate
. ./env.sh
Show shell command history.
dev
Syntax: history [OPTIONS]
Examples
history | tail -20
history | grep ssh
!42 # rerun command 42
Ctrl+r # reverse search
Schedule recurring jobs for the current user.
sysadmin
Syntax: crontab [OPTIONS]
Examples
crontab -e
crontab -l
crontab -r # remove all (careful)
# 0 2 * * * /opt/backup.sh
💡
Pro Tip: Use absolute paths and redirect output in cron — environment is minimal.
Cron daemon — runs jobs from /etc/crontab and spool.
sysadmin
Syntax: N/A (service)
Examples
systemctl status cron # Debian
systemctl status crond # RHEL
grep CRON /var/log/syslog
ls -la /etc/cron.d/
Schedule a one-time command.
sysadmin
Syntax: at [OPTIONS] TIME
Examples
echo '/opt/report.sh' | at 02:00 tomorrow
atq
atrm 3