The values in /etc/profile are set for every user. After that file has been accessed,
the login routine then takes the user into the user's home directory and looks for
each of the three other user specific files: .bash_profile, .bash_login, and .bashrc.
The .profile file exists within the user's home directory and is executed upon each
login. Placing the entry here will allow this action to take place only for this user,
while placing it in /etc/profile would make it applicable for all users.
The .bashrc file is used to pass variables between shells and would not run only
when a login takes place.
You could use either ~/.bashrc or ~/.profile. ~/.bashrc stores shell preferences
for individual users. ~/.profile stores configuration preferences similar to
/etc/profile, but for individual users.
/etc/profile stores system-wide configuration commands and is used primarily to
set environment variables
~/.bash_logout stores commands that execute when a user logs out.
Login shells execute the configuration scripts they use in the following
2. ~/.bash_profile (If this file is found, the shell does not look for additional
configuration script files)
3. ~/.bash_login (If this file is found, the shell does not look for additional
configuration script files)
4. ~/.profile (This file only executes in the absence of the preceding two)
In this scenario, you should edit ~/.bash_login . ~/.bash_login stores commands
that execute when a user logs in.
~/.profile stores configuration preferences primarily to set environment variables
for individual users. ~/.bash_logout stores commands that execute when a user
logs out. ~/.bash_log does not exist.
alias sysmesg="tail -f /var/log/messages" creates an alias named sysmesg . An
alias is a custom command that performs a specific action. In this example, when
the user types sysmesg at the command prompt, the tail -f /var/log/messages
command will execute.
All other options are incorrect and will not create the shortcut, but instead will
return an error. Use export to export a user-defined variable to make it available
to child sessions. Use env to display the values for environment variables applied
to child sessions.
env alias="tail -f /var/log/messages"
export alias="tail -f /var/log/messages"
export alias sysmesg="tail -f /var/log/messages"
alias sysmesg="tail -f /var/log/messages"
Use the export COMP=1745 command to set the variable. The set command will
not work, nor will simply typing COMP=1745 . The set command simply sets a
variable to a value while the export command makes the variable available for
other shell programs.
set COMP to 1745
Use the env utility to display a list of all the environment variables and their
The PATH environment variable contains the directory prefixes used to search for
programs and files. Use a colon to separate entries in the PATH variable.
HISTFILE specifies the filename where past commands are stored. PS1 specifies
the characters the shell uses to indicate normal user ($), root user (#) and similar
items. PWD contains the path of the current working directory.
It specifies the filename where past commands are stored.
It contains the path of the current working directory.
It contains the directory prefixes used to search for programs and files.
It specifies the characters the shell uses to indicate normal user ($), root user (#) and similar items.
A colon separates entries in the PATH statement, so one must be added to the end
of the existing PATH ($PATH), and then the new directory specification appended.
Using the absolute path, /sbin/special, identify the path to the directory you want
Entering the alias command at the shell prompt will display a list of the currently
defined aliases on the system.
The ll command is actually a commonly predefined alias that runs the ls -l
command--to list the contents of a directory in long form.
To make an alias persistent you would add the command defining the alias to the
appropriate shell configuration file. The name of the shell configuration file varies
across Linux distributions. For example, in the Fedora distribution, the shell
configuration file is the .bashrc hidden file, found in each user's home directory.
Add the command defining the alias to the $ALIAS environment variable.
Add the command defining the alias to the /etc/default/alias.conf file.
Use the alias command at the shell prompt with the -P option.
Add the command defining the alias to the appropriate shell configuration file.
The user mbrown would enter the following command in her shell configuration
alias logcheck="cd /home/mbrown/logs;ls -al"
The two commands need to be inside quotes and separated by a semi-colon (;).
The /etc/skel directory contains a set of configuration file templates that are
copied into a new user's home directory when it is created, including the following
選擇要在Apple App Store上查看的Topgrade應用程序。