Sponsored Content
Full Discussion: Moving files to 'trash'
Top Forums Shell Programming and Scripting Moving files to 'trash' Post 302277833 by Rhije on Sunday 18th of January 2009 11:14:49 AM
Old 01-18-2009
Alright.. you need to make sure that you put that in your .bash_profile file, then login to the shell again.

You can't name the function restore() as that is an actual command in *nix (not sure which versions it is actually in), you can type: man restore

Name it restfile or undelete or something, I am not sure, but do not use restore. Smilie
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

moving only files...

hi.. I want to move a set of files that contain a particular string. I wished to do that with find but i am unable to do that. can anybody give me a good method? :) (12 Replies)
Discussion started by: sskb
12 Replies

2. Shell Programming and Scripting

Moving Files

Hi There, I am trying to move files, the file is present in this location: /iAm4Free/test/generate/txt/information.txt I need to move it to: /iAm4Free/test1/generate/txt/information.txt The only difference is the "test" is replaced with "test1". But the constraint is. The parent... (5 Replies)
Discussion started by: iAm4Free
5 Replies

3. Shell Programming and Scripting

Moving files

I wrote a script which moves files on first in first out basis. for i in `ls -ltr | grep ^- | head -10 | awk '{print $9}'` do mv $i Test/ done But donno some reason, this is not working on my Linux box. May i know the reason? Can the above script be done by using positional... (2 Replies)
Discussion started by: venkatesht
2 Replies

4. UNIX for Dummies Questions & Answers

Moving files

Hi I need to be able to move files from one central locations to different servers on our network. So i want all of our operators to place files to one area on the main storage area. From there i need a script that first checks the file is stable (finished copying) then copy to another server,... (5 Replies)
Discussion started by: treds
5 Replies

5. Shell Programming and Scripting

moving the files in a.txt files to a different directory

HI All, I am coding a shell script which will pick all the .csv files in a particular directoryand write it in to a .txt file, this .txt file i will use as a source in datastage for processing. now after the processing is done I have to move and archive all the files in the .txt file to a... (5 Replies)
Discussion started by: subhasri_2020
5 Replies

6. UNIX for Dummies Questions & Answers

Moving Multiple files to destination files

I am running a code like this foreach list ($tmp) mv *_${list}.txt ${chart}_${list}.txt #mv: when moving multiple files, last argument must be a directory mv *_${list}.doc ${chart}_${list}.doc #mv: when moving multiple files, last argument must be a... (3 Replies)
Discussion started by: animesharma
3 Replies

7. Shell Programming and Scripting

Finding files with wc -l results = 1 then moving the files to another folder

Hi guys can you please help me with a script to find files with one row/1 line of content then move the file to another directory my script below runs but nothing happens to the files....Alternatively Ca I get a script to find the *.csv files with "wc -1" results = 1 then create a list of those... (5 Replies)
Discussion started by: Dj Moi
5 Replies

8. UNIX for Dummies Questions & Answers

Moving files..

Selected directories on our system generate alerts when they exceed 60% of the disk space so I have used gzip to make the files smaller on one of the directories in question (AdminServer logs). I want to move these to another directory what is the best way to make this happen? Thanks.. (4 Replies)
Discussion started by: nosuchluck
4 Replies

9. AIX

Moving Hidden files to normal files

I have a bunch of hidden files in a directory in AIX. I would like to move these hidden files as regular files to another directory. Say i have the following files in directory /x .test~1234~567 .report~5678~123 .find~9876~576 i would like to move them to directory /y as test~1234~567... (10 Replies)
Discussion started by: umesh.narain
10 Replies
File::Remove(3) 					User Contributed Perl Documentation					   File::Remove(3)

NAME
File::Remove - Remove files and directories SYNOPSIS
use File::Remove 'remove'; # removes (without recursion) several files remove( '*.c', '*.pl' ); # removes (with recursion) several directories remove( 1, qw{directory1 directory2} ); # removes (with recursion) several files and directories remove( 1, qw{file1 file2 directory1 *~} ); # trashes (with support for undeleting later) several files trash( '*~' ); DESCRIPTION
File::Remove::remove removes files and directories. It acts like /bin/rm, for the most part. Although "unlink" can be given a list of files, it will not remove directories; this module remedies that. It also accepts wildcards, * and ?, as arguments for filenames. File::Remove::trash accepts the same arguments as remove, with the addition of an optional, infrequently used "other platforms" hashref. SUBROUTINES
remove Removes files and directories. Directories are removed recursively like in rm -rf if the first argument is a reference to a scalar that evaluates to true. If the first arguemnt is a reference to a scalar then it is used as the value of the recursive flag. By default it's false so only pass 1 to it. In list context it returns a list of files/directories removed, in scalar context it returns the number of files/directories removed. The list/number should match what was passed in if everything went well. rm Just calls remove. It's there for people who get tired of typing remove. clear The "clear" function is a version of "remove" designed for use in test scripts. It takes a list of paths that it will both initially delete during the current test run, and then further flag for deletion at END-time as a convenience for the next test run. trash Removes files and directories, with support for undeleting later. Accepts an optional "other platforms" hashref, passing the remaining arguments to remove. Win32 Requires Win32::FileOp. Installation not actually enforced on Win32 yet, since Win32::FileOp has badly failing dependencies at time of writing. OS X Requires Mac::Glue. Other platforms The first argument to trash() must be a hashref with two keys, 'rmdir' and 'unlink', each referencing a coderef. The coderefs will be called with the filenames that are to be deleted. SUPPORT
Bugs should always be submitted via the CPAN bug tracker http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Remove <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Remove> For other issues, contact the maintainer. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Some parts copyright 2006 - 2012 Adam Kennedy. Taken over by Adam Kennedy <adamk@cpan.org> to fix the "deep readonly files" bug, and do some package cleaning. Some parts copyright 2004 - 2005 Richard Soderberg. Taken over by Richard Soderberg <perl@crystalflame.net> to port it to File::Spec and add tests. Original copyright: 1998 by Gabor Egressy, <gabor@vmunix.com>. This program is free software; you can redistribute and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-03-18 File::Remove(3)
All times are GMT -4. The time now is 03:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy