Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet18/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   14   15   16   17   18   19   20   21   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014

Escape Character
Meaning
\\
Output a \
\b
Backspace (back cursor up 1 position)
\n
Newline—start a new line
\t
Tab
\! \$ \& \; \’ \”
!, $, &, ;,
'
and 
"
respectively
TABLE 2.4 
Useful Environment Variables in Bash
Variable
Meaning (Value)
DESKTOP_
SESSION
GUI being used (Gnome, KDE)
DISPLAY
The terminal window being used, denoted as :0.0 if you are logged in 
through a GUI
HISTSIZE
Number of entries retained in the history list
HOME
User’s home directory name
HOSTNAME
Name of computer
LOGNAME
User’s user name
MAIL
Location of user’s email directory
OLDPWD
Last directory visited before current directory (see PWD)
PATH
The list of directories that the interpreter checks with each command
PS1
Specifies the user’s prompt (explained in more detail in Table 2.5)
PWD
The current directory
SHELL
Name of the program being used as the user’s shell (for Bash, this is 
usually /bin/bash)
TERM
The terminal type being used
USER
The user’s username
USERNAME
The user’s name (if provided)


The Bash Shell

51
2.4.3 Aliases
The history list provides one type of command line shortcut. Another very useful shortcut 
is the 
alias
. As with a variable, an alias is an assignment of a name to a value, but in this 
case the value is a Linux command. The command itself can but does not have to include 
options and arguments. To define an alias, use an assignment statement preceded by the 
word alias. The form is
alias 
name
=
command
where 
name
is the alias name and 
command
is the Linux command.
If the command includes any blank spaces at all, the command must be enclosed in 
single quote marks (‘ ’). It is a good habit to always use the quote marks whether there are 
spaces in the command or not.
Aliases are used by users for several reasons:
• To reduce the amount of typing
• So that complicated instructions do not have to be remembered
• So that common typos made by the user can be interpreted correctly
• So that dangerous commands are made safer
To illustrate each of these ideas, we look at some examples
To reduce the amount of typing, if there is a common instruction that a user issues 
often, an alias can be defined. For instance, the command 
cd
..
changes the current work-
ing directory to the current directory’s parent directory (we talk about this in Chapter 3 
if that does not make sense). To reduce the amount of typing, the user may define the fol-
lowing alias:
alias ..
=
'cd ..'
TABLE 2.5 
Escape Characters Available for PS1

Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   14   15   16   17   18   19   20   21   ...   254




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