Tar & UnTar

untar .gz file

tar xzvf tarname.tar.gz

untar .tar file

tar -xvf filename.tar

tar a folder and sub folders

tar -cvvf foo.tar foo/

Finding files

sudo find / -name ‘filename’ -type d

Service Running on Particular Port

  • cat /etc/services | grep 60000

Searching in Files

  • grep “text string to search” directory-path
  • For recursively
grep -r “redeem reward” /home/tom


sudo chown -R  vclub:users vclubcms/


sudo chmod -R 750 locale/

List of packages

dpkg –get-selections | grep curl


ubuntu ram size check

grep MemTotal /proc/meminfo


Installing LAMP


Select LAMP Server , click OK

Installing PHPMYadmin

update the apt repositiory by apt-get update

$apt-get install phpmyadmin

Install webmin

    1. sudo emacs /etc/apt/sources.list
    2. Add the following lines
    3. deb http://download.webmin.com/download/repository sarge contrib
      deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
    4. Save and exit the file
    5. Now you need to import GPG key
    6. wget http://www.webmin.com/jcameron-key.asc
    7. sudo apt-key add jcameron-key.asc
    8. Update the source list : sudo apt-get update
    9. Install webmin
    10. sudo apt-get install webmin
    11. Now you need to access webmin using https://serverip:10000/
  1. Login by root password.
  2. Create new user
  3. change the shell to /bin/bash for new user and www-data
  4. for new user secondary group to sudo
  5. By following this process when tried to login by newuser by putty gives following error
    1. Network error: Connection refused
    2. reboot the system.

ls command

display page by page

ls -l | more
ls -t | more
ls -t output_PaymentRQ_* | more

can use less by that we can move up and down .
we can use less and more without pipe.
ls –help

creating sym link

ln -s /media/ExternDrive moreFilesLink


Running password with sudo

echo “password” | sudo -S command_to_run
echo “password” | sudo -S python manage.py compilemessages

escape shell special characters in a string

$ var=’; echo gotcha!’
$ eval echo hi $var


rename file name

rename ‘s/^view//’ .py

Shell Scripting

mydir=$(dirname $0)
export PYTHONPATH=$mydir
export DJANGO_SETTINGS_MODULE=vclubcms.settings
cd $mydir
echo ‘done’ >> $mydir/output.txt | echo “bij897jib” | sudo -S python $mydir/manage.py compilemessages –settings=vclubcms.settings
echo “password” | sudo -S touch $mydir/apache/django.wsgi
cd /var/www




About rahul23134654

Hi, I am Rahul Meha , B.E. in (I.T.)
This entry was posted in Ubuntu/Linux. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s