Linare This forum is for the discussion of Linare Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-08-2004, 07:50 AM
|
#1
|
LQ Newbie
Registered: Aug 2004
Posts: 7
Rep:
|
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
|
|
|
09-08-2004, 07:55 AM
|
#2
|
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,941
Rep:
|
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
|
|
|
09-08-2004, 08:40 AM
|
#3
|
LQ Newbie
Registered: Aug 2004
Posts: 7
Original Poster
Rep:
|
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
|
|
|
09-08-2004, 09:14 AM
|
#4
|
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,941
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 05:04 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|