Читать книгу Kali Linux Penetration Testing Bible - Gus Khawaja - Страница 38
Manipulating Directories in Kali
ОглавлениеTo print the current working directory, you must use the pwd
command to get the job done (don't mix up the pwd
command with passwd
command; they're two different things):
$pwd
To change the current working directory, you must use the cd
command:
$cd [new directory path]
You can use ..
to traverse one upward directory. In fact, you can add as much as you want until you get to the system root folder, /
:
root@kali:~/Documents# pwd /root/Documents root@kali:~/Documents# cd ../../ root@kali:/# pwd /
As a final hint, for the cd
command, you can use the ~
character to go directly to your current user home directory:
$cd ~
To create a directory called test
in the root home folder, use the mkdir
command:
$mkdir [new directory name]
To copy, move, and rename a directory, use the same command for the file commands. Sometimes you must add the ‐r
(which stands for recursive) switch to involve the subdirectories as well:
$cp -r [source directory path] [destination directory path] $mv -r [source directory path] [destination directory path] $mv -r [original directory name] [new directory name]
To delete a folder, you must add the ‐r
switch to the rm
command to get the job done:
$rm -r [folder to delete path]