Linux/unix common commands used in work

Source: Internet
Author: User
Tags file copy

Common commands used by Linux in normal work:


SCP is a file copy with security, SSH-based login. Easy to operate, for example, to copy the current file to a remote other host, you can command the following.

Scp/home/1.gif [email protected]:/home/root

You will then be prompted to enter the login password for the root user of the other 172.19.2.75 host, and then the CP and Ungzip are started.

If you want to reverse the operation, copy the file from the remote host to the current system, it is also very simple:

SCP [email protected]:/home/abc.gif /home/root


Find-name ap*-o-name may*/* Find files that start with an AP or May


refer to the detailed source: http://www.jb51.net/os/RedHat/1307.html


Find text file content:/content to quickly locate Shift+insert paste

[[email protected] xss]# Cat Text1.ini |grep file Find out if it has "Text1.ini" this file


/test> Cat 123.txt |grep wao*

Md::y en:gaaiih waomen #123 text content in. txt


[[email protected] XSS] #cp test.cpp./123//Copy

[[Email protected] xss]# mv Test.cpp test123.cpp//Name

/data/autobuild/src/photo_branch/test/pp> CP 123_bf.txt 1234.txt back up the file

Command

Command line Description

Command

Command line Description

Command

Command line Description

U

Redo Previous Action

Dd

Delete When moving forward

Number of rows to copy yy

The ability to copy text

X,x

Delete the characters in the cursor before deleting the cursor

A

Inserts a new character in the current character hyphenating

P

Paste

: s/from/t/g

Replaces all the from in the current row with T





: S/FROM/TO/GC Replace but each time you want the user to confirm Dd

Delete When moving forward

Number of rows to copy yy

The ability to copy text
:%s/from/to/g %s represents the entire text substitution

A

Inserts a new character in the current character hyphenating

P

Paste


: x Save changes and exit


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.