I have a directory which was downloaded and has a silly name like "-=Directory=-" on my headless (no GUI) linux box and when I try to deal with this directory using "mv" in order to rename it or move it somewhere, it simply does not work. Terminal instead says:
I feel like this should have come up before, but is there a convenient way of moving something [directory is what I care about] while leaving a symbolic link in its place? Currently the best way I can find is:
Terminal: -script of 'mv "$1" "$2"; ln -s "$2" "$1"' -requires typing out the target name, since it tab completion doesn't work on non-existent things. GUI: -move -rename [copy content first] -link back -rename link [paste previous content]
The terminal way defeats the point of using the GUI to easily drag and drop things around, and the GUI is rather clumsy when I have to use copy and paste to even make it work. Being able to manually edit a link target would simplify it, but I don't know of a way to do that.
Note that I'm pretty sure I don't want a terminal solution here, because it's stuff which I don't want to type (and sometimes can't.. seriously, I don't want to try to type a star). Example:
#source: foo/Some Long thing that has ~random~ characters[a#$%] (%^^) that are annoying!/ #target: bar/Something Short/
I am hoping someone already has a script or knows of an app that will let me do this fairly easily - I have a fairly large folder structure that goes several levels deep, etc. In many cases there are duplicate file names that are not really different, e.g., /home/chris/folder/folder1/doc1.doc /home/chris/folder/folder2/folder3/doc1.doc
I want to recursively go through /home/chris/folder and move everything to /home/chris/another_location/ without subfolders and renaming duplicates as appropriate, e.g., /home/chris/another_location/doc1.doc /home/chris/another_location/doc1_1.doc
Just built myself an HTPC from scratch and installed Ubuntu 10.10 on it (using XBMC for now). I'm familiar with Linux and have been dabbling with it for many years but in the end my main computer runs OS X.Trying to modify a script I found elsewhere that will auatomagically rename and move downloaded TV shows into a preexisting file hierarchal system. I have an automator function on my Mac that was put together for PLEX but it will obviously not run in Ubuntu.Here's what I've got so far. Remind you I'm not much of a programmer:
I recently had data recovered and it was sent back to me on what I think is an NTFS drive. I copied all the files over to a file share I have on a Linux box, that's ext4. Now I have that share mounted on my OSX machine, and I can't move or rename most of the files. However, in a couple cases I was able to rename a folder after the third try. Another time I was able to rename a folder once, but not again. All the permissions are showing up the same on the command-line -- I can't see any differences between the permissions on any of the files/folders. Note that I can create new folders and add files no problem, and then rename and move those all I want.
I want to search a directory recursively looking for new .rar/ .zip files. When a new file is found I want to extract the contents to another directory. To top things off would like to rename the source file as something like original.rar.extracted.
I have many files in a directory. They all have names with a .pdf extension. How can I remane all of them so that they are named as so... 1.pdf, 2.pdf, 3.pdf? I want to do it with one command or somehow that I do not have to manually rename each one.
I want to rename all files in a directory to "random" names(the point is that the name does not exist, it can be anything). In my case is it *.wav file i want to rename, i basically want to burn cd's to my pc with cdparanoia, then rename them and put them in a directory with other songs i have which also have been given random names. (i'm creating a big music directory where the songs have no names)And i will eventually make a script to make things easier, but for some reason i can't think out a way to rename the files randomly, and i guess "$RANDOM" is a good variable to use but.. how?EDIT: And while i'm at it, is there any way to use the "play" command in the terminal, by "sorting" music files in a directory randomly, and then play them, so it will not be played the same order again?
I came from the Debian world so I did not do much building software from source. I successfully built wine from source, now the wine binary is in the same directory where the Makefile and all of the other source stuff is. I can run wine from that directory fine, but I sort of want to move it somewhere else. I tried moving the wine binary somewhere else, but when I try to run it I get
[code]...
What all do I have to move into the new directory to get wine working in the new directory? By convention, where should I move wine, I want it available for all users, should I move it to /opt/wine, or /usr/local/wine, or somewhere else?
Rhythmbox seems unable to handle a directory rename. My problem is the following:
1. Create a playlist in Rhythmbox with some songs in it. 2. Close Rhythmbox. 3. Rename the directory with the songs in it. 4. Open Rhythmbox. 5. The songs are gone from Rhythmbox' index and can be found under "Missing Files". New versions of the songs show up, but this is not very helpful, as the playlist is empty.
I searched the web and found a known bug which occurs if step 2 is left out (that is, a directory rename with Rhythmbox open). However, in my case, even changing a directory name without Rhythmbox running breaks its file index.
How is the best way to rename an existing user and his home directory under Debian Lenny? BTW I'd like to have the same settings like Desktop Icons, Bookmarks etc.
Newbie 1st post here. Trying to find the most efficient way to copy a file to a different directory and rename it with a date stamp extension. Looking to accomplish this with one command if possible.
File = make_file Full path /home/user1/bin/scripts/make_file
would like to move to the following directory /home/user1/bin/scripts/archive/
I'm trying to find out how to use command substitution along with the date command that when I copy the file to the archive directory it gets renamed with a time stamp extension. It should look something like "make_page_12:00:00-24-10-2010" I've tried a few different combinations using the cp and mv commands but can't seem to get it to work the way I want to.
I'm pretty new to bash scripting, but I really want to wrap my head around it.What I'm trying to do is: From directory "A": Go in to all subdirectories and rename all files within icrementally according to the directory name. SO:
Create a copy of the file above and call it commands.sorted. Use the vi command to manually sort this file. I.e. use yy to copy a line, P or p to paste a line, and dd delete a line. Order the commands with the two lines starting with double quotes first. Then list the rest of the command in alphabetical order.
Anyone have any ideas what he's talking about? Can I copy a file and rename it at the same time while copying it to the same exact directory again? Now sure what the two lines things means either. I have an email out to him but it usually takes a long time for him to answer me. I got alot of work to do so everytime I get hung up it kills me.
I would like to move the /home directory to a different location, there only seem to be guides on how to move it to it's own partition.
I have a drive (/dev/sda5) mounted as /media/data
I would like to move /home to /media/data/home?
I have tried usermod but get the following error:
Code: test@TestServer:/media/data$ sudo mkdir /media/data/home test@TestServer:/media/data$ ls home lost+found test@TestServer:/media/data$ sudo usermod -dm /media/data/home usermod: user '/media/data/home' does not exist
Ubuntu 10.04. I've tried every method I can find and none work. Here's what I know...
1. My /etc/my.cnf is ignored. I can even delete it and phpmyadmin continues to work as it did before.
2. If I move /var/lib/mysql and replace it with a new directory (chowned to mysql:mysql so it looks like it's got the same ownership & permissions as the original) I get a write permission problem, e.g.
Quote:
What I ultimately want to do is used existing database files on a FAT32 partition but I can't even get to first base.
Ubuntu 10.10 32 bit/ and /storage are on two different partitions. I want to move my home directory to the /storage partition, so I went to System -> Administration -> Users and Groups then Advanced Settings then the Advanced tab. I changed Home Directory from /home/billy to /storage/home/billy. I click on ok and I'm asked if I want to copy all the user's files over to the new location or start fresh. I click, Copy Files. It acts like it's doing something, but all it does is create the home/billy directories inside /storage, but it never copies files over and the next time I go to /home/billy it's still in the old location. What the heck is the deal?
How do you do this without breaking all the links and preferences in /home? Does the system take care of everything? Has anyone done it or is it actually system crippling?
I'm doing a little work on my media center and the scrappers seem to do a much better job when each movie is in a directory with the name of the movie. However that's not how i have things set up.I have a few hundred avi files i need moved to directory named the same as the avi file.
We have two folders: source folder and destination folder. In source folder we have many sub folders and many files of different type!Script that would copy or move defined number of files from source to destination folder. Files must be selected randomly and sub folder in source folders must be selected randomly and we don't copy or move defined number of files just form one sub folder in source folder. In destination folder sub directory structure of source folder should not be preserved. Solution should be robust and as simple as possible.
I would like to know how to move all the files from a single folder and its subfolders to a single, different location in as few steps as possible. For example when I download files from one of my school's websites, the file I want is located in a deep sub-directory. So, I have to cd many times just to get to the file I want. Is there a way to recursively move all the files within a folder's subdirectories into a new location?
When installing Ubuntu (10.04) I chose the /home to be installed in a separate partition.I would now like to move the /srv directory into the same partition. The problem I found is that Ubuntu did not make a /home directory inside the partition itself. It just places the account directories in the partition and mounts it to /home. So I cannot just easily move the /srv folder into the partition.
How can I:
Move those account directories into a home folder inside the partition Make that new home folder the default /home folder. ditto with the /srv folder, or any I choose in the future.
I have a directory , there are many files created in it , I want to use the command to move the files which elder than 30 days and gzip it and then move it to /tmp , and then remove those files , I tried use below command but not work.
find ~path -type f -mtime 30 -exec tar -zcvf - {} --remove-files > /tmp/oldfile.tgz ;
As I regularly move between Mac and PC, I thought it would be a good idea to put all my data on an external drive. As Windows 7 and OS X have similar home folder layouts, I just simply put all the folders I need for both on the root of the external drive and changed a few settings so that the Home folder for my user is on the external drive on both Windows and OS X.
Whilst Ubuntu also has a similar structure, I cannot work out how to have it so that my users home folder is on the external drive. I have done a little research and all I can find is how to have the /home directory on another partition. a) this is not what I'm trying to do, just the folder for my user and b) this would mean formatting the external drive to extX format, which just wouldn't work for me.
I am using 9.10 (or will be once the upgrade is complete)
I've found several posts discussing how to do this in with the terminal, but none exactly fit what I am trying to do. And since I'm still very new, I was hoping for some help.
I have a parent directory called "Music." The subdirectories all start with "artist", some go further as in "artist/album/cd1". So right now the structure varies in the following ways code...
How can I move all the files (or the file types that I choose) to the parent directory "music"?
(By the way, for any who are interested, this is so that I can use an external hd with a PS3. ("playstation 3"--for anyone who was in my predicament searching the threads)
I'm running Ubuntu 9.10 and Gnome-Do 0.8.3.1. I have two issues I hope someone can help with.First I've managed to add two folders to the doc, however when I hover over the icon the name is displayed as "..." This might be because the path of the folder is "/home/eric/Desktop/500" which is a link to "/mnt/500" I cannot add the folder without the error listed below. When trying to add folders, and some applications I receive the error:
"Docky Error - Docky could not move the file to the requested Directory. check file name permissions and try again."