The terminal for Kali Linux has a lot of advantages. Here, we use commands to carry out any task, including reading from or writing to a file. A text-based interface that enables users to enter commands, run them, and view the results is what I refer to as a "command line." Terminal can be launched by searching or, alternatively, by pressing Ctrl + Alt + T.


Here are the basic commands for working with Linux Files or directories


1- pwd (present working directory)

       The working directory that you are currently in is displayed by this command.

       In the below photo, we are in the home directory.

     



2- ls (lists)

       This command displays a complete directory's contents, including all files and subdirectories.

      As you can see in the below picture,



3- touch filename

          A new file will be created by this command. 

In the following example we are creating a new file named hello.html



     

4- mkdir ->

        If the specified directory does not already exist, this command will create it. In the example below, we are making a new directory called New Folder




5- mkdir -p ->

     With this command, nested directories (folder inside folder) will be created. The world directory in the example below is created inside the hello directory, which is inside the example directory




6- cd ->

      To change directories, use this command. In the following example, we are moving to the root directory.




7- rm ->

   This command will delete a file.  In the following example we are deleting a file hello.html




8- rm -f filename ->

       This command forcefully deletes a file. In the following example we are forcefully deleting a file by the name hello.html




9- rm -r directory ->

       This command deletes a directory recursively along with its content. In the following command, we are deleting a directory example along with its content.




10- rm -rf directory ->

       This command forcefully and recursively deletes a directory along with its content. In the following command, we are deleting a directory example with its content.



11- To see the content of the home directory, there are, as far as I know, three ways:

  • ls

  • ls ~(tilde symbol)

  • ls /home/username/     



12-  ls ../

      For going one folder back, we can use the command, as you can see in the given picture:



 The same way, to go back two directories, we can use the command:

                        ls ../..



13- ls -l

  This command will give the details of the files and directories excluding the hidden files and folders.




14- ls -a

   This command shows all the hidden files and folders inside the directories:

  



15- ls -al

   This command shows all the details of the hidden files and folders inside the directories:




16- To know more about the ls command you can type

        man ls