10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to do this exact same thing, so far I have created this to move files
i've named my script CP.sh
#!/bin/bash
cd /root/my-documents/NewDir/
for f in *.doc
do cp -v $f root/my-documents/NewDir $f{%.doc}
done
When i go to run this in the console i type, bin/sh/ CP.sh
but it... (7 Replies)
Discussion started by: MKTM_93_SIMP
7 Replies
2. Shell Programming and Scripting
All,
I need to grab and rename common files from several unique directory structures. For example, the directory structures looks like:
/unique_dir/common/common/common/person_name_dir/common_file.txt
There are over 90,000 of these text files that I'd like to put in a single directory as... (5 Replies)
Discussion started by: hburnswell
5 Replies
3. Shell Programming and Scripting
Hi All,
I am doing this for svn patch making. I got the list of files to make the patch. I have the list in a file with path of all the files.
To Do
From Directory : /myproject/MainDir
To Directory : /myproject/data
List of files need to copy is in the file: /myproject/filesList.txt
... (4 Replies)
Discussion started by: linuxadmin
4 Replies
4. Shell Programming and Scripting
Hi All,
I'm trying to list some files from my log directory
and files are like this
log.20110302_20.gz
log.20110302_21.gz
log.20110302_22.gz
log.20110302_23.gz
log.20110303_00.gz
log.20110303_01.gz
log.20110303_02.gz
............
log.20110311_22.gz
log.20110311_23.gz... (2 Replies)
Discussion started by: thelakbe
2 Replies
5. Shell Programming and Scripting
I have a question regarding Perl scripting.
If I want to say open files that all look like this and assign them to a filehandle and then assign the filehandle to a variable, how do I do this?
The file names are
strand1.fa.gz.tmp
strand2.fa.gz.tmp
strand3.fa.gz.tmp
strand4.fa.gz.tmp
...... (6 Replies)
Discussion started by: japaneseguitars
6 Replies
6. Shell Programming and Scripting
Hi All
I am having hundred over file in the below pattern.
AA050101.INI
BB090101.INI
.
.
ZX980101.INI
Need to rename these files with an extension .bak
AA050101.INI.bak
BB090101.INI.bak
.
.
ZX980101.INI.bak (5 Replies)
Discussion started by: karthikn7974
5 Replies
7. UNIX for Advanced & Expert Users
I am userB and have a dir
/temp1
This dir is owned by me.
How do I recursively copy files from another users's dir userA?
I need to preserve the original user who created files, original group information, original create date, mod date etc.
I tried
cp -pr /home/userA/* .
... (2 Replies)
Discussion started by: Hangman2
2 Replies
8. Shell Programming and Scripting
hi
I want to copy all files from the current directory and move to .archive file.
Moreover,I want to add .bak to each file name, that will be copied.
How can I do that? (4 Replies)
Discussion started by: tjay83
4 Replies
9. Shell Programming and Scripting
How do I use cat (presumably with a sh script) to combine all the files in a directory without listing them individually.
Thank you for your patience with this very elementary question.:) (3 Replies)
Discussion started by: Enobarbus37
3 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
Would like to rename all files using wildcards - if at all possible!
As an example I have the following files:
Nov01_df
Nov02_df
Nov03_df
......
Nov28_df
Nov29_df
Nov30_df
I'd like to have these renamed as "df??" where ?? is the number from the original file name.
Any... (5 Replies)
Discussion started by: Cameron
5 Replies
MTOOLS(1) General Commands Manual MTOOLS(1)
NAME
Mtools - a collection of tools for manipulating MSDOS files
SYNOPSIS
mattrib - change MSDOS file attribute flags
mcd - change MSDOS directory
mcopy - copy MSDOS files to/from Unix
mdel - delete an MSDOS file
mdir - display an MSDOS directory
mformat - add an MSDOS filesystem to a low-level formatted diskette
mlabel - make an MSDOS volume label
mmd - make an MSDOS subdirectory
mrd - remove an MSDOS subdirectory
mread - low level read (copy) an MSDOS file to Unix
mren - rename an existing MSDOS file
mtype - display contents of an MSDOS file
mwrite - low level write (copy) a Unix file to MSDOS
DESCRIPTION
Mtools is a public domain collection of programs to allow Unix systems to read, write, and manipulate files on an MSDOS filesystem (typi-
cally a diskette). Each program attempts to emulate the MSDOS equivalent command as closely as practical.
MSDOS filenames are optionally composed of a drive letter followed by a colon, a subdirectory, and a filename. Subdirectory names can use
either the '/' or '' separator. The use of the '' separator or wildcards will require the names to be enclosed in quotes to protect them
from the shell.
The regular expression "pattern matching" routines follow the Unix-style rules. For example, '*' matches all MSDOS files in lieu of '*.*'.
The archive, hidden, read-only and system attribute bits are ignored during pattern matching.
All options use the '-' (minus) flag, not '/' as you'd expect in MSDOS.
The mcd command is used to establish the device and the current working directory (relative to the MSDOS filesystem), otherwise the default
is assumed to be A:/.
SEE ALSO
mattrib(1), mcd(1), mdel(1), mformat(1), mrd(1), mren(1), mtype(1), mcopy(1), mdir(1), mlabel(1), mmd(1), mread(1), mwrite(1)
BUGS
An unfortunate side effect of not guessing the proper device (when multiple disk capacities are supported) is an occasional error message
from the device driver. These can be safely ignored.
local MTOOLS(1)