Sponsored Content
Full Discussion: Delete files if they exist
Top Forums Shell Programming and Scripting Delete files if they exist Post 302252372 by pederlol on Wednesday 29th of October 2008 09:53:55 AM
Old 10-29-2008
Or alternatively:

rm (res* exept res0.om)

???
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare data in 2 files and delete if file exist

Hi there, I have written a script called "compare" (see below) to make comparison between 2 files namely test_put.log and Output_A0.log #!/bin/ksh while read file do found="no" while read line do echo $line | grep $file > /dev/null if then echo $file found found="yes" break fi... (3 Replies)
Discussion started by: lweegp
3 Replies

2. Shell Programming and Scripting

perl: When dealing with files that do not exist

I have a process run weekly where I must convert data formats for about thirty files. I read a text file that provides all of the filenames and switch settings. My perl code is: for ($j = 1; $j <= $k; $j++) { open(FIN2,$fin2) || die "open: $!"; do other stuff } Every once in... (2 Replies)
Discussion started by: joeyg
2 Replies

3. UNIX for Dummies Questions & Answers

testing if files exist

I am trying to test arguments to see if they are files in any directory. I have : but it's not working (7 Replies)
Discussion started by: skooly5
7 Replies

4. Shell Programming and Scripting

delete all the files in folder a which exist in folder b

Hi , I need a script which basically deltes all files in folder a which are alreasy present in folder b say folder a has files abc.txt pqr .txt and b has abc.txt pqr.txt rmr.txt then file abc.txt and pqr.txt from a should be deleted (6 Replies)
Discussion started by: viv1
6 Replies

5. Shell Programming and Scripting

Find out whether files exist.

I have the following data stored in a file. 1 /home/file13 /home/file2 2 /home/file41 /home/file654 3 /home/file61 /home/file45 4 /home/file81 /home/file43 ... I want to print the first column provided the files represented by the second and third column exist. How to do that? (3 Replies)
Discussion started by: kevintse
3 Replies

6. Shell Programming and Scripting

Script to mail if files do not exist

Hi all! I need some help with a script, but I want to make it better, my script prints the last two files on each directory: echo " " echo "******************* mediation_sgsn:***********************" ls -lrt /moneta_collected03/mediation_sgsn | tail -2 echo " " echo... (6 Replies)
Discussion started by: fretagi
6 Replies

7. Shell Programming and Scripting

File exist for multiple files

Hi, I am unable to achieve the file exist conditions if there are multiple files same similar name for e.g. in a $Direct i am having files like aus.txt aus.txt_pr aus.txt_2012 i need to put a file exist condition like which is not working then echo "File present" but the... (9 Replies)
Discussion started by: rohit_shinez
9 Replies

8. UNIX for Dummies Questions & Answers

Does rsync check and ignore files that already exist?

Hi, We have two (2) servers named primary and standby. There is a directory named /db01/archive that we need to keep in-sync. Files get transferred from primary and standby. Sometimes when we do a failover or when there is a network issue, some files fail to get transferred. I want to use... (3 Replies)
Discussion started by: newbie_01
3 Replies

9. UNIX for Beginners Questions & Answers

Check if 10 files exist

Hi All, Whenever i get 10 files(file names like sales*) then another file need to create. May i know how to implement this in KSH. (4 Replies)
Discussion started by: siddireddy
4 Replies

10. Shell Programming and Scripting

Find command when there exist many files

I want to run find and wondering if it struggles when there are many files. I have tried and does not seem to complain. Is this correct? (8 Replies)
Discussion started by: kristinu
8 Replies
GPHOTO2(1)																GPHOTO2(1)

