less command

The navigation keys in less command are similar to Vim editor.

Forward Search

    / – search for a pattern which will take you to the next occurrence.
    n – for next match in forward
    N – for previous match in backward

Backward Search

    ? – search for a pattern which will take you to the previous occurrence.
    n – for next match in backward direction
    N – for previous match in forward direction

For viewing large log files

    CTRL+F – forward one window
    CTRL+B – backward one window
    CTRL+D – forward half window
    CTRL+U – backward half window
    j – navigate forward by one line
    k – navigate backward by one line
    G – go to the end of file
    g – go to the start of file
    q or ZZ – exit the less pager

Useful other command

    v – using the configured editor edit the current file.
    h – summary of less commands
    &pattern – display only the matching lines, not all.

File paging
You can open multiple files by passing the file names as arguments:

$ less file1 file2

virtualbox: mount shared esterno su linux

You have to specify the path and folder to share with the service name on virtualBox

for the mount you can use this command:

sudo mount -t vboxsf nome_servizio /shared_name

you need on your linux OS one folder (mkdir shared_name)

for example if the service name is “stage” and the folder name on the system is shared you can use this command:

sudo mount -t vboxsf stage /shared

for the unmount you can use:

sudo umount -t vboxsf stage /shared

tar.gz

#archive the file without compression.
tar file_name
Options:

(1) create tar cfv tar c=create, f=file (on the disk and not on the tape),v=verbose (show file list).

ex: tar cfv archive.tar *.txt create the file’s archive of all txt files in the same path.

ex: tar -cvf /destination_path/filename.tar /path to put in the tar file

(2) tvf to show the content of the archive: tar tfv archive.tar

(3) xfv archive file extraction: tar xfv archive.tar