TL;DR
pwd
: What is your terminal’s current directory?ls [-l] [-a] [path]
: List Files in [path]cd [path]
: Change Directory to [path]man [command]
: View command documentation in an interactive reader, up and down arrow to scroll. Q to exit./home/kali/folder1/folder2
: Absolute File Path; this will never change.~/folder1/folder2
: Absolute File Path, relative to home directory. This shouldn’t change unless your home directory changes.folder1/folder2/
: Relative File Path, this depends on which folder you are in (seepwd
).
- TL;DR
- What the Shell?
- Flags and Switches, Tacks and Dashes
- Moving around
- Print the Working Directory (Click to Open)
- List Files
- Change Directory
- Getting Help
- The Linux Manual
- Explainshell.com
- Google
What the Shell?
Your window into the world of the Linux operating system originals from the shell in which you enter commands and read output from different commands ran. There are many different shells out there on different operating systems, below are some examples:
- Bourne Shell, or
sh
or/bin/sh
: One of the OG shells inherited from UNIX, the source material for Linux. It isn’t really used often for entering commands, but works great as a scripting language, and you’ll still find them today with scripts ending in.sh
. - Bourne-again Shell, or
bash
or/bin/bash
: Created to replacesh
, bash is a robust shell with many improvements to the original, with tab completion, history, customization, aliases, variables, and jobs. This is the default shell on most Linux Distributions. - Z-Shell or
zsh
or/bin/zsh
: The shiny new kid (1990) on the block, based onsh
, offers more improvements to customization, tab completion and history along with taking quality-of-life features from other shells likebash
,ksh
, andtcsh
. There is also a community behindzsh
called “oh my zsh” (linked below) which offers installation and configuration scripts for managing yourzsh
shell. Z-Shell is the default shell for your Kali Linux.
Flags and Switches, Tacks and Dashes
Before we start getting into commands, you need to understand Flags, Switches, Tacks, and Dashes. They all are different ways of saying the same thing, so I’ll call it flags for the rest of this tutorial but do keep in mind that they are the same thing, most people use them interchangeably, They are ways of telling the computer to modify how a command is done.
Take, for example, the “list files” command, ls
. By itself, it just lists all your folders and files with spaces in between (example pulled from here).
Okay, that’s great, but can’t we get more information? We can, by telling ls to give us more through flags. If you add the -l
flag (pronounced ”tack-el” or “dash-el”) to the end, we tell ls
to list it in LONG format with more information.
Don’t worry about what each of the columns mean, you’ll learn about that lower on this page and in the next section going over permissions, just remember that flags change how the command runs and/or outputs data, and may possibly require you to specify what you want to change it to, “arguments”.