Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet193/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   189   190   191   192   193   194   195   196   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 142 
]
At this point, you can copy and paste a command you've used previously from this 
list to run it again. In fact, there's an even easier way. Do you notice the number on 
the left of each command? We can utilize that number to quickly recall a previously 
used command. In my screenshot, item 
563
 is where I ran 
sudo apt update
. If I 
wanted to run that same command again, I can simply enter the following command:
!563
In this case, I typed just four characters, and I was able to recall the previously used 
command, which performs the same action as typing this:
sudo apt update
That saves a lot of typing, which is great because we administrators want to type as 
little as possible (unless we're writing a book).
Let's look at a few additional history commands we can use. First, if we want to 
delete something from the history, we can simply do this:
history -d 563
In this example, we deleted item 
563
 from Bash's history. To delete a different history 
entry, simple replace 
563
 with whatever the number is for the item we would want to 
remove. You may be wondering why deleting something from the history would be 
necessary. The answer to that is simple: sometimes we make mistakes. Perhaps we 
mistyped something, and we don't want a junior administrator to look at the history 
and rerun an invalid command. Worse, if we accidentally saved a password to the 
history, it will be there for all to see. We would definitely want to remove that item 
so that the password isn't saved in plain text in the history file. One very common 
example of this is with MySQL or MariaDB. When you enter the MySQL or MariaDB 
shell, you can use the 
-p
 option and type the password in one line. It would look 
something like this:
mariadb -u root -pSuperSecretPassword
That command may appear useful, because in one command you'd be logged in to 
your database server as 
root
. However, this is one of my pet peeves—I really don't 
like it when people run commands that include a password in the clear. Having 
the 
root
 password in your shell's history is a HUGE security risk. This is just 
one example of something you won't want in our Bash history, though. My main 
goal here is to demonstrate that you should think about security when entering 
commands. If you have a potentially sensitive item in your command history, you 
should remove it. In fact, you can actually enter a command and not have it saved in 
the history at all. Simply prefix the command with a space. If you do, it will not be 
recorded in the history file. Go ahead, give it a try, and see for yourself.


Chapter 6

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   189   190   191   192   193   194   195   196   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish