Monday, May 30, 2011

Linux+ LX0-101 Exam Notes

Internal Shell Commands
cd - changes directory: cd /*/* - cd ~/ brings you to root directory
pwd - displays current directory
echo - repeats a line of text: echo hello
exec - executes a program: exec calculator
time - shows time for command to execute: time *
exit - terminates any shell
logout - terminates login shells

command completion - completes commands by cycling through options: type part of command then hit tab

Navigating Commands
Ctrl + R searches backwards
Ctrl + S searches forward
Ctrl + G terminates search
Ctrl + A moves to beginning of line
Ctrl + E moves to end of line
Ctrl + left arrow moves back a word
Ctrl + right arrow moved forward a word
Ctrl + K deletes line going forward
Ctrl + X deletes line going back
Ctrl + X then Ctrl + E opens an editor

Typing 'history' displays a history of your commands
history -c clears the history

Environment Variables - Used to use same data across multiple programs
In an example where multiple news readers are used but only one news server the following command would create an environment variable for the one news server:
export NNTPSERVER=news.powerusenet.com

env shows all environment variables
unset * removes the environment variable. For example unset NNTPSERVER