Linux Basics
◾
45
Displaying the Contents of a File
cat password.txt
This command lists the contents of the passwords file.
Creating a Directory
mkdir directoryname
The process is the same as in Windows.
Changing the Directories
cd/pentest/enumeration
Changing the directories is very simple. It works as in Windows. However, we use /
in Linux
instead of \ for changing the directories.
Windows
C:/windows/settings
Linux
/pentest/web/scanners
Creating a Text File
touch hack.txt
This command creates a text file with the name hack.txt.
Copying a File
Cp
source target
cp /var/www/filename /pentest/web/filename
This command will copy the file from the
/var/www
directory to the
/pentest/web/
directory.
Current Working Directory
pwd
This will return the current working directory.
Renaming a File
mv oldfile.txt newfile.txt
46
◾
Ethical Hacking and Penetration Testing Guide
There is no command specifically for renaming files inside Linux; however,
you just need to issue
the mv command to rename the file.
Moving a File
mv hack.txt/pentest/enumeration/
This command will move the file hack.txt to the /pentest/enumeration directory.
Removing a File
rm file name
This
is very simple, and it works for directories in the same way.
Dostları ilə paylaş: