fsrm uds:/*/*.dekim
removes dekim file
rmwz uds:/*/*
removes wz cube
8/18/2014
7/25/2014
Linux print sequential numbers
$seq 10 -1 0
10
9
8
7
6
5
4
3
2
1
0
10
9
8
7
6
5
4
3
2
1
0
seq [OPTION]... LAST
seq [OPTION]... FIRST LAST
seq [OPTION]... FIRST INCREMENT LAST
5/09/2014
Linux join every 2 lines in a file
$ cat file USA 442 India 249 UK 50$
paste - - -d, < file
USA,442 India,249 UK,50
paste - - - - -d, <input_list_before_combine.list # join every 4 lines, each "-" is one line
$ paste - - < file
USA 442 India 249 UK 50
from http://www.theunixschool.com/2012/03/join-every-2-lines-in-file.html
4/25/2014
3/21/2014
windows key to minimize/maximize the window
1. Restore Down: Windows logo key + Down Arrow
2. Minimize: Windows logo key + Down Arrow
3. Select Window: Alt+ Tab
4. Maximize: Windows logo key + Up Arrow
2. Minimize: Windows logo key + Down Arrow
3. Select Window: Alt+ Tab
4. Maximize: Windows logo key + Up Arrow
2/21/2014
awk print last 5 characters of one line
$ cat test.list | awk '{print substr($1,length($1)-4, length($1))}'
from this link
http://www.unixcl.com/2008/05/print-last-2-characters-using-awk.html
from this link
http://www.unixcl.com/2008/05/print-last-2-characters-using-awk.html
2/17/2014
2/14/2014
delete content of file1 from file2
grep -v -f file1 file2 > outfile
here outfile will have data other than file1 content
For exact match, use -Fx
grep -vFx -f file1 file2 > outfile
2/12/2014
2/07/2014
1/13/2014
Grep
grep smug files {search files for lines with 'smug'}
grep '^smug' files {'smug' at the start of a line}
grep 'smug$' files {'smug' at the end of a line}
grep '^smug$' files {lines containing only 'smug'}
grep '\^s' files {lines starting with '^s', "\" escapes the ^}
grep '[Ss]mug' files {search for 'Smug' or 'smug'}
grep 'B[oO][bB]' files {search for BOB, Bob, BOb or BoB }
grep '^$' files {search for blank lines}
grep '[0-9][0-9]' file {search for pairs of numeric digits}
http://www.robelle.com/smugbook/regexpr4.txt
1/08/2014
Nominal Fold
Nominal Fold = geophone spacing * no. geophones / 2 * shot spacing
Nominal Fold = streamer length / 2 * shot spacing
Nominal Fold = streamer length / 2 * shot spacing
1/06/2014
Putting Two Consecutive Lines into One Line with Perl / AWK
I have a data like below:
abcd
join abcd
efgh
join efgh
I want to join the two consecutive pair into one line. Resulting:
abcd join abcd
efgh join efgh
$ sed 'N;s/\n/ /' tst.list
abcd join abcd
efgh join efgh
http://stackoverflow.com/questions/10220348/putting-two-consecutive-lines-into-one-line-with-perl-awk
订阅:
评论 (Atom)