Home 0P3N Blog Kali Linux Command Lines Part 2 – Working with Directories
Ready to Start Your Career?
Create Free Account
By: bjacharya
January 12, 2016

Kali Linux Command Lines Part 2 – Working with Directories

By: bjacharya
January 12, 2016
By: bjacharya
January 12, 2016
Hi! and welcome to Part 2: Kali Linux Command Line – Working with Directories.

This module is a brief overview of the most common commands for working with directories, like: pwd, cd, ls, mkdir and rmdir. For Video Demo/Lab, on this part, you can follow this link: https://youtu.be/svXodC_eJls

The Commands:

  • pwd: the tool displays your current directory
  • cd: we can change our current directory with the cd command
  • ls: for listing the contents of current directory
  • mkdir; for creating a new directory
  • rmdir: for removing a directory

Symbols for Directories in Kali Linux:

  • Sign '~' means Home Directory.
  • Sign '/' means File System Directory
  • For 'desktop folder' in Kali Linux, we write it as 'Desktop' (notice capital D here)
Enroll today to access these Cyber Security Courses now:
Executing the Commands:

means we're in the home home folder

Write 'cd /'
root@kali:~# cd /
means we changed directory from ~ to /

Write 'ls'
root@kali:/# ls
means it will list/show the content of / directory

Make new folder 'test' in desktop. For that, execute following:
root@kali:/# cd ~
root@kali:~# cd Desktop
root@kali:~/Desktop# mkdir test

New folder, 'test' will be created on the desktop now. To change directory to 'test', use 'cd test', and to list the content 'ls':

root@kali:~/Desktop# cd test
root@kali:~/Desktop/test# ls

To know the working directory, we write 'pwd':
root@kali:~/Desktop/test# pwd

It will o/p 'test' in next line, because we're in a 'test' folder, and pwd prints the working directory.

Now, to remove the directory 'test', execute following:

root@kali:~/Desktop/test# cd Desktop
Means we are changing to Desktop (getting out from 'test)

root@kali:~/Desktop# rmdir test
Means we are deleting 'test' directory

Well, that's the basics of working with directories in Kali Linux. As we move along, we'll  encounter many other useful commands to work with directory. If, you're confused on how to execute these commands, please watch my video tutorial demo/lab here: https://youtu.be/svXodC_eJls

Feedback is sweet, so please provide it via comment :)

Enroll today for a free 7 Day Trial on these Career Paths:
Request Demo

Build your Cybersecurity or IT Career

Accelerate in your role, earn new certifications, and develop cutting-edge skills using the fastest growing catalog in the industry