LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linare
User Name
Password
Linare This forum is for the discussion of Linare Linux.

Notices


Reply
  Search this Thread
Old 09-08-2004, 06:50 AM   #1
arockia
LQ Newbie
 
Registered: Aug 2004
Posts: 7

Rep: Reputation: 0
Moving Files


hi

i have to move the files from one folder to another folder by writing shell script. after moving i have to delete from the current folder.

in which way i can do this.
can anyone tell me?
-arockia
 
Old 09-08-2004, 06:55 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,939

Rep: Reputation: 129Reputation: 129
You move files by issuing "mv <filename>" and it moves them so you don't have to delete them from the original directory. man mv
 
Old 09-08-2004, 07:40 AM   #3
arockia
LQ Newbie
 
Registered: Aug 2004
Posts: 7

Original Poster
Rep: Reputation: 0
hi
when i have moved the files from one directory to another directory, i have used mv sourcedir/* destdir

but if if there is no file in the source directory i got the following error
cannot access: No such file or directory
it is in unix..
i hope definitely there will be a option in mv. now i will try for the option .
if anyone know the option please reply
-arockia
 
Old 09-08-2004, 08:14 AM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,939

Rep: Reputation: 129Reputation: 129
Here's an example, since I don't really understand your English...

mingdao@paul:~/numlockx-1.0$ ls -alc
total 403
drwxr-xr-x 2 mingdao users 936 2004-09-06 17:27 ./
drwx--x--x 29 mingdao users 1336 2004-09-08 18:08 ../
-rw-r--r-- 1 mingdao users 77 2004-09-06 17:18 AUTHORS
-rw-r--r-- 1 mingdao users 1092 2004-09-06 17:18 ChangeLog
-rw-r--r-- 1 mingdao users 7160 2004-09-06 17:18 INSTALL
-rw-r--r-- 1 mingdao users 1146 2004-09-06 17:18 LICENSE
-rw-r--r-- 1 mingdao users 14132 2004-09-06 17:26 Makefile
-rw-r--r-- 1 mingdao users 3753 2004-09-06 17:18 Makefile.am
-rw-r--r-- 1 mingdao users 13615 2004-09-06 17:18 Makefile.in
-rw-r--r-- 1 mingdao users 4164 2004-09-06 17:18 README
-rw-r--r-- 1 mingdao users 29 2004-09-06 17:18 TODO
-rw-r--r-- 1 mingdao users 31 2004-09-06 17:18 acconfig.h
-rw-r--r-- 1 mingdao users 7021 2004-09-06 17:18 acinclude.m4
-rw-r--r-- 1 mingdao users 11185 2004-09-06 17:18 aclocal.m4
-rw-r--r-- 1 root root 28741 2004-09-06 17:26 backup-090620041726-pre-numlockx-1.0.tgz
-rw-r--r-- 1 mingdao users 1746 2004-09-06 17:26 config.cache
-rw-r--r-- 1 mingdao users 370 2004-09-06 17:26 config.h
-rw-r--r-- 1 mingdao users 289 2004-09-06 17:18 config.h.in
-rw-r--r-- 1 mingdao users 2319 2004-09-06 17:26 config.log
-rwxr-xr-x 1 mingdao users 8364 2004-09-06 17:26 config.status*
-rwxr-xr-x 1 mingdao users 66805 2004-09-06 17:18 configure*
-rw-r--r-- 1 mingdao users 530 2004-09-06 17:18 configure.in
-rwxr-xr-x 1 mingdao users 5584 2004-09-06 17:18 install-sh*
-rw-r--r-- 1 mingdao users 5673 2004-09-06 17:18 main.c
-rw-r--r-- 1 mingdao users 72180 2004-09-06 17:26 main.o
-rw-r--r-- 1 mingdao users 6274 2004-09-06 17:18 missing
-rwxr-xr-x 1 mingdao users 731 2004-09-06 17:18 mkinstalldirs*
-rwxr-xr-x 1 mingdao users 61812 2004-09-06 17:26 numlockx*
-rw-r--r-- 1 mingdao users 10 2004-09-06 17:26 stamp-h
-rw-r--r-- 1 mingdao users 0 2004-09-06 17:18 stamp-h.in
-rwxr-xr-x 1 root root 560 2004-09-06 17:27 xinitrc.sav*
-rwxr-xr-x 1 mingdao users 471 2004-09-06 17:27 xsetup.sav*
mingdao@paul:~/numlockx-1.0$ mv backup-090620041726-pre-numlockx-1.0.tgz ~/tarballs/
mingdao@paul:~/numlockx-1.0$ ls -alc
total 371
drwxr-xr-x 2 mingdao users 880 2004-09-08 21:10 ./
drwx--x--x 29 mingdao users 1336 2004-09-08 18:08 ../
-rw-r--r-- 1 mingdao users 77 2004-09-06 17:18 AUTHORS
-rw-r--r-- 1 mingdao users 1092 2004-09-06 17:18 ChangeLog
-rw-r--r-- 1 mingdao users 7160 2004-09-06 17:18 INSTALL
-rw-r--r-- 1 mingdao users 1146 2004-09-06 17:18 LICENSE
-rw-r--r-- 1 mingdao users 14132 2004-09-06 17:26 Makefile
-rw-r--r-- 1 mingdao users 3753 2004-09-06 17:18 Makefile.am
-rw-r--r-- 1 mingdao users 13615 2004-09-06 17:18 Makefile.in
-rw-r--r-- 1 mingdao users 4164 2004-09-06 17:18 README
-rw-r--r-- 1 mingdao users 29 2004-09-06 17:18 TODO
-rw-r--r-- 1 mingdao users 31 2004-09-06 17:18 acconfig.h
-rw-r--r-- 1 mingdao users 7021 2004-09-06 17:18 acinclude.m4
-rw-r--r-- 1 mingdao users 11185 2004-09-06 17:18 aclocal.m4
-rw-r--r-- 1 mingdao users 1746 2004-09-06 17:26 config.cache
-rw-r--r-- 1 mingdao users 370 2004-09-06 17:26 config.h
-rw-r--r-- 1 mingdao users 289 2004-09-06 17:18 config.h.in
-rw-r--r-- 1 mingdao users 2319 2004-09-06 17:26 config.log
-rwxr-xr-x 1 mingdao users 8364 2004-09-06 17:26 config.status*
-rwxr-xr-x 1 mingdao users 66805 2004-09-06 17:18 configure*
-rw-r--r-- 1 mingdao users 530 2004-09-06 17:18 configure.in
-rwxr-xr-x 1 mingdao users 5584 2004-09-06 17:18 install-sh*
-rw-r--r-- 1 mingdao users 5673 2004-09-06 17:18 main.c
-rw-r--r-- 1 mingdao users 72180 2004-09-06 17:26 main.o
-rw-r--r-- 1 mingdao users 6274 2004-09-06 17:18 missing
-rwxr-xr-x 1 mingdao users 731 2004-09-06 17:18 mkinstalldirs*
-rwxr-xr-x 1 mingdao users 61812 2004-09-06 17:26 numlockx*
-rw-r--r-- 1 mingdao users 10 2004-09-06 17:26 stamp-h
-rw-r--r-- 1 mingdao users 0 2004-09-06 17:18 stamp-h.in
-rwxr-xr-x 1 root root 560 2004-09-06 17:27 xinitrc.sav*
-rwxr-xr-x 1 mingdao users 471 2004-09-06 17:27 xsetup.sav*

The .tgz file is gone from the directory.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving files Pyrophorus Slackware 5 11-09-2005 10:47 AM
Moving files UmneyDurak Fedora 4 08-28-2005 05:52 PM
moving files pantera Programming 2 08-23-2005 05:58 AM
Moving Files jhotchkiss Linux - Newbie 5 09-16-2003 03:41 PM
moving files from one box to another AZDAVE Linux - General 6 08-14-2003 09:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linare

All times are GMT -5. The time now is 02:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration