The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
269 views

Move files to mapped network folder

I was wanting to know the best or preferred way to move files from one computer to a networked hot folder. I have looked at mv and cd but all the references discuss using it locally. I would need to ...
0
votes
2answers
112 views

Including a date in a filename

Inside a directory, there are 150 files named like ABLIMITS.TXT. How do I rename them to ABLIMITS_date.txt prompting the user for date?
4
votes
2answers
231 views

Copy files with deleting suffix in name

How can be done coping files that have some suffix at the end, into same dir with the smallest command possible: Example have directory containing files: cassandra.yml.example database.yml.example ...
1
vote
4answers
1k views

How to rename files with sed and csv

I'm new with Linux, sed, and awk but I don't mind challenging myself on new ideas. That being said, I understand the purpose and how to use rename and sed for a common event such as adding a $date or ...
3
votes
3answers
424 views

Rename multiple directories decrementing sequence number?

I have a directory which contains a number of subdirectories with names on the format dir.##. The prefix is always the same, and the suffix is 1-3 digits in a strictly incrementing sequence. Thus, ...
1
vote
3answers
171 views

How to move all files plus hidden to folder down?

I want to move all my drupal files in www folder to html folder. I don't know how to do this in terminal and I'm not sure if all folder and files including hidden ones are drupal in the www folder, is ...
2
votes
2answers
192 views

How do I rename multiple files [duplicate]

Possible Duplicate: How can I rename a lot of files using a regex? I've got some files named abc-10.5.3.1-1.x86_64.rpm abc-compiler-10.5.3.1-1.x86_64.rpm abc-10.5.3.1-6.x86_64.rpm ...
7
votes
3answers
3k views

adding text to filename before extension

I would like to add text to the end of filename but before the extension. Right now I am trying, for f in *.shp; do echo $f_poly; done the output is, Quercus_acutifolia.shp_poly ...
0
votes
4answers
488 views

Bash Globbing Variable Substitution? [duplicate]

Possible Duplicate: Batch renaming files I want to rename files using their existing name as a base for the new one. So if I can ls these files with ls blue*+(.png) I'd want to rename ...
5
votes
5answers
2k views

Replace dots with underscores in filenames, leaving extension intact

I have a bash script which I'm trying to get to replace dots in filenames and replace them with underscores, leaving the extension intact (I'm on Centos 6 btw). As you can see from the output below, ...
1
vote
1answer
554 views

How to move files with same name and concatenate

My directory structure is given below. I need to move all the folders from Test3 to Test2 and concatenate the files with same names [jg@hpc Test2]$ tree . |-- Sample_1008 | |-- ...
0
votes
1answer
2k views

How to change the Name of Logical volume in Volume group

I created an LVM and inside that i created Volume Group and within it created Logical Volume and given the mount point /u001/app/pracle I named it wrong instead of ORACLE i it should have been typed ...
1
vote
1answer
153 views

Rename directory based on date of file in directory

I am looking for a smart way to bulk rename directories in my photo library based on the date the pictures were taken. My specific use case: Export the image library from iPhoto or Aperture on OS X ...
0
votes
1answer
75 views

Find and use the path of a file?

I'm trying to find the path of a file and move it. When I try realpath, it is not useful. For example : I want to move the file All Hail the Generalist - Vikram Mansharamani - Harvard Business ...
-1
votes
1answer
224 views

How to add a string of numbers to multiple text files in a directory?

file.txt file2.txt file3.txt I want to add 99999 to the begining of the all the file names without changing anything else in the file name in solaris 10.
11
votes
3answers
3k views

Flattening a nested directory

This is probably very simple, but I can't figure it out. I have a directory structure like this (dir2 is inside dir1): /dir1 /dir2 | --- file1 | --- file2 What is ...
4
votes
1answer
317 views

How to rename all files and add image size to file name

