štvrtok 9. februára 2012

Post install settings 1

Regarding previous post about minimal base install, the next handy steps are to adjust environment we will working through.
1.Change shell:
The default shell in FBSD is "sh". SH is shell with basic functions but nothing more. If you work in CLI often, it's better to use sophisticated shell. 
I use "tcsh" shell for CLI and "bash" for scripting. 
TCSH exists in base install but BASH not. If you want bash, you have install this via ports. (More about installing software in further time).

Changing shell is very simple:
For current user: chsh -s [shell]
Change shell for another user: chsh -s [shell] [username]
Etc. To change my current shell: chsh -s tcsh


Now you can log out and log in back to see the difference.
Before you have made a change, the sign of the shell was "#" what means you are in "sh" shell. Now you should see "%" in prompt line what means "tcsh" shell. 

Some ways to verify the current shell:
echo $SHELL
cat /etc/passwd (see end of line for particular user)
cat /etc/master.passwd (see end of line for particular user)


More about shells you can find in handbook

2.Customize shell prompt
As you can see, "%" at the beginning of the prompt doesn't seem nice and you can't list of possible commands by pressing TAB key.  Next handy trick is using aliases. Alias is CLI shortcut for whatever command.


Change your current directory to "home" (press cd).
By "ls - la" you should see file ".cshrc". Dot means something like hidden file. 
".cshrc" is configuration file for "csh" shell which is similar to "tcsh" shell.
Copy ".cshrc" to ".tcshrc" because we use "tcsh" shell.
Now you can edit ".tcshrc" for example with "vi" editor.
(Adjustment of vi editor in further time)
So what we are going to do:


1.Aliases etc.:
alias [shortcut] [command]
alias df /bin/df -h
alias cl /usr/bin/clear
alias re rehash
alias etc cd /etc
alias shut /sbin/shutdown -p now
and so.....what you want


2.Autolist:
In "if" section of the file (it should work placed anywhere) add:
set filec
set autolist


For apply the change, log out and log in back. Now press TAB key, and you should see suggestions. It works for commands suggestions and list of files suggestions. It's very helpful.


See the continue of this article.
 

Žiadne komentáre:

Zverejnenie komentára