|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
loop shell for beginners
i'm new in shell programming.
let say i have this file in directory file1.txt. file2.txt sample1.txt sample2.txt so,i want to move file that begin with name"file" to another directory.so how is it? help me please |
|
#2
|
||||
|
||||
|
Quote:
Dude, you don´t have to write a programme to do this. These jobs can usually be done on the command line. I don´t have a unix terminal handy, so I can´t test these commands, but to move all the files beginning with ´file´into the directory ´/tmp´ you need to use something like: ls -al | grep "file" | xargs mv /tmp or to run recursively. use the find command with exec: find . -name "file*" -exec mv /tmp {} \; Note, I havn´t tested these, so have a play on some dummy files & directories first ![]() christo
__________________
. Spiration channels: Free scripts, programming tutorials and articles Dotcut alerts: Online Press cuttings / news alerts Clearprop: UK microlight school, wiltshire Uk dating: UK safe dating with Topdates About Christo . . |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > loop shell for beginners |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|