Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet198/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   194   195   196   197   198   199   200   201   ...   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)

[
 146 
]
An exit code of 
0
 means success; anything else is some sort of error. Different 
programs will attribute different codes to different types of failures, but 
0
 is always 
a success. With this command, what we're actually doing is printing the content of a 
variable. 
$?
 is actually a variable, which in this case only exists to hold an exit code. 
The 
echo
 command itself can be used to print text to the shell, but it's often used to 
print the contents of a variable (we'll get into this in more detail in the 
Understanding 
variables
 section).
Now, it's time for my favorite time-saving trick of them all—command aliases. The 
concept of an alias is simple: it allows you to create a command that is just another 
name for another command. This allows you to simplify commands down to just one 
word or a few letters. Consider this command, for example:
alias install="sudo apt install"
When you enter a previous command, you will receive no actual output. But what 
happens is now you have a new command available—
install
. This command isn't 
normally available; you just created it with this command.
With this new alias created, any time you execute 
install
 on the command line, 
you're instead executing 
sudo apt install
. Now, installing packages becomes 
simpler:
install tmux
Just like that, you installed 
tmux
. You didn't have to type 
sudo apt install tmux

you just simplified the first three words in the command into 
install
. In fact, you 
can simplify it even further:
alias i='sudo apt install'
Now, you can install a package with this:
i tmux
With aliases, you can get very creative. Here are some of my personal favorites:
You can verify that the alias was created successfully by simply 
running the 
alias
 command, which will show you a list of aliases 
present in the shell. If you create a new alias, you should see it in 
the output. You'll also see additional aliases in the output that you 
did not create. This is because Ubuntu sets up some by default. In 
fact, even the 
ls
 command is an alias!


Chapter 6

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   194   195   196   197   198   199   200   201   ...   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