Front | Back |
.filename vs . filename
|
The first is running a file thats been hidden from the 'ls' command. The second option will execute even if it has not been set as an executable with chmod. It will execute in the current shell rather than creating a sub shell, thereby preserving any variables created.
|
If Bash is started as a login shell, what order will it search for files to execute commands from?
|
/etc/profile
~/.bash_profile ~/.bash_login ~/.profile |
If Bash is started as a non-login shell, what order will it search for files to execute commands from?
|
/etc/bash.bashrc
~/.bashrc |
Bash -c
|
If the -c option is present, then commands are read from string. If there are arguments after the string, they are assigned to the positional parameters, starting with $0
|
Bash -i
|
If the -i option is present, the shell is interactive.
|
Bash -l
|
Make bash act as if it had been invoked as a login shell
|
Bash -r
|
If the -r option is present, the shell becomes restricted
|
Echo -n
|
Do not output the trailing newline
|
Echo -e
|
Enable interpretation of backslash escapes
|
Env
|
It is used to either print a list of environment variables or run another utility in an altered environment without having to modify the currently existing environment. Using env, variables may be added or removed, and existing variables may be changed by assigning new values to them.
|
Env -i
|
start with an empty environment
|
Env -u
|
Remove variable from the environment
|
env DISPLAY=foo.bar:1.0 xcalc
|
Launch the X Window application xcalc and have it appear on a different display
|
Exec
|
Replaces the current process image with a new process image
|
Export
|
Make the local shell variable VAR global.
|