Basic question about redirecting output



Hi, all.

I'm a DBA on an AIX 5.2 system.

My main role is DBA, not AIX admin, so I'm relegated to only learning
those bits of AIX which I need for my job. So if this seems like a
'basic' question, *sorry*. ;-)

My scenario is this: I have a directory with some files in it, and I
want to move only those files whose name contains a certain string (ie
'temp') into another directory.

I can get the list of these files with
ls | grep temp

So: can I not take the output of that command and insert it into a mv,
kind of like

ls | grep tmp | mv <newfolder> ??

....which would result in the files whose names contain the string
'temp' being moved to the new folder?

I'm sure I'll get it if I keep mucking about, but all I need is an
insight into redirecting output of shell commands.

Is there a quick syntactic pointer that someone can give me here?

Thanks!!

BD.

.



Relevant Pages

  • Re: Audit on AIX
    ... > What happened Today was a nightmare for any DBA. ... Sharing root's password is like sharing condoms. ... You can also direct syslog to the secure machine. ... Doing AIX support was the most monty-pythonesque ...
    (comp.unix.aix)
  • large files?
    ... I've installed a samba share on an aix box for the dba ... to test some backup stuff (doesn't have enough space ... on the intel box). ...
    (comp.unix.aix)
  • Re: AIX 5.3 TL5 command for temp
    ... Kurt Gilpin ... AIX 5.3 TL5 command for temp ... AIX 5.3 TL5 command for temp ...
    (AIX-L)
  • Re: AIX 5.3 TL5 command for temp
    ... Senior Programmer/Analyst ... AIX 5.3 TL5 command for temp ...
    (AIX-L)
  • Re: un-tar-ing to a different folder
    ... The problem is that AIX doesn't come with GNU tar. ... Try "tar -xvf files.tar -C temp". ... "It's not the despair... ...
    (comp.unix.shell)