LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 08-20-2013, 07:02 AM   #1
L a r r y
Member
 
Registered: Aug 2011
Distribution: Linux Mint 20.3 Cinnamon
Posts: 32

Rep: Reputation: Disabled
Want to change how pasted files are named "(copy)," "(another copy)," "(3rd copy)"


I copy a file and paste it into the same directory for making a backup of the file using the X windows GUI in Ubuntu 12.04..

"test.txt" will be copied and pasted, becomes "test(copy).txt" and if pasted again is named "test{another copy).txt."

I would prefer a numbering scheme as happens with "(3rd copy)" and beyond in place pf "another copy."

Actually to stay in alphabetical order, one might need
test.txt <-- original file
test(copy).txt
test(copy2).txt
test(copy3).txt

There is a way to alter this behavior, I'm sure, this being Linux. Has anyone any ideas?

Thanks!
 
Old 08-24-2013, 10:34 AM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
RTFM for cp

you want numbered backups when source and dest are same
 
Old 08-24-2013, 03:03 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
It appears that you are running Gnome and Nautilus as the file manager. I do not know if you can change the default behaviour but it is possible to create your own scripts and add them to the right click menu.

I quick search did not find an existing script but that does not mean one does not exist.

http://g-scripts.sourceforge.net/
https://help.ubuntu.com/community/NautilusScriptsHowto
http://gnome-look.org/?xsection=home

Last edited by michaelk; 08-24-2013 at 03:05 PM.
 
Old 08-24-2013, 03:39 PM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
had a very quick look at the source for Nautilus

seems the "another copy" is in the po files

( root of source )
Code:
grep "another copy" po/* -H
gets you..
Code:
po/crh.po:msgid " (another copy)"
po/crh.po:msgid "%s (another copy)%s"
po/cs.po:msgid " (another copy)"
po/cs.po:msgid "%s (another copy)%s"
po/cy.po:msgid " (another copy)"
po/cy.po:msgid "%s (another copy)%s"
..... and so on
Untested..
Code:
sed -i 's/another copy)%s/2nd copy)%s/' po/*.po
and compile, should get you what you want..


ultimately I think michaelk's suggestion of looking into the scripts side might be less work in the long run

alternative is to use kde's dolphin, its default behaviour is simple 'numbering' when hitting "suggest new name"
 
1 members found this post helpful.
  


Reply

Tags
copy, gui, paste



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I Add Destinations in "Copy To" and Move To"? jimwg Linux - Desktop 3 12-06-2012 08:56 AM
Did you "copy that floppy" or "DO" Linux in college? alan99 General 1 04-11-2011 06:22 AM
[SOLVED] need to copy all " *.SEED " files and paste them inside a new folder each time rastin_nz Programming 1 11-03-2010 05:02 PM
How do i "copy" one bios and "paste" it onto another identical machine Yerp Linux - Hardware 2 01-10-2007 08:31 PM
Ntfs-Fuse copy error Debian "Sid" / Ubuntu "6.06" animefriik Linux - General 0 10-06-2006 09:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration