Kali Linux - File Management
Last Updated :
22 Jun, 2020
In Kali Linux, most of the operations are performed on files. And to handle these files Kali Linux has directories also known as folders which are maintained in a tree-like structure. Though, these directories are also a type of file themselves. Kali Linux has 3 basic types of files:
- Regular Files: It is the common file type in Linux. it includes files like – text files, images, binary files, etc. Such files can be created using the touch command. They consist of the majority of files in the Linux/UNIX system. The regular file contains ASCII or Human Readable text, executable program binaries, program data, and much more.
- Directories: Windows call these directories as folders. These are the files that store the list of file names and the related information. The root directory(/) is the base of the system, /home/ is the default location for user’s home directories, /bin for Essential User Binaries, /boot – Static Boot Files, etc. We could create new directories with mkdir command.
- Special Files: Represents a real physical device such as a printer which is used for IO operations. Device or special files are used for device Input/Output(I/O) on UNIX and Linux systems. You can see them in a file system as an ordinary directory or file.
In Unix systems, there are two types of special files for each device, i.e. character special files and block special files. For more details, read the article Unix file system.
You can read more about the
Linux File Management.
Kali Linux follows a specific File hierarchy structure which is just a way of organizing files, filesystems, directories, installed packages, and external devices connected to the system. It basically sets a standard or a base for defining the directory structure.

In Kali Linux File Hierarchy Structure the base or the main directory which contains all the directories is the root directory depicted by a "/".
Managing and Working with Files in Kali Linux
1. To List the Files. In Kali Linux, we use
ls command to list files and directories. To use this enter the following command in the terminal.
ls

This command will print all the file and directories in the current directory.
2. To create a new file. In Kali Linux, we use
touch command to create a new file. To use this enter the following command in the terminal.
touch filename.extension

This command will create a new file named filename.extension.
3. To display the content of a file. In Kali Linux, we use
cat command to display the contents of a file. To use this enter the following command in the terminal.
cat filename.extension

This command will print the content of the filename.extension file.
4. To copy files. In Kali Linux, we use
cp command to copy files and directories. To use this enter the following command in the terminal.
cp old/location/of/file /new/location/of/file

This command will copy file form old location to new location.
5. To move files. In Kali Linux, we use
mv command to move files and directories. To use this enter the following command in the terminal.
mv old/location/of/file /new/location/of/file

This command will move the file form old location to new location.
6. To rename a file. In Kali Linux, we use
mv command to rename files and directories. To use this enter the following command in the terminal.
mv filename.extension new_name.extension

This command will rename the file from filename.extension to new_name.extension.
7. To delete a file. In Kali Linux, we use
rm command to delete files and directories. To use this enter the following command in the terminal.
rm filename.extension

This command will remove/delete the filename.extension from the current directory.
8. To edit a file. In Kali Linux, we use
nano command to edit files. To use this enter the following command in the terminal.
nano filename.extension

This command will open an editor to write to file and after completing the same press
ctrl+o to save the file.
Similar Reads
File Management in Linux In Linux, most of the operations are performed on files. And to handle these files Linux has directories also known as folders which are maintained in a tree-like structure. Though, these directories are also a type of file themselves. Linux has 3 types of files: Regular Files: It is the common file
4 min read
10 Best File Managers For Linux File Managers are something that is required to manage your daily activities quickly. Using file managers, you can copy, move, rename, and delete files, manage space, manage disks, etc. As a user, we all look for an easy and simple file manager to handle these tasks without having any trouble. Mostl
13 min read
Kali Linux Terminal Kali Linux is one of the most widely used operating systems for penetration testing and cybersecurity research. Historically, it is installed on a dedicated system or virtual machine, but what if you were able to use it online? The Kali Linux Online Terminal enables users to execute penetration test
8 min read
Linux File System A file system is a structured method of storing and managing dataâincluding files, directories, and metadataâon your machine. Think of it like a library. If thousands of books were scattered around, finding one would be hard. But in an organized structure, like labeled shelves, locating a book becom
12 min read
System Requirements for Kali Linux Kali Linux is a Linux distribution that is mostly used by cybersecurity professionals, penetration testers, and ethical hackers. Kali Linux offers many of the tools dedicated to various information security tasks such as reverse engineering, security research, penetration testing, computer forensics
6 min read