shell,使用sed对文件截取
截取第1行到第200行 sed -n '1,200p' file >>newfile sed -i '1,200d' file »
截取第1行到第200行 sed -n '1,200p' file >>newfile sed -i '1,200d' file »
find . -name "*.c" -exec basename {} \; »
ls export$(date -d'15 days ago' "+%Y%m%d")*.pn.gz »
查找目录下的文件 find <path> "*" | xargs ls -l 删除文件 cd <path> find . -name "*" | xargs rm{} 移动文件 find <source directory> -na »
import java.io.*; import javax.xml.stream.*; import javax.xml.stream.events.*; public class StaxDemo { public static void main(Str »
使用cat cat filename|tr -s '\n' 使用sed sed '/^$/d' filename sed -e '/^\n$/d' file.txt sed '/^ *$/d' list.txt >newlist.txt 使用awk aw »
apt-get添加代理 vim /etc/apt/apt.conf Acquire::http::proxy "http://username:password@proxy_adress:port_number"; #export http_proxy=http://us »
删除开头空格 sed 's/^ *//g' test.txt >new.txt 删除行首空格 sed 's/^[ \t]*//g' 删除行尾空格 sed 's/[ \t]*$//g' »
删除 >>> 之前的 sed 's/>>>/\n/;s/.*\n//' test.txt >new.txt »
#!/usr/bin/env python #-*- coding: utf-8 -*- import email import smtplib import mimetypes from email.MIMEMultipart import MIMEMultipar »