Birmingham mumbai



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

[
 147 
]
View the top 10 CPU consuming processes:
alias cpu10='ps -L aux | sort -nr -k 3 | head -10'
View the top 10 RAM consuming processes:
alias mem10='ps -L aux | sort -nr -k 4 | head -10'
View all mounted filesystems, and present the information in a clean tabbed layout:
alias lsmount='mount |column -t'
Clear the screen by simply typing 
c
:
alias c=clear
What other aliases can you come up with? Think of a command you may use on a 
regular basis and simplify it.
There's one issue though, and that is the fact that when you exit your terminal 
window, your aliases are wiped out. How do you retain them? That leads me into 
my next productivity trick, editing your 
.bashrc
 file. This file is present in your 
home directory and is read every time you start a new terminal session. You can add 
all of your 
alias
 commands there; just add them somewhere in the file (for example, 
at the end). You will need to include the entire command, beginning with 
alias
 and 
ending with the commands in quotes. If you wanted to steal my example aliases, you 
would enter the following lines somewhere in your 
.bashrc
 file:
alias i='sudo apt install'
alias cpu10='ps -L aux | sort -nr -k 3 | head -10'
alias mem10='ps -L aux | sort -nr -k 4 | head -10'
alias lsmount='mount |column -t'
There are, of course, additional time-saving tricks that we could talk about here, 
but then again, Bash is so complex that we can write an entire book about it (and 
many people have). As we go along in this chapter, I'll give you even more tips. For 
now, here's a final trick, which changes your working directory back to the previous 
directory you were in:
cd -
That simple command was mentioned in 
Chapter 4

Navigating and Essential 
Commands
, but it's worth a second mention—you're welcome! Next, let's take a 
look at shell variables, which allow us to store information for easy access in other 
commands.


Boosting Your Command-line Efficiency

Download 15,21 Mb.

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