Thursday, January 27, 2011

BASH Basics

1. cd - go to the default user folder (build in command)
2. /etc/profile - system wide enviroment and startup programs for login setup(main configuration file)
to view file "less profile"
 In "profile" file you can find : 
 - mail directory /var/spool/mail/$USER
 - USER ID
 - HOST NAME
 - HISTORY SIZE
3. /etc/bashrc contain functions and aliases, logic about a user that performs on a system 
"profile" and "bashrc" critical files that controls the bash enviroment
4. file that begin with "." are hidden files
5. /etc/skel/.bash_logout - when you logout all the things are specified in
6. /etc/skel/.bash_profile - settings that apply to a certain user
7. ~ user default folder
8. pwd - print working directory
9. "which bash" - finds /bin/bash
10. echo $test - print variable $test
11. passwd user - change password to user
12. echo $USER or whoami - print the current user
13. set - system variables
14. set | grep HOSTNAME
HOSTNAME=computer name
15. printenv - variable available on the system
16. env | grep VARIABLE - prints VARIABLE
17. grep TESTVAR .bash_profile - prints TESTVAR
18. echo $? - returns status of the previous command 0 for GOOD and 1 for BAD

No comments:

Post a Comment