Ubuntu :: Moving/copying Files And Directories To Base Directory Of User?
Mar 12, 2011
How do I copy and/or move files to the base folder of a user? I don't know what is is called, so I do not know what to put in the my file "?" command? I know you would normally put mv filename /directoryname, but what is the base username called?
I just installed the 11.4 version after using numerous previous versions. During this install the /usr directory was placed in a separate partition. How would I go about placing it in the partition with all the other running directories?
I downloaded some backgrounds from Gnome Art and am having trouble moving them to the backgrounds folder. I've been trying this: sudo mv desktop <filename> usr/share/backgrounds.I moved to the desktop to make it easier.
i am in need of linux help. iam at college and i need this back/restore script to pass this final part of an assessment. i require a backup script that will not only backup but also restore files to the relevent directories. e.g. users are instructed to store all wordprocessor files in a directory named wp. so i am needing to create a backup directory and 3 directories within that and some files within the 3 directories and then back them up ot restore them. l know i should/have to do this myself by been trying to get/understand info for the last few days and came up with zero.
How would i go about copying files to a directory, yet skip the files that already exist in the directory, and also remove the files that are in the directory. For example:
Code:
$ls /dir1 img001.jpg img002.jpg
[code]....
Now i would like to copy from dir1 to dir2, but the contents of dir2 would be:
whenever I copy (or move) files from one place on my hd to another One or two of them dont copy, and I get an error similar to " There was an error copying the file into [location]. Show more details> Error splicing file: Input/output error. The file is always an .avi file and always between 600MB and 1.4GB in size, how can I fix this problem?
I have a directory tree with lots of folders. I need to gather all files of same type, say .txt, and place them in a different folder all by themselves.
I know I can use the mv command, but it won't let me go through all the subdirectories of my folder, just the current one. How can I search through all subdirectories for all .txts or whatever and move them to a folder of my choosing?
I have 60+ directory's each containing multiple .doc files. I need to move them to a single directory and keep their file name intact. I don't think cp will do that with out listing all the file names. I was thinking of something like: cp -r /dir/*.doc /newdir . Or should I use a combo like find -type *.doc|cp /newdir?
Description: I am a newly appointed system engineer taking care of linux servers. We have a new set of data coming in which need below configuration: How to do a script with function?:
for files with ".txt" in sm copy each of the files to folder : sm1 and sm2 (log every copy) if succesful: remove original log into the log file if not successful: (not successful copying 1 particular file to all the folders) retain and retry log into the log file mail out the admin with that particular file name
I have already do try a bit: cd /export/home/ for dir in sm1 sm2; do cp -p sm/*.txt $dir/ done Is my starting right? How to do the rest parts?
I have a bunch of .7z files in a directory, and I need to put each one of them into a separate directory, named after the file (without extention). The command line I use:
I have encountered the following error, taylor@ubuntu:~/Projects/Slicer4/Applications/CLI/Multiply/Data$ mkdir Baseline taylor@ubuntu:~/Projects/Slicer4/Applications/CLI/Multiply/Data$ svn mv ~/Projects/Slicer4/Testing/Data/Baseline/CLI/MultiplyTest.nrrd Baseline svn: 'Baseline' is not a working copy
I am simply trying to move a file (MultiplyTest.nrrd) into a new directory (Baseline) in order to make the program (Slicer4) more organized. I googled my error and found a few like it but they all involved installing SVN so none of the solutions apply to me. And I have tried deleting Baseline and remaking it.
I am using a touch command to setup a specific range of names, identifiers, etc. Now I am trying to move the files from a certain range to another directory I created. Sorry to post just can't remember how to do this but I know it is fairly simple for you guys. I have the output set as fred*_[!g].* and I am trying to get these files to my created directory.
I've a directory containing around 2.8 lacs of files. I want to move them to another directory.If I use cp or mv then I get an error 'argument list too long'. If I write a script like
for file in ls *; do cp {source} to {destination} done
then because of ls command , its performance degrades.How can I do this?
works fine at moving all files anywhere below the current directory to the current directory.
My question is can it be modified so it only moves all the files up one directory layer? Otherwise I shall have to cd 100 or so times and run it in each directory i want to compress...
I imagine the directory below which the file is stored is in the % somewhere it is just a case of extracting it and applying it to the mv command, yes?
i would like to copy all files from my server001 (/var/www/vhosts/*/httpdocs/) to my server002 (/var/www/virtual/*/htdocs/) i would do it via rsync... but i dont want to do it as root! what would be the right user with which I should login myself via rsync? www-data? its the group of each domain-folder...
Quote:
server002:/var/www/virtual# ls -lh insgesamt 4,0K drwxrwx--- 10 vu2001 www-data 4,0K 9. Mär 09:58 domain.com server002:/var/www/virtual#
but the files inside htdocs are only accessable for the user!
Code:
server002:/var/www/virtual/domain.com/htdocs# ls -lh | grep index.php -rwxr-xr-x 1 vu2001 vu2001 397 24. Feb 23:30 index.php server002:/var/www/virtual/domain.com/htdocs# server002 will be the backup-server if the server001 is down!
For some reason, my user directories don't seem to process php files. For example, server/~reduxtion/index.php forces the browser to download the file while server/index.php is fine.
I have limited experience in terminal, but let me first explain what I am trying to do to see if there is some easier way to do it. Basically I want to change the skin in aMSN. I downloaded the new skin but am unable to unzip or move it without /root permissions. I don't know how to acquire this without being in terminal. So I figured there had to be some way to go into the terminal and use it to move the unzipped folder from the desktop to the aMSN skins folder.
I am using CentOS 5.5 and I created few users (useradd john etc.) and now I want to assign privileges to this user on some directories and files in those directories. For example I want to give read privileges to directory "/documents" and all of files under that directory.
The current directory contains:A file called "original.txt" Many directories called "source_001", "source_002", "source_003" ... From the command line how do you copy "original.txt" to "source_001" and "source_002" and "source_003" ...
The total number of these source directories is unknown, it changes every week.
Well, let's suppose the file is very large, say 10 GB of disk space it is consuming. We perform the above steps. Which operations: cp (copying) or mv (moving) will be more efficient and less time consuming? The inode number 1566966 which was pointing to the file in my home directory is now pointing to the same file which is in some other directry, i.e. /tmp/. Isn't the inode value getting modified in some ways to point to the correct location / beginning of the data block on the hard disk? If the the physical location of the data would not change then we would not be able to free up space in our home directory. That means the mv operation is copying the file into some other location. In other words, it is also performing the cp operation first and then deleting the file from its original location, my home directory in the case above. However, when a file is copied it's inode value changes. But the mv operation is retaining the same indoe value. So, how to determine which operation - mv or cp - is more CPU-friendly or more efficient in terms of performance and time taken to perform the action?
I just got myself a OCZ vertex 2 SSD and have been moving cache directories to a ram drive to try to help extend the life of my SSD and improve system performance. I have created a ram drive /tmp directory in fstab like soCode: tmpfs /tmp tmpfsnodev,nosuid,noexec,mode=1777 0 0 And have since moved my Firefox temporary files to the /tmp directory and it have gotten me thinking, what else can I move here. I am going to upgrade my computer to have 8gb�s of ram which is way more than I�ll ever need.I would like to move the transmission cache dir there but I don�t know how to. Anyone have any tips on that? I was thinking of maybe a script that will run when I login to create a symbolic link?
My root filesystems flooded so I'm trying to move it to another (bigger) partition but I'm not sure of the best method. I just tried to use "dd if=/dev/sda1 of=/dev/sda6" to copy it but all that did was give me a brand new partition with no freespace available presumably because the filesystem is smaller than the partition. Is it possible to make the filesystem bigger?
After scouring the internet I was able to find an Adobe release of Adobe Flash Player Square for Linux 64 bit installations in the form of a file (libflashplayer.so). After copying the file to several different Mozilla directories and also making libflashplayer.so executable with the use of chmod +x libflashplayer.so I was unable to install the plug-in.To what directory must I install this .so file to get it to work? Also when I open the browser and user url://aboutlugins I don't see Adobe Flash Player Square yet. Is there an intermediary step?
I m having a RHEL-5 sever.ABC directory size is 57GB after taking backup in the same disk with name ABC.bkp showing 56GB. i used below command to copy/backup. # cp -r ABC ABC.bkp (different sizes after copying)..I checked both the directory sizes by #du -sh <ABC> and du -ks <ABC.bkp>In both GB and KB there is lots of difference (200mb). why this will happen in copying? what is the solution for above question? what is the correct way of copying 1dir to newdir exactly?
I was having trouble getting php files to display properly on my ubuntu 10.10 LAMP setup. Everything was installed with defaults and working properly. testphp.php worked as long as it was in the sites parent directory, but any php files in user directories did not work. All browsers tried to download the php files located in /home/user/public_html instead. I tried to use the help documents here, [URL]..
Finally I was browsing around in the /etc/apache2/mods-available directory and looked at the php5.conf file. Here is the relevant information from the file:
Code:
# To re-enable php in user directories comment the following lines # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it # prevents .htaccess files from disabling it. # <IfModule mod_userdir.c> #Comment out this line
[Code]...
I tried to edit the help document linked above but it says not to do so! I couldn't find a reference for this fix anywhere else, so I decided to post it here.
I am writing a script, in that my requirement is, if all the fill types stored in one directory from that we need to separate different different directories based on the file types.
for example in a directory(anish). 5 different types files 1- directory 2- .txt files 2- .sh files
like that and my requirement is the (1- directory is moved to one new directory(dir) which we are given in the script)and (2 .txt files are moved to another new directory(test) which we are given in the script)and ( 2 .sh files are moved to another new directory(bash) which we are given in the scrip)finally the directory anish should be empty..using bash script.how it is possible !!