06-22-2011
unix command for terminal - view sequences as a single line?
Hello,
I'm looking for some code that will list sequences of files as a single line.
ie, sequences of files like this:
filename.1.ext
filename.2.ext
filename.3.ext
filename.4.ext
filename.5.ext
filename.6.ext
filename.7.ext
filename.8.ext
filename.9.ext
filename.10.ext
would be listed as such:
filename.1-10.ext
-
non-sequenced files would just be listed as usual along with the seq... so this group:
filenameA.1.ext filenameB.1.ext
filenameA.2.ext filenameB.2.ext
filenameA.3.ext filenameB.3.ext
filenameA.4.ext filenameB.4.ext
filenameA.5.ext filenameB.5.ext
filenameA.6.ext filenameB.6.ext
filenameA.7.ext filenameB.7.ext
filenameA.8.ext filenameB.8.ext
filenameA.9.ext filenameB.9.ext
filenameA.10.ext filenameB.10.ext filenameC.1.ext
would list as such:
filenameA.1-10.ext
filenameB.1-10.ext
filenameC.1.ext
This will have to function in the OSX & Lunix terminals.
Every company I've been at so far has had some version of this command but now I find myself at a place that doesn't and oh how I do miss it. Anything appreciated, feel free to mail me directly.
Thanks!
Kent
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi everybody..
I need to enter in bash mode and then run a command and this just in a single command line.
I tried : "bash ^M| somecommand" but nothing..
How do I do to simulate the return button just right after the bash command ?
Thanks.. (8 Replies)
Discussion started by: Riddick61
8 Replies
2. Shell Programming and Scripting
Hello,
I am trying to learn how to pass something more than a one-command startup for gnome-terminal.
I will give an example of what I'm trying to do here:
#! /bin/bash
#
#TODO write this for gnome and xterm
USAGE="
______________________________________________
${0##*/}
run... (0 Replies)
Discussion started by: Narnie
0 Replies
3. UNIX Desktop Questions & Answers
Hi All,
I work on a Linux platform which runs Red Hat (forget which version) and use both korn and bash shells. Is there a way of making the command line appear at the top of the terminal window and any lists, commands or directory names etc to appear below the top, that is to say reverse the... (1 Reply)
Discussion started by: ray_m
1 Replies
4. OS X (Apple)
Dear All,
Anyone knows how to start a new bash terminal from command line?
Another question: when I use "open" command (open test.pdf) to open a pdf file, the PDF reader will start up, but cannot associate with that file. Anyone knows why? (1 Reply)
Discussion started by: andrewust
1 Replies
5. UNIX for Advanced & Expert Users
Is there a good way of showing around 4 pictures (fairly large thumbnails) at once on the command line, preferably tiled so that all of them are viewable. I tried using display but I'm not sure how to tile them. I'd also prefer if it was read only so that they cannot be altered in the viewer.
... (1 Reply)
Discussion started by: cue
1 Replies
6. Shell Programming and Scripting
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies
7. Shell Programming and Scripting
Sometimes I'm working from terminal for long periods of time and I come across a doc file I don't recognize. I've been trying to figure out how to view it instead of opening up word.
I've tried cat but it jumps into binary and my terminal goes nuts.
Is there a way I can do this from... (4 Replies)
Discussion started by: syregnar86
4 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies
9. OS X (Apple)
Hi guys and gals...
After much searching on the good ol' internet I could find nothing, so this is the result.
ALthough many people seem to have asked this question no-one seems to have a solution so here we go.
I need for AudioScope.sh, 'xterm' to run a second program for some of its... (2 Replies)
Discussion started by: wisecracker
2 Replies