The Terminal and Linux commands

The Linux Terminal is pretty much the most powerful interface in the Linux operating system as this is where all the magic happens. Most Linux tools are command-line based. Most penetration testing tools are also command line-based, and this can sometimes be intimidating to new users and people who are just starting in the field of cybersecurity or directly in penetration testing.

The following exercises will help you become a bit more familiar with using the Linux Terminal and commands:

  • To change the password on your current user account, execute the passwd command. Whenever you type passwords on a Linux Terminal/shell, the password itself is invisible.
  • To view your current working directory in the Terminal, use the pwd command.
  • To view a list of files and folders in your current directory, use the ls command. Additionally, the ls –la command can be used to provide a list of all files (including hidden files) with their permissions.
  • To change directory or navigate the filesystem, use the cd command followed by the directory.

The following is a screenshot demonstrating the use of these commands. We can see the current working directory after executing the pwd command, a list of files and folders using the ls -l command, and the option to change the working directory using the cd command:

 

Furthermore, if we have a text file in our directory, we can use the cat command to view its content. Also, we can add additional lines of text to an existing file directly from the Terminal by using the echo "text" >> filename.txt syntax, as shown in the following screenshot. Looking closely, we can see that the ls command was used to show the files on the desktop, the cat command was used to print the content of the Test.txt file on the Terminal, and echo was used to add text:

Using the >> switch will add another line to the existing text file (in other words, insert a new line). However, using a single > will overwrite all the content with the new string, as we can see here:

The Test.txt file now has the most recent string of text.

If you're interested in learning more about Linux, check out the Linux Unhatched and Linux Essentials courses at Cisco Networking Academy: https://www.netacad.com/courses/os-it.

Always remember that the more you practice using a Linux operating system, the easier it is to perform tasks.

Next, we will demonstrate how to find your way around Kali Linux using various utilities.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.216.18