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 MOJAVE
git-pack-redundant
GIT-PACK-REDUNDANT(1) Git Manual GIT-PACK-REDUNDANT(1)NAME
git-pack-redundant - Find redundant pack files
SYNOPSIS
git pack-redundant [ --verbose ] [ --alt-odb ] < --all | .pack filename ... >
DESCRIPTION
This program computes which packs in your repository are redundant. The output is suitable for piping to xargs rm if you are in the root of
the repository.
git pack-redundant accepts a list of objects on standard input. Any objects given will be ignored when checking which packs are required.
This makes the following command useful when wanting to remove packs which contain unreachable objects.
git fsck --full --unreachable | cut -d ' ' -f3 | git pack-redundant --all | xargs rm
OPTIONS --all
Processes all packs. Any filenames on the command line are ignored.
--alt-odb
Don't require objects present in packs from alternate object directories to be present in local packs.
--verbose
Outputs some statistics to stderr. Has a small performance penalty.
SEE ALSO git-pack-objects(1)git-repack(1)git-prune-packed(1)GIT
Part of the git(1) suite
Git 2.17.1 10/05/2018 GIT-PACK-REDUNDANT(1)