One of uniq's cousins is comm and it works on multiple files.
On Tue, 21 Aug 2007, Tim Chase wrote:
How do you remember all those lengthy commands?
I find that, for myself, you learn the basic family of commands (the root
command name) and what it does. I usually have a handful of common
parameters memorized, such as "-r" or "-R" meaning "recurse into
subdirectories" or "--verbose" for extra output. Once I knew what the basic
commands did, I tend to dig in the man-pages for the given command to see
exactly what I want to do. Those "lengthy commands" simply become a chaining
together of more simple commands you already know.
An example might be learning the following list of commands (and building the
list as you find need)
ls: lists files
grep: searches for patterns in a file
sed/awk: edits files via a script
less/more: pages output
find: finds files matching conditions
sort: sorts files
uniq: performs "uniqueness" related tasks
tr: change one set of characters into another set of chars
pwd: print the current directory
Once you understand what they're supposed to do, you can start to chain them
together to produce more complex results. You can also explore their
man-pages when you think a particular command might be able to do something
related to what you already know. For example, the "grep" command finds (and
prints) lines that match a given pattern. This might lead you to wonder if
there's an option to make it print lines that *don't* match a given pattern.
Indeed, grep takes a "-v" parameter to inVert the printing so that it only
prints lines that *don't* match the given pattern.
Some commands, however, I find myself helpless and constantly referring to
the manual EVERY SINGLE TIME (which, isn't all that often). Burning a CD,
transcoding audio/video or manipulating images with ImageMagick require that
I spend some time with their man pages (or their help output).
can you copy them all to a clipboard like thing and run them
in sequence?
yes, depending on your environment, you can copy/paste commands into the
command-line. The "how" of it varies depending on what controls the
clipboard. In "screen", you can use control+A followed by "]" to mark some
screen stuff to keep, and then use control+A followed by "[" to paste the
contents you snagged. In a terminal emulator (whether a
telnet/ssh/xterm/rxvt whatever) session, the clipboard is controlled by the
owning application (windows or X), and any associated copy/paste commands
should work there, with "paste" acting as if you typed the command.
Copy & paste work well for beginners, but as you advance, it's troublesome
and prevents you from learning how to construct your own solutions to things.
Just my own learning path,
-tim
_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list
_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list