Basic commands in Linux

Source: Internet
Author: User

Find which files in the directory contain a certain string

Find. | xargs grep-ri "IBM"

Check whether all files in the directory contain a certain string and print only the file name.

Find. | xargs grep-ri "p3_40_16_16/graduation"-l

Grep-LR 'Graduation potato go to-Cool trousers '/scmgt/logs /*

Check whether a specified file contains a character string. [| less pipe, click "enter" to view the string slowly]
Cat pdtsrv_error.log | grep 12345676543221 | less

Find the directory where the file is located
Find/-name productserver. Jar
Find/-name 2z80sf31d77628523251.mp3

View the number of rows

Cat counttimelogger. log | WC-l

View files and update them in time

Tail-f xx. Log

The locally uploaded sh script must be encoded to run on the server. Otherwise, it cannot run.
Vi xx. Sh
Set fileformat = Unix

View Processes
PS-El | grep Java
PS-Ef | grep Java
Kill-9 xxx
Kill-9 'ps-Ef | grep "chtftpmusicfileserviceimpl" | grep-V grep | awk '{print $2 }''
Kill-9 'ps-Ef | grep "ftpwalkmanmain. Sh" | grep-V grep | awk '{print $2 }''
Kill-9 'ps-Ef | grep "ftpcoloringmain. Sh" | grep-V grep | awk '{print $2 }''

Compression GZ
Unzip sucai_0407.dmp.gz
Compression:
Gzip sucai_0407.dmp.gz

Upload (files are uploaded between two servers, which is extremely fast)
SCP sucai_0407.dmp 10.25.173.31:/scmgt/

Execute scheduled tasks
Crontab-e

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.