| Chapter 1: Foundations of Kali Linux




Download 22,59 Mb.
Pdf ko'rish
bet22/225
Sana14.05.2024
Hajmi22,59 Mb.
#232856
1   ...   18   19   20   21   22   23   24   25   ...   225
Bog'liq
learningkalilinux

16 | Chapter 1: Foundations of Kali Linux


File and Directory Management
To start, let’s talk about getting the shell to tell you the directory you are currently in.
This is called the 
working directory
. To get the working directory, the one we are cur‐
rently situated in from the perspective of the shell, we use the command 
pwd
, which
is shorthand for 
print working directory
. In 
Example 1-1
, you can see the prompt,
which ends in #, indicating that the effective user who is currently logged in is a
superuser. The # ends the prompt, which is followed by the command that is being
entered and run. This is followed on the next line by the results, or output, of the
command.
Example 1-1. Printing your working directory
root@rosebud:~# 
pwd
/root
When you get to the point where you have multiple machines,
either physical or virtual, you may find it interesting to have a
theme for the names of your different systems. I’ve known people
who named their systems for 
The Hitchhiker’s Guide to the Galaxy
characters, for instance. I’ve also seen coins, planets, and various
other themes. For ages now, my systems have been named after
Bloom County
characters. The Kali system here is named for Rose‐
bud the Basselope.
Once we know where in the filesystem we are, which always starts at the root direc‐
tory (/) and looks a bit like a tree, we can get a listing of the files and directories. You
will find that with Unix/Linux commands, the minimum number of characters is
often used. In the case of getting file listings, the command is 
ls
. While 
ls
is useful, it
only lists the file and directory names. You may want additional details about the
files, including times and dates as well as permissions. You can see those results by
using the command 
ls -la
. The 
l
(ell) specifies 
long
listing, including details. The 
a
specifies that 
ls
should show 
all
the files, including files that are otherwise hidden.
You can see the output in 
Example 1-2
.
Example 1-2. Getting a long listing
root@rosebud:~# ls -la
total 164
drwxr-xr-x 17 root root 4096 Nov 4 21:33 .
drwxr-xr-x 23 root root 4096 Oct 30 17:49 ..
-rw------- 1 root root 1932 Nov 4 21:31 .ICEauthority
-rw------- 1 root root 52 Nov 4 21:31 .Xauthority
-rw------- 1 root root 78 Nov 4 20:24 .bash_history
-rw-r--r-- 1 root root 3391 Sep 16 19:02 .bashrc

Download 22,59 Mb.
1   ...   18   19   20   21   22   23   24   25   ...   225




Download 22,59 Mb.
Pdf ko'rish