Search Flipkart

Tuesday, June 28, 2011

Changing $PS1 in Linux Mint

Changing $PS1 in Linux Mint:::

By default Linux mint has

$PS1=${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]

for the normal user..

The problem lies in w where shows the full directory PATH ..
If u like showing full path then leave it as it is .
And if don't like showing full path and find less space or your commands then CHANGE this to W then it will show only directory name not the full PATH NOW the new
$PS1=${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \W \$\[\033[00m\]

to make changes to $PS1 you have to make change in the file /etc/bash.bashrc

Wednesday, June 15, 2011

Encryption of files in linux

The easiest way to encrypt a file in linux is to use some tool {openssl is very easy to use}....

1. To encrypt a file:
openssl des3 -salt -in inputfile.txt -out encryptedfile.txt

2. To decrypt the file
openssl des3 -d -salt -in encryptedfile.txt -out originalfile.txt

these action will require a password give the strength according to your needs...

OR u can use gpg as..

1. encryption
gpg -c inputfile.txt
This will generate a file inputfile.txt.gpg {this will be your encrypted file}
2. To decrypt the file
gpg -d inputfile.txt.gpg (output to stdout)
gpg -o file -d inputfile.txt.gpg (output to file)