NAME
gphoto2 - command-line gphoto2 client SYNOPSIS
gphoto2 [--debug] [-q | --quiet] [-v | --verbose] [-h | --help] [--list-cameras] [--usb-usermap-script NAME] [--print-usb-usermap] [--list-ports] [--stdout] [--stdout-size] [--auto-detect] [--port PATH] [--speed SPEED] [--camera MODEL] [--filename FILENAME] [--usbid USBID] [-a | --abilities] [--folder FOLDER] [[-R | --recurse] | --norecurse] [-l | --list-folders] [-L | --list-files] [-m NAME | --mkdir NAME] [-r NAME | --rmdir NAME] [-n | --num-files] [-p RANGE | --get-file RANGE] [-P | --get-all-files] [-t RANGE | --get-thumbnail RANGE] [-T | --get-all-thumbnails] [-r RANGE | --get-raw-data RANGE] [--get-all-raw-data] [--get-audio-data RANGE] [--get-all-audio-data] [-d RANGE | --delete-file RANGE] [-D | --delete-all-files] [-u FILENAME | --upload-file FILENAME] [--capture-preview] [--capture-image] [--capture-movie] [--capture-sound] [--capture-show-info RANGE] [--summary] [--manual] [--about] [--shell] DESCRIPTION
gphoto2(3) is a cross-platform digital camera library, and gphoto2(1) is a command-line client for it. Where an option takes a range of files, thumbnails, or other data, they are numbered beginning at 1. A range is a comma-separated list of numbers or spans (``first-last''). Ranges are XOR (exclusive or), so that ``1-5,3,7'' is equivalent to ``1,2,4,5,7''. --debug Turn on debugging. -q, --quiet Quiet output (default=verbose). -v, --version Display version and exit. -h, --help Display a short usage message. --list-cameras List supported camera models. --usb-usermap-script NAME Use NAME as the hotplug usb script used in the output of --print-usb-usermap. Default is "usbcam". --print-usb-usermap For every camera supported by your version of gphoto2, print the corresponding line for inclusion into the usb.usermap hotplug con- fig file. The script name used in these lines is specified with the --usb-usermap-script option. --list-ports List supported port devices. --stdout Send file to stdout. --stdout-size Print filesize before data. --auto-detect List auto-detected cameras. --port PATH Specify port device. --speed SPEED Specify serial transfer speed. --camera MODEL Specify camera model. Most model names contain spaces: remember to enclose the name in quotes so that the shell knows it is one parameter. For example: --camera "Kodak DC240". --filename FILENAME Specify a filename. --usbid USBID (Expert only) Override USB IDs. -a, --abilities Display camera abilities. -f, --folder FOLDER Specify camera folder (default="/"). -R, --recurse Recursion (default for download). --no-recurse No recursion (default for deletion). -l, --list-folders List folders in folder. -L, --list-files List files in folder. -m, --mkdir NAME Create a directory. -r, --rmdir NAME Remove a directory. -n, --num-files Display number of files. -p, --get-file RANGE Get files given in range. -P, --get-all-files Get all files from folder. -t, --get-thumbnail RANGE Get thumbnails given in range. -T, --get-all-thumbnails Get all thumbnails from folder. -r, --get-raw-data RANGE Get raw data given in range. --get-all-raw-data Get all raw data from folder. --get-audio-data RANGE Get audio data given in range. --get-all-audio-data Get all audio data from folder. --delete-files RANGE Delete files given in range. --delete-all-files Delete all files in folder. -u, --upload-file FILENAME Upload a file to camera. --capture-preview Capture a quick preview. --capture-image Capture an image. --capture-movie Capture a movie. --capture-sound Capture an audio clip. --show-info RANGE Show info. --summary Summary of camera status. --manual Camera driver manual. --about About the camera driver. --shell Start the gphoto2 shell, an interactive environment. See SHELL MODE for a detailed description. SHELL MODE
The following commands are available: cd Change to a directory on the camera. lcd Change to a directory on the local machine. exit, quit, q Exit the gphoto2 shell. get Download the file to the current directory. get-thumbnail Download the thumbnail to the current directory. get-raw Download raw data to the current directory. show-info Show information. delete Delete a file or directory. show-exif Show EXIF information (only if compiled with EXIF support). help, ? Displays command usage. ls List the contents of the current directory on the camera. SEE ALSO
gphoto2(3), gphoto2.txt, gphoto2-cli.txt, http://www.gphoto.org/ EXAMPLES
gphoto2 --list-files List files on camera. gphoto2 --get-file 7-13 Get files number 7 through 13 from the list output by gphoto2 --list-files. gphoto2 --usb-usermap-script gphoto2cam --print-usb-usermap >> /etc/hotplug/usb.usermap Append a line to the hotplug config file /etc/hotplug/usb.usermap for every supported camera, using /etc/hotplug/usb/gphoto2cam for setting up permissions correctly. AUTHOR
The gPhoto2 Team. Man page edited by Tim Waugh <twaugh@redhat.com>. February 2002 GPHOTO2(1)
All times are GMT -4. The time now is 09:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy