for f in *.rod; do echo $f; cut -f5 $f | sort -k1.3n | uniq | wc -l; done
---------- Post updated at 02:36 PM ---------- Previous update was at 02:17 PM ----------
Quote:
Originally Posted by tange
Consider using GNU Parallel instead:
Watch the intro video to learn more: youtube. com/watch?v=OpaiGYxkSuQ
Hi Tange,
I find the GNU Parallel interesting. I'm not exactly a computing person, can you clarify the following for me:
1. what is the difference between GNU parallel and multi-threaded process? For example, if my program allows multi-threading and I run 4 threads in my quart-core computer, am I right to assume that the GNU parallel is not going to make any difference?
2. If I already running some other process and still specify -j+0, what is going to happen?
i am writing a script to perform some mysqldumps and gzip them. The problem I am running into is that if the user specifies a database that doesn't exist, the error the mysql engine produces is still piped into gzip, and the exit code returned is 0. If I don't pipe into gzip, an exit code... (4 Replies)
Can anyone interpret and tell me the way the below command works?
find * -name "*${msgType}" -mtime +${archiveDays} -prune -type f -print 2>/dev/null | xargs rm -f 2> /dev/null
Please tell me the usage of prune and xargs in the above command?
Looking forward your reply.
Thanks in... (1 Reply)
Hi
From the xargs man page (Solaris):
ls $1 | xargs -I {} -t mv $1/{} $2/{}
This would move all the files in directory $1 to directory $2
Problem 1:
In a shell script if I want to move files in d1 to d2
dir1=~/d1
dir2=~/d2
ls $dir1 | xargs -I {} -t mv $dir1/{} $dir2/{}
does not... (3 Replies)
I'm trying to get a count of all the files in a series of directories on a per directory basis. Directory structure is like (but with many more files):
/dir1/subdir1/file1.txt
/dir1/subdir1/file2.txt
/dir1/subdir2/file1.txt
/dir1/subdir2/file2.txt
/dir2/subdir1/file1.txt... (4 Replies)
Hi
I am trying to use "xargs" command to loop through each file, modify it and overwrite the old file with the modification but with the same file name.
I thought it is easy but I just can't get it to work
I tried the following
I thought {} would give me the current file name, but it... (1 Reply)
Hey,
I want to create a new file (devices) with the 39th and the 40th character of the line wich is in the array line and in the file drivers.
But unfortunately my try doesn't work:
sed -n '$linep' drivers | cut -c 39-40 | echo >>devices Perhaps one of you can help me. Thank you!
emoly
... (0 Replies)
Hey guys. I'm very new to Unix. I'm pretty fluent in Java and C, but I have never actually used Unix for anything. I am in an Operating Systems course now and I have an assignment to write a piece of code that involves forks and piping. I'm stuck.
1. The problem statement, all variables and... (6 Replies)
I entered the following <zzz.list xargs showtell |more which does a echo "<<<<<<<<<<<<<<<<<<<<<<<<< $1 >>>>>>>>>>>>>>>>>>"
head -20 $1 The file zzz.list contains 525 lines representing user scripts (1 per line), but only the first, 181st, and 399th lines were processed. What am I missing?
TIA (2 Replies)
Need help in piping commands using xargs
I have several .tar.gz files that I need to list the folder content in a subdirectory.
For example,
a.tar.gz
b.tar.gz
c.tar.gz
The following command works great for each .tar.gz file but it's a pain to run the tar command for each file.
tar -tf... (11 Replies)
Discussion started by: april
11 Replies
LEARN ABOUT DEBIAN
mksary
MKSARY(1) Sary MKSARY(1)NAME
mksary - manual page for mksary 1.0.2
SYNOPSIS
mksary [OPTION]... FILE
DESCRIPTION -a, --array=ARRAY
set the array file name to ARRAY
-b, --block=[SIZE]
do block sorting with SIZE [1024] KB block
-s, --sort
sort the array file
-l, --line
index every line
-w, --word
index every word delimited by white spaces
-c, --codeset=CODESET, handle CODESET for indexing
[bytestream], ASCII, ISO-8859, EUC-JP, Shift_JIS, UTF-8
-L, --locale
enable locale support (employ mblen for indexing)
-q, --quiet
suppress all normal output
-v, --version
print version information and exit
-h, --help
display this help and exit
COPYRIGHT
Copyright (C) 2000 Satoru Takabayashi All rights reserved.
This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER-
CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
mksary 1.0.2 December 2000 MKSARY(1)