Tag archives: command

RSS feed of command

Linux systemctl is the replacement for service and chkconfig

1.Enable a service to start automatically

1) chkconfig --level 3 SERVICENAME on (old command)    
2) systemctl enable SERVICENAME.service (new command)

2.Disable a service to start automatically

1) chkconfig --level 3 SERVICENAME off (old command)    
2) systemctl disable SERVICENAME.service (new command)

3.View service status(old command and old command)

1) service ...

Continue reading

Linux rpm related commands

RPM(RedHat Package Manager)

Binary package (Binary) as well as the source code package (Source) two. The binary package can be installed directly on the computer, and the source code package will be compiled and installed automatically by the RPM. Source code packages often use src.rpm as a suffix.

1.Common command combination:

-ivh ...

Continue reading

Linux SSH login without password

client1: 192.168.4.11 Linux Host
server1: 192.168.4.33 Linux Host
client server Generate key(Public key and Private key), copy the Public key to server1

1.client1 Generate key

[root@client1 ~]# ssh-keygen -b 1024 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root ...

Continue reading

Linux Process management command

Process management command

init: Process number is 1

Classification of processes:
     the processes associated with the terminal
     Terminal independent process

1.process state:

     D: Non interrupted sleep
     R: Run or ready
     S: Interrupted sleep
     T: Stop it
     Z:  Zombie state

     <:  High priority process
     N: Low priority process
     +: Processes in the foreground process group
     l ...

Continue reading

Linux File compression and Archive command

File compression and Archive command summary

compressed format: gz, bz2, xz, Z, zip Compression algorithm: the algorithm is different, the compression ratio will be different;

1.gzip

gzip: .gz 
  gzip /PATH/TO/SOMEFILE: gzip will delete the original file after the completion of the compression
  gzip -d: decompression
       -#: 1-9, specify the compression ratio, the default ...

Continue reading

Linux File Find command

File Find command

1.locate:

Non-real-time, fuzzy matching, lookup is performed according to the system-wide file database;
# updatedb, Manually generated file database (fast)

2. find: Find PathFinder standard look to a future process of operation

Real-time, accurate, supports many search criteria, traversing all the files in the specified directory lookup completed, slow;

Search Path: The ...

Continue reading

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 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