Author archives: admin

RSS feed of admin

linux Sed (stream editor)

Sed (stream editor)

Stream EDitor sed: line editor
The default sed: mode space does not edit the original file, only the data in the mode space to do processing; and then, after the end of the processing, the pattern space is printed to the screen

sed [options]'AddressCommand'file file...

-n: silent mode, the default ...

Continue reading

linux vim editor note

vim editor

1. open the file

# vim /path/to/somefile
      vim + #: Open the file, and positioned at the first # line
      vim +: Open File, navigate to the last row
      vim +/PATTERN: Open File, navigate to the line the first time to the line matching PATTERN

2. close the file

1) line mode close the file
:q ...

Continue reading

Linux Vim commands Collection

Vim commands Collection

Command History

 To: and / beginning commands have history, you can type the first: or / and then press the down arrow to select a command history.

Start vim

Enter the following command in the command line window to

    [root@mylab]# vim

vim filename open vim or create a file named filename

    [root@mylab ...

Continue reading

Linux Redis 3.0.5 installation and configuration

Redis 3.0.5 on the Linux installation and configuration

1. Download the installation package

[root@mylab]# wget http://download.redis.io/releases/redis-3.0.5.tar.gz

2. Compilation and installation

[root@mylab]# yum install gcc tcl
[root@mylab]# tar -zxf redis-3.0.5.tar.gz
[root@mylab]# cd redis-3.0.5
[root@mylab ...

Continue reading

linux centos7 switch graphic mode and text mode

centos7 switch graphic mode and text mode

In the graphic mode using ctrl + alt + F2 to switch to a text mode.
text mode press ctrl + alt + F2 to switch back to the graphic mode.
Enter the command init 3 to switch to text mode.
Enter the command init 5 to switch to graphic mode.

If ...

Continue reading

linux IO redirection

linux IO redirection

The default output device: standard output, STDOUT, 1
Default input device: standard input, STDIN, 0
Standard error output: STDERR, 2

Linux I/O redirection:

>: Override Output
eg. [root@mylab]# ls /var > /tmp/var2.out
>>: Append output
set -C: already prohibits the use of file redirection coverage
Force overwrite output ...

Continue reading

linux bash shell command aliases Command substitution globbing

linux bash shell command aliases Command substitution globbing

1.bash shell command aliases:

##### alias CMDALIAS = 'COMMAND [options] [arguments]'
##### Shell aliases defined only valid in the current shell life cycle; effective range of only the current    shell process alias:
 eg. [root@levi ~]# alias cls=clear
Cancel command aliases:
[root@levi ~]#unalias CMDALIAS
the same alias command ...

Continue reading

jQuery plugin - Cookie plug jquery.cookie.js

jQuery Cookie Download: https://codeload.github.com/carhartl/jquery-cookie/legacy.zip/v1.4.1

1. The introduction of jquery.cookie.js

<Script src = "scripts/jquery-1.6.4.js" type = "text/javascript"> </script>
<Script src = "scripts/jquery.cookie.js" type = "text/javascript"> </script>

2. Use

1) add a new session cookie:
$.cookie ...

Continue reading

linux help command Summary notes

Linux help command : help,--help,man,info

type command : View command type(Internal Command,External Command)
eg.:
[root@levi ~]# type -a cd 
cd is a shell builtin (Internal Command)

[root@levi ~]# type -a grep 
 grep is /bin/grep    ( External Command)
1.Internal Command (Help view)
help COMMAND
2.External Command (help view)
COMMAND --help
3 ...

Continue reading

linux Execute shell script exception bad interpreter: No such file or directory

linux sh script exception /bin/sh^M:bad interpreter: No such file or directory

reason : This is caused by a different system encoding formats.

resolve : 1.Conversion at windows

        Use UltraEdit or EditPlus

        UltraEdit: File-->Conversions-->DOS-->UNIX

        EditPlus : Edit-->EOL Conversions-->Convert to UNIX Format


        2.Conversion with vi

        >vi filename

        :set ff or :set fileformat

        You can see ...

Continue reading