File/directory Operations

Source: Internet
Author: User

Compression DecompressionTar-cvf -File | Gzip-cf>*.tar.gz--First the TAR package (not compressed), and then compressed into GZ package tar-ZCVF *.tar.gz file-add z option, directly package compressed into GZ package GZIP-DC *.tar.gz | Tar-xvf-          --First unpack the GZ package, then unzip the tar package tar-ZXVF *.tar.gz--Direct decompression of GZ package ls *.sh* | GZIP-CF > *.gz--direct with LS fuzzy query Ls-f | grep '/$ '--View only the directory TAR-ZTVF/-TVF to see the file name within the Tarfile Gunzip directly unzip the GZ package unzip (Zip) directly unzip (shrink) Zip package (- O Direct override without warning) DeleteFind. -name ' *.log ' | XargsRm Enquirygrep offer_change_bp_ * Fuzzy match, with spaces when adding single quotes to find. -name ' *offer_change* ' fuzzy match, must be added single quote find./-name a.class| XargsLs-ltrsunos:/usr/xpg4/bin/ls *chnl_task* fuzzy query of--lsLs-lrth--Sort by update time LS-DL $HOME directory details Create userUseradd-g aigrp-d/home/task_satdev-m Task_satdev Connectionin the Environment configuration documentLn-s F1 F3 #创建f1的一个符号连接文件f3ln-S/home/web_satdev/apache-tomcat-7.0.27/webapps/poc/web-inf/classes config Script Execution1. See detailsSh-x stop_sec_mem.sh2. File format ConversionSunOS Dos2unix error can be ignored3. Script Background Execution-&nohup Command >nohup.out &---REDIRECT does not output to the terminal, Nohup causes the terminal to turn off the background to continue executionUse jobs to view background tasks, if the terminal does not exit, kill kills the process, otherwise with PS view4. Script Encoding format conversionView Environment encoding formatEnv |grep LANGView and set the user's Lc_allLocalevi. Bash_profile or set lang=ConversionIconv-f utf-8-T GBK rundb_nj.sh > rundb_nj.sh.newmv rundb_nj.sh.new rundb_nj.shor Direct outputIconv-f utf-8-t GBK logfile.sh-o logfile2.sh GREPPs-ef|grep-w tfframework |grep-we "${cur_user}" | Grep-w Ims_res_sts_sync_tf_aitask | grep java | Grep-v grep | awk ' {print $} ' |wc-l-w exact match;-E; grep-v grep ignores the grep command itself on the count of rows; wc-l Displays the number of rows Grep-rl * file grep that lists the matches in the directory (including subdirectories) -l lists only the files contained in the directory grep lists the strings that contain the configuration contents #默认的grep用下面的路径grep =/usr/bin/grepif [$os = "SunOS"];then Grep=/usr/xpg4/bin/grepe Lif [$os = "Linux"];then grep=/bin/grepfi #默认的awk用下面的路径awk =/usr/bin/awkif [$os = "SunOS"];then awk=/usr/xp G4/bin/awkfi

File/directory Operations

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.