AMAZON

Showing posts with label commands on Ubuntu. Show all posts
Showing posts with label commands on Ubuntu. Show all posts

Saturday, September 1, 2012

Linux / Unix Command: vi, vim, gvim Command Library

Linux / Unix Command: vi, vim, gvim
Command Library

SYNOPSIS

    % vi [options] [file ..]

DESCRIPTION

    The "vi" text editor is not recommended for newbies.
    To exit vi (no changes saved) use these five characters: <ESC>:q!<Enter>.
    vim: Modern Linux distributions use vim (="vi improved") in place of vi, and vim is somewhat better than the original vi.
    gvim: The GUI version of vi is also available: type gvim in an X terminal.
    The most important thing to understand about vi is that is a "modal" editor, i.e., it has a few modes of operation among which user must switch. (The same keystrokes have different effects in different modes.) The quick reference is below, with the 4 essential commands in red.

    The commands to switch modes:

The key
    Enters the mode     Remarks
<ESC>     command mode     (get back to the command mode from any editing mode)
i     "insert" editing mode     (start inserting before the current position of the cursor)

    DO NOT PRESS ANY OTHER KEYES IN THE COMMAND MODE. THERE ARE MORE COMMANDS AND MODES IN THE COMMAND MODE!

    Copying, cutting and pasting (in the command mode):
    v start highlighting text. Then, move the cursor to highlight text
    y copy highlighted text
    x cut highlighted text
    p paste text that has been cut/copied

    Saving and quitting (from the command mode):
    :w write (=save)
    :w filename write the contents to the file "filename"
    :x save and exit
    :q quit (it won't let you if changes not saved)
    :q! quit discarding changes (you will not be prompted if changes not saved)

EXAMPLE

    % vi parse_record.pl

    Starts vi with the default settings and opens file parse_record.pl.

Important: Use the man command (% man) to see how a command is used on your particular computer.

How to download youtube videos on ubuntu 12.10 and lower versions machine

How to download youtube videos on ubuntu 12.10 and lower versions machine

1. You can use terminal-based command :

$ sudo apt-get install youtube-dl
$ sudo youtube-dl --update
$ sudo apt-get install python
$ which youtube-dl
$ youtube-dl --version

Then, to download the youtube-video, simply type :
$ youtube-dl http://www.youtube.com/watch?v=wcVvE-BNWPs

Alternative way (also terminal-based command) :

$ sudo apt-get remove youtube-dl
$ sudo rm /usr/local/bin/youtube-dl
$ sudo wget --no-check-certificate https://github.com/rg3/youtube-dl/raw/2011.02.25c/youtube-dl -O /usr/local/bin/youtube-dl
$ sudo chmod +x /usr/local/bin/youtube-dl
$sudo youtube-dl --update

on some ubuntu machines you might want to change the path to
/usr/bin other than /usr/local/bin as stated in the above commands where they apply.

Usage can be as follows:

youtube-dl -o '%(stitle)s.%(ext)s' 'file_2_download'

e.g youtube -dl -o xxx.mp4 http://www.wtf.xxx/vSadG56Jij

where of course file_2_download is the url of your desired file. An easy way to update your installation is to periodically run:
$ sudo youtube-dl --update
$ which youtube-dl
$ youtube-dl --version

2. You can use Videodownload helper
Videodownload helper

3. You can use Youtube-Video download for Greasemonkey
if you are using firefox make sure you have Greasemonkey installed and then install this script :
Greasemonkey

(in chrome you can install it directly without Greasemonkey)


4. You can use keepvid
keepvid
But you need to install Java, here :
Java

You need to update your youtube version :
        Use this command in your terminal line :
        1. First checked your youtube version
        $ which youtube-dl
        $ youtube-dl –version
        2. If it is out-of-date, then update new version
        $ sudo youtube-dl –update
        3. Done. Then you can simply download the file you want
        $ sudo youtube-dl http://www.youtube.com/watch?v=wcVvE-BNWPs

it is directly write/save to your home>your_name directory.
        just try again :
        $ sudo apt-get remove youtube-dl
        $ sudo rm /usr/local/bin/youtube-dl
        $ sudo apt-get install youtube-dl
        $ sudo youtube-dl –update
        $ which youtube-dl
        $ youtube-dl –version