L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h




Download 7,3 Mb.
Pdf ko'rish
bet77/115
Sana27.11.2023
Hajmi7,3 Mb.
#106243
1   ...   73   74   75   76   77   78   79   80   ...   115
Bog'liq
linuxbasicsforhackers

E XERCISES
Before you move on to Chapter 7, try out the skills you learned from this chapter 
by completing the following exercises:
1. Run the ps command with the aux options on your system and note which 
process is first and which is last.
2. Run the top command and note the two processes using the greatest 
amount of your resources.
3. Use the kill command to kill the process that uses the most resources.
4. Use the renice command to reduce the priority of a running process 
to +19.
5. Create a script called myscanning (to see how to write a bash script, see 
Chapter 8; the content of the script is not important) with a text editor and 
then schedule it to run next Wednesday at 1 
AM
.


7
M A N A G I N G U S E R 
E N V I R O N M E N T V A R I A B L E S
To get the most from your Linux hacking 
system, you need to understand environ-
ment variables and be adept at managing 
them for optimal performance, convenience, 
and even stealth. Among the areas that Linux new-
comers find problematic, however, managing the user 
environment variables might be the most difficult to 
master. Technically, there are two types of variables: shell and environment. 
Environment variables are process-wide variables built into your system and 
interface that control the way your system looks, acts, and “feels” to the 
user, and they are inherited by any child shells or processes. Shell variables
on the other hand, are typically listed in lowercase and are only valid in the 
shell they are set in. To avoid over-explanation, I just cover some of the most 
basic and useful skills for environment and shell variables in this chapter.


72
Chapter 7
Variables are simply strings in key-value pairs. Generally, each pair will 
look like 
KEY=value
. In cases where there are multiple values, they will look 
like 
KEY=value1:value2
. As with most things in Linux, if there are spaces in the 
value, it needs to be contained in quotation marks. In Kali Linux, your envi-
ronment is your bash shell. Each user, including root, has a default set of 
environment variables that determine how the system looks, acts, and feels. 
You can change the values for these variables to make your system work 
more efficiently, tailor your work environment to best meet your individual 
needs, and potentially cover your tracks if you need to.

Download 7,3 Mb.
1   ...   73   74   75   76   77   78   79   80   ...   115




Download 7,3 Mb.
Pdf ko'rish

Bosh sahifa
Aloqalar

    Bosh sahifa



L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h

Download 7,3 Mb.
Pdf ko'rish