How to show line numbers with vi ?

:set number

Advertisements

How to change time zone on ubuntu – linux ?

It is very easy to change the timezone on your Ubuntu desktop or server system when using the command line. Debian-based versions of Linux, like Ubuntu, make this task as easy as reconfiguring a package via the package management system. To change the timezone on your Ubuntu system, execute the following in a terminal as root:

dpkg-reconfigure tzdata

The package tzdata should already be installed but in case it isn’t just install it by running the following command as root:

apt-get install tzdata

When reconfiguring tzdata, you will be taken to a screen where you will be required to select your general geographic location from a list as shown in the screenshot below:

from:

http://www.tutorialarena.com/blog/change-timezone-on-ubuntu-using-the-command-line.php

How to compress files while using linux terminal with tar via ssh ?

You can use tar:

“tar -zcvf archive.tar.gz folder/”

-z: Compress with gzip

-c: Create archive

-v: Display progress

-f: filename

For extracting archive:
“tar -zxvf archive.tar.gz -C /extractionpoint”

 

For more detailed info:

-C Directory Causes the tar command to perform a chdir subroutine to the directory specified by the Directory variable. Using the -C flag allows multiple directories not related by a close common parent to be archived, using short relative path names. For example, to archive files from the /usr/include and /etc directories, you might use the following command:

tar -C