| concatenate files together in new file | cat oldfile1.ext oldfile2.ext > bothfiles.ext |
| copy a file and prompt before overwriting | cp -i existingfile newfile |
| copy top # lines of a file to a new file | head -# filename > newfilename |
| move a file and prompt before overwriting | mv -i existingfile newfile |
Showing posts with label Move. Show all posts
Showing posts with label Move. Show all posts
Wednesday, March 30, 2011
Copy / Move
Thursday, March 11, 2010
Does a File Exist?
for EXTENSION in txt TXT csv CSV xls XLS # For each one in this list, do # do the following: echo $EXTENSION # Display the extension. if [ -e *.$EXTENSION ]; # if a file exists like that... then ls *.$EXTENSION |wc -l # then display the count mv *.$EXTENSION /dfact/fchecks/out_backup # move file to the backup dir else echo ' -- not found' # otherwise, display 'not found' fi done
Subscribe to:
Posts (Atom)