viernes, 10 de octubre de 2014

Print odd and even lines from a file

sed -n 2~2p filename
will print even-numbered lines from filename
sed -n 1~2p filename
will print odd-numbered lines.

Source: http://unix.stackexchange.com/questions/26723/print-odd-numbered-lines-print-even-numbered-lines

jueves, 9 de octubre de 2014

Create a new user

Type:

useradd username

Set a password:
 
passwd username


To create a new user with directory add -m option

Set up bash as default shell

chsh -s /path/to/shell {user-name}

$ which bash (to kwnow the path to bash)

Source: http://www.cyberciti.biz/faq/howto-set-bash-as-your-default-shell/