This is the 28th day of my participation in the August Text Challenge.More challenges in August

background

In any environment, some work behaviors become habits over time! Although constantly switching work environment, but engaged in the work, very different; Still have to complain: although use not very skilled, but fortunately have notes ah, the mind has an impression, and then turn over the notes, so that you can ask east and west, do their own encyclopedia! Less gossip……

1, SCP remote server copy files

SCP file username@serverid:path, verify username password; Copy files from the current server to serverID server path. SCP -r file_folder…

To replicate from remote to local, switch the last two parameters of the command.

2. Edit shell script: vim

:set nu Displays the line number

:100 Press Enter to move to the specified line number

Press the number 9 and press Y twice to copy the 9 lines of data under the cursor. P means to paste the contents of all lines copied by YY under the current cursor

:10,20 s/^/#/g,^ identifies the beginning of the line, replaces the # comment symbol, from line 10 to line 20, g represents all, without g just the first line, i.e. line 10

:10,20 s/^#//g, i.e., reverse operation above, uncomment

3. Filter file content grep

Grep “” /logs/* -r # parameter -r filter directory

4, shell script copy command, repeat do not need confirmation: \cp -rf

Git check remote repository address

      $git remote -v

$git remote add origin url

Echo 3 > /proc/sys/vm. drop_caches

Tips: Before you do this, you need to execute sync

Do you want to do something with curl?

Curl -o: curl -o: curl -o: curl -o: curl

Curl –help:

Curl -o “your_file_name” curl -o “your_file_name”

Pid process/thread ID

Convert base 10 to base 16: printf “%x\n” 2644

SQL > select * from files whose suffix ends in HTML and order them in descending order by time.

find ./java_reports/ -name “*.html” |xargs ls -lt |head -n 1 |awk ‘{print $9}’

10, redis-cli client, when installing redis-server, should have brought the client, but it does not go to the Linux ‘/bin directory, is executable command.

We ln -s [source file] [target file] soft chain create executable command, redis-cli -p port number, auth yourpasswd authentication user. Flushdb flushhall flushes all db in flushhall. Flushhall flushes all db in flushhall. Config get databases queries the number of dB databases. The value starts from 0 by default. You can configure the number in redis.

11, # Linux o&M replacement command

Grep -r "active = test" HCP - \ * | awk -f ':' '{print $1}' | xargs sed -i 's/active = test/active = uat/g' # find file regular match, Find./ -name 'SQL \*' -mmin-2 # find./ -name' SQL \*' -mmin-2 # Rm - rf delete, grep filters find. / -name 'SQL \ * - mmin - 2 | xargs grep' context 'Copy the code

Mysql > drop database dbname; Mysql -uroot -p # mysql -uroot -p

In a word, in a word: need more skilled, can remember or remember a bit.