Check .bashrc to ensure .bash_aliases is referenced

add an alias to .bash_aliases

restart bash using exec bash


echo all the files that end in .txt

echo *.txt

echo all files that start with a .

echo .*

This shows the . and .. files, show all other files using this:

echo .??*


find all the instances of the word root in the file /etc/passwd

grep root /etc/passwd

find the word root in every file in the directory /etc/

grep root /etc/*


change your password using the passwd command

shell variables

explore shell variables

echo $heart

restart the shell to clear variable

exec bash

Command-Line keystrokes

ctrl -B Move the cursor left

ctrl -F Move the cursor right

ctrl -P View the previous command (or move the cursor up)

ctrl -N View the next command (or move the cursor down)

ctrl -A Move the cursor to the beginning of the line

ctrl -E Move the cursor to the end of the line

ctrl -W Erase the preceding word

ctrl -U Erase from cursor to beginning of line

ctrl -K Erase from cursor to end of line

ctrl -Y Paste erased text (for example, from ctrl -U)

man -k

search manual keyword pages for the command you want

man -k diff
man -k sort
man -k search
man -k mysql


see users on the system


which directory is python3 in? nodejs?


view proc info

head /proc/cpuinfo

redirect proc info to proc.txt

head /proc/cpuinfo > proc.txt

cat the tail proc info

tail /proc/cpuinfo >> proc.txt

tail a file as it gets stuff appended to it

tail -f brothers.txt


common ps idiom

ps aux

show all running processes

ps x

show all processes on the system, not just ones you own

ps ax

include more detailed information on process

ps u

show full command names

ps w

background processes

run a script in the background

python3 &


find the pid using ps

kill pid


changemode key: 421 = RWX

chmod 666 file.txt

symbolic link

create a symbolic link, -s for symbolic

ln -s target linkname
ln -s /var/www/html/project1 laravel_project

set pwd to a shell variable

echo $DIRVAR

check dpkg

pipe it into less

dpkg --list | less