KALI LINUX 101: A BEGINNER’S GUIDE

Elizabeth Ekedoro
7 min readJan 14, 2024

If you’ve ever looked at the Linux command line and felt intimidated or confused, you’re not alone! I was there too. This week I took a deep dive and found it to be way more approachable than I expected! that’s why I’m here now. So, let’s take it one step at a time.

Introduction:

In this article, we will explore some basic Linux commands. I understand that transitioning from the Windows operating system or Mac to the Linux command line interface can be confusing and daunting, especially when you are used to the simplicity of double-clicking to open folders (in Linux, folders are called directories). However, mastering Linux terminal commands can boost your system navigation speed and provide an opportunity to enhance your technical skills.

Before We Begin:

Ensure you have VirtualBox and Kali Linux ready. If not, use this step-by-step guide by @GEEKrar to;

Download VirtualBox here: ( https://www.virtualbox.org ) and

Kali Linux here: ( https://youtu.be/M0mBpTPE78k?si=vCEZKXzyRktANEoh ).

If you do not have a PC and you want to try this out, you can

Download Kali Linux on your Android device by clicking either of these easy guides by ( @Haxoid Link Here: https://youtu.be/zcIwIhqT7Pc?si=naLc-PzdvhkLEJGD) or ( @LoiLiangYang Link Here: https://youtu.be/xeGQVQyUIoM?si=FOTR5ycTk9vBqKo4 ).

A quick tour of what Kali Linux looks like:

- Login Screen: Once you start your machine you will be greeted with a login screen as shown below. Go ahead and log in using your username and password.

logging into Kali with my personal account.

-The Desktop: You can now access your Kali Desktop once you sign in.

My Kali Desktop.

-The Terminal: To use Kali, you’ll have to open your Terminal which is the command line interface (CLI) we’ll be using for this guide. To locate this, right-click on your desktop and choose “Open Terminal Here” or click the black box named “Terminal Emulator” at the top left corner (after the Firefox browser) of your Desktop.

My Kali Terminal.

-Note: Kali Linux is case-sensitive! so if you run into issues while doing this, you might want to check again.

Exploring Basic Linux commands:

- The Present Working Directory (pwd): This will display the full path of your location in your current working directory, just like using a map to find your location. To find out how this works,

Run the command: pwd

This will identify your current location in the file system, in my case, it is “/home/Lizettle”

- Checking Your Login with whoami: This will reveal the username of the logged-in user. To find out,

Run the command: whoami

Because I logged in with my personal account, “whoami” displayed my username which is “Lizettle” as shown above.

Listing Contents of Directories:

- list (ls): This is a simple tool for listing files and directories. To find out,

Run the command: ls

“ls” displayed the list of the names of folders in my current Directory

- long listing (ls -l): This is one of the most useful commands for listing files and directories in long format. To find out,

Run the command: ls -l

“ls -l” will give you more information about the contents of your directories, such as name, size, date, time, they were last modified, etc.

- list all (ls -la): This will show hidden files and directories, including those that start with a dot (.) in their names. To find out,

Run the command: ls -la

Notice how the information has expanded? This shows hidden files which “ls” could not reveal

- list human readable sizes (ls -alh): This will display file sizes in a more human-friendly format such as displaying sizes in kilobytes(kb), megabytes(mb), or gigabytes(gb) instead of just bytes. To find out,

Run the command: ls -alh

We can see the bytes have been converted to kilobytes which are easier to read.

- list human readable sizes (ll -h): This will produce same result as (ls -alh) above but in a minimized or shorter version. To find out,

Run the command: ll -h

This showed the same thing as “ls -alh” but in a minimized or shorter form

- Now compare the differences between ls and its additional flags (such as; ls -l, ls -la, ll -h, etc) above!

Telling the Difference Between Files and Directories:

- Firstly, I created an “index.html” file with the “touch” command (you can give your file any name of your choice). To do this,

Run the command: touch index.html , afterward run the ls command.

We can observe the color difference between directories and files. (directories are blue, while files are white) that’s how you know the difference.

- Alternatively, we can use listing of files (ls -F): This will list files and directories in the current directory, with a small forward slash symbol attached to each entry to indicate its type. To find out,

Run the command: ls -F

Notice it adds small forward slashes to each of the directories (colored blue), leaving the file (colored white) unmodified.

Navigating the Linux File System:

- change directory (cd): This is used to move around or change your current working directory in the command line interface. To apply this, simply type cd followed by the name of the directory (eg Documents, Pictures, Downloads) you want to navigate to. To find out,

Run the command: cd Documents/

(you can see it entered the “Documents” folder. You can also choose to move into any of the listed folders you have).

I’m currently in the “Documents” folder

- To check the contents of the “Documents” folder. Use ls

Now you can see a file named “index.html” in the “Documents” folder
If you ever forget what directory you’re in, you can always run the command: “pwd” command as shown in the image

Moving Up a Directory:

cd .. Moves up one level in the directory hierarchy from your current location. For example, in the image below, my current directory before I used “cd ..” was “Desktop/Elizabeth1/Elizabeth2/Elizabeth3”. To find out,

I ran the command: cd .. and it took me to “Desktop/Elizabeth1/Elizabeth2” directory which is one level up.

From “Desktop/Elizabeth1/Elizabeth2/Elizabeth3” to “Desktop/Elizabeth1/Elizabeth2”

cd ../.. Moves up two levels in the directory hierarchy from your current location to the parent directory. For example, in the image below my current directory before I used “cd ../..” was “Desktop/Elizabeth1/Elizabeth2”. To find out,

I ran the command: cd ../.. and it took me to “Desktop” directory which, is two levels up.

From “Desktop/Elizabeth1/Elizabeth2” to “Desktop

cd ../../.. Moves up three levels in the directory hierarchy from your current location to the grandparent directory. For example, in the image below my current directory before I used “cd ../../..” was “Desktop” To find out,

I ran the command: cd ../../.. and it took me to “root ( / )” level, which is three levels up.

Because I did not create many folders, moving up three levels took me from “Desktop” back to the root ( / ) level

Navigating to the Root:

- Root ( / ): This is the highest-level directory in a file system which is represented with the forward slash ( / ). To move back to the root level from anywhere in the file system,

Run the command: cd /

The root directory is represented with the forward slash “ / “ as shown in the image

- Run ls to see several folders related to the operating system.

You can see the list of folders found in the root directory.

Note: you may explore any of the listed folders in the root directory.

  • For this guide, I chose the userusr” folder and ran the first command: cd usr/
/usr stands for user and contains programs, binaries (bin), libraries (lib), etc

-Afterward, I used ls as seen in the image above to get a basic list of contents in the “Usr” folder and I ran ls -alh to expand the information. Depending on what you are looking for, you can use any of the “ls” flags as covered in the “Listing Contents of Directories” section above.

Quick Navigation:

This comes in handy if one needs to navigate into other directories without knowing the full file path or address. For example, if I want to move into the “Documents” directory or folder and I cannot remember the full file path: home/Lizettle/Desktop/Documents. I’ll use;

cd / followed by

cd ~/Documents to reach “Documents” quickly

Our current directory changed to “ /Documents “ as seen in the image

Here’s a breakdown of what the command “cd ~/Documents” means:

cd: changes your directory.

~ (Tilde): a shortcut that represents your home directory.

Documents: is the directory name you want to navigate to.

These basic commands are your foundation for essential tasks in Kali Linux. Take your time, practice, and get comfortable with pwd, ls, cd, touch. If you need a guide, you can send me a message here: https://www.linkedin.com/in/ekedoro-elizabeth

Stay tuned for my next article where we’ll be covering the modification of files and directories ranging from creation, renaming, copying, and removing.

Good luck, and happy navigating your file system!

--

--

Elizabeth Ekedoro

SOC Analyst | Cybersecurity Technical Writer/Researcher | GFACT | SANS CTA | BTL1- Gold Coin | ISC ² CC | CyberGirls Alumna | Featured in GlobalSecurityMagazine