I can`t make this work. I have a lot of images and i want to rename his name and append image size to name using exiv2 eviv2 pr * prints all info about file # exiv2 pr 9b523e5a002268fe5067a928 File ...
1
vote
3answers
114 views

Restructuring directories into a hierarchy

I have the following type of folder structure containing thousands of folders. The folder names are as such with different names etc .test .test.subfolder .test.subfolder.subsubfolder .folder ...
9
votes
6answers
22k views

How to move all files and folders via mv command

How can I move all files and folders from one directory to another via mv command?
4
votes
4answers
242 views

Follow a moved file to its destination directory

Is there a way to move a file from a directory to another and then cd into the latter in one command? Something like mv /a/file /another/dir && cd _ but without typing second time the ...
0
votes
2answers
613 views

batch rename a few files [duplicate]

Possible Duplicate: Batch renaming files I have some files that I wish to rename in a single command. The files are names thus. I want the E S Posthumus bit removed from the names and also ...
4
votes
4answers
446 views

How to shift filename numbers without collisions?

Consider this list of files: $ touch index-{1,2,3,4,5,6,7,8,9}.txt If I want to shift them down so they start at zero, it's relatively easy: $ rename --verbose 's/^index-([1-9])\.txt$/$1/; ...
3
votes
1answer
1k views

When we use mv command, what changes take place in HDD?

Under following conditions- mv within the same HDD partition mv to a different partition in the same HDD mv to a different device (e.g. USB HDD) Is the complete file moved or is it a very small ...
6
votes
7answers
5k views

Bulk rename, change prefix

How can I bulk replace the prefix for many files? I have a lot of files like TestSRConnectionContext.h TestSRConnectionContext.m I would like to change all them to CLConnectionContext.h ...
4
votes
2answers
235 views

Trying to do arithmetic in Perl rename tool (Debian)

Supposed I have five mp3 files: 01-trackfoo.mp3 02-trackbar.mp3 03-trackbaz.mp3 04-trackabc.mp3 05-trackxyz.mp3 Now I give a quick listen to the files (just mplayer on console will do the trick) ...
0
votes
2answers
675 views

File extension case sensitivity on CentOS [duplicate]

Possible Duplicate: How to clean up file extensions? I'm using CentOS. There are >10M images in one of my folders, which are furthur grouped into subdirectories. The issue is that some of ...
3
votes
2answers
846 views

How do I get this find and rename command to work with subdirectories? [duplicate]

Possible Duplicate: Recursive rename files and directories I have a large directory of music files that is often changing as files and directories come and go. My preference is to make sure ...
3
votes
1answer
778 views

Can't rename a directory that I own

I have a directory with a big load of sub directories. I own all of them, and the permissions are all 777. pascal@azazel /box $ ls -al total 147872 drwxr-xr-x 293 root root 12288 aoû 22 19:44 ...
22
votes
3answers
8k views

Why unix mv program doesn't need -R (recursive) option for directories but cp does need it?

This is a kind of "wtf?" question, so I'm sorry if I will disturb someone's vision of how things should be or if I will just annoy you with the "stupid" question. I always get messed up when need to ...
1
vote
1answer
145 views

Move some files on every dir to a different dir [duplicate]

Possible Duplicate: How can I move files by type recursively from a directory and its sub-directories to another directory? I'm quite new to Linux and specially to the shell and all of its ...
3
votes
2answers
345 views

rename randomly files on a USB device

I would like to rename all of my files of my USB device randomly. Indeed, in my car, my tuner has not the random function. I think I can do it with PHP ... but I'm pretty sure it is possible to do ...
3
votes
5answers
447 views

Flatten Directory but Preserve Directory Names in New Filename

How can I flatten a directory in the following format? Before: ./aaa/bbb/ccc.png After: ./aaa-bbb-ccc.png
3
votes
2answers
2k views

Remove prefixes from filenames

I have a bunch of files as follows: 04602635_b0294.DAT20120807164534 04602637_b0297.DAT20120807164713 04602638_b0296.DAT20120807164637 04602639_b0299.DAT20120807164819 ...
4
votes
1answer
231 views

xterm doesn't switch directory when it is moved

Recently I was very frustrated with xterm not behaving as expected. This is what I was doing: open xterm run the following commands: $ mkdir test_01 $ cd test_01/ $ echo 'a' > a $ cat a The ...
1
vote
1answer
401 views

rename files maching specific mtime value within directory

I use simple set of shell commands to in order to create mysqldumps daily. The script is called by cron daemon. It looks like: presentdate="`date +%d-%m-%Y_%H:%M.%S`" basedir="/var/db_my_backup" ...
3
votes
3answers
2k views

Rename multiple directories

I want to find all directories with the last subdirectory named doc, for then rename them to Doc. How can be renamed? I've the first part: find -type d -name 'doc' which returns directories paths ...
2
votes
1answer
366 views

Detect file-type with the help of magic-file and rename file-suffix accordingly

I have a folder (the iPhone Backup) with various files without a suffix. I want to run a batch process over these files, which detects each file's file-type (with the help of the magic-file database ...
6
votes
4answers
4k views

Renaming a bunch of files with date modified timestamp at the end of the filename?

So, say, I have a directory with a bunch of files like g.txt, where g.txt was last modified on, say, June 20, 2012. How would I batch-rename all of the files (like g.txt) with the last modified date ...
16
votes
2answers
1k views

What does mv do in case of errors?

I've just tried to move a big tree from one disk to another, which was too small. Now, I'm left with something I can't really understand - it looks like some files were indeed moved away from the ...
3
votes
1answer
3k views

Gunzip multiple files and rename them

I want to know whether it is possible to gunzip multiple files and rename them with one command/script. I have a bunch of files in the format: test.20120708191601.DAT.3599502593.gz ...
4
votes
1answer
1k views

How do permissions work when moving directories?

Recently I tried to move a directory that I own to another directory (which I also own), but I couldn't. I then noticed that I don't own the parent directory. This made me wonder what are the rules ...
0
votes
2answers
2k views

How can I rename all files in the current directory having a particular extension to another extension? [duplicate]

Possible Duplicate: Renaming multiple files (changing extension) Suppose that in my current/working directory I have five files: file1.xvg file2.xvg file3.xvg file1.eps file2.eps Is ...
2
votes
1answer
183 views

prepend digit to filenames which begin with digits (with zmv, please)

I have a directory with files named like 19.png, 20.jpeg, and README00.txt I want to rename these to 119.png, 120.jpeg, and README00.txt. I would like to do this with zmv as it works well in so many ...
3
votes
2answers
935 views

How do I find a bunch of files with a string in its filename (or body text) and then move all those files to a specific folder?

Say - what if I wanted to move every HTML file in several independent directories with the word "heavengames" in its filename (and as a second question, every HTML files with the word "heavengames" in ...
1
vote
4answers
397 views

Recursively rename e-mail files from .txt to .eml

Directory "$d" contains a few thousand e-mail files with the .txt extension. To open them in my e-mail client, I need to rename them to .eml Will this command rename them correctly: find "${d}" ...
2
votes
3answers
7k views

Rename files by incrementing a number within the filename

I have a directory which contains numbered image files, something like this: 01.png 02.png 03.png 03.svg 04.png 05.png 06.jpg 07.png 08.png 09.png 09.svg 10.png Sometimes there may be multiple ...
10
votes
1answer
3k views

Best way to continue stopped move (mv) by merging directories?

I have moved (mv) a pretty large directory on my NAS (Linux based), but had to interrupt the procedure. Not being a regular Linux user, I though I could just continue and merge the rest later in. mv ...
1
vote
1answer
245 views

Switching source and destination (or undoing the mv, cp operation)

mv or cp commands both expect source and destination as arguments. In case you want to undo the change you made, or just change the source and destination you supplied before, what is the quickest ...
5
votes
3answers
562 views

Linux Rename File Beginning with “--” [duplicate]

Possible Duplicate: How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)? This is an awkward one, I have received some files from a windows machine ...
13
votes
5answers
844 views

How to remove the (1) from filenames using the find command

I recently converted all of my FLAC files to a lower sampling rate of 44.1 kHz and bit depth of 24 bits (because iPhone/iPod don't support anything above that) using XLD on my Mac OS 10.7 (Lion). ...