Wednesday, January 6, 2010

Linux Commands

Linux Commands I Hardly Knew


Ubuntu
How To Enable Vi Syntax Highlighting In Ubuntu
sudo apt-get remove vim-tiny
sudo apt-get install vim
sudo vi /etc/vim/vimrc
( Remove the quote mark from the "syntax on" line, uncommenting it)

Adding Environment variables...

$ echo 'export GOROOT=$HOME/go' >> ~/.bashrc
$ echo 'export GOOS=linux' >> ~/.bashrc
$ echo 'export GOARCH=386' >> ~/.bashrc
$ echo 'export GOBIN=$GOROOT/bin' >> ~/.bashrc
$ echo 'export PATH=$PATH:$GOBIN' >> ~/.bashrc
$ . ~/.bashrc

You can source the files instead of restarting the machine:
source /etc/profile
source ~/.bashrc

ALLOWING OTHER USERS TO RUN SUDO

By default, only the user who installed the system is permitted to run sudo. To add more administrators, i. e. users who can run sudo, you have to add these users to the group 'admin' by doing one of the following steps:

sudo adduser username admin

To enable the root account (i.e. set a password) use:

sudo passwd root

Afterwards, edit /etc/sudoers and comment out the line

%admin ALL=(ALL) ALL

to disable sudo access to members of the admin group.

No comments:

Post a Comment