Commands Basics

Help commands

$ man <command> # man page

$ whatis <command> # whatis

$ <command> -h # option -h

Environment variables

Create variable in shell

$ <env_var>="var_value" $ export <env_var>

Define vairable in bash configuration file

export <env_var>="var_value" # add the setting to ~/.bashrc

source ~/.bashrc # load new environment variables to shell

Print variable

$ echo $<env_var> $ printenv <env_var>

History commands

$ history # check recent commands

$ history | grep <string> # find previous command with specific string

Directory change

$ pwd # check current directory

$ cd ~ # go to home directory

$ cd - # go to previous directory

$ cd .. # go to parent directory

Download from the internet

$ wget <url>

$ curl <url>