Programming :: Moving Files Up A Directory Layer?
Jan 3, 2011
find . -type f -name "*" -print0 | xargs -0 --replace=% mv % `pwd`
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?
View 8 Replies
ADVERTISEMENT
Jun 7, 2010
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.
View 2 Replies
View Related
Jul 14, 2011
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.
View 5 Replies
View Related
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?
View 1 Replies
View Related
Mar 4, 2010
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.
View 3 Replies
View Related
Nov 14, 2010
There are millions of files in many directories. Wherenver i try rm * or find or use xargs, they say 'argument list too long' and exit. How can i deleted files in a directory with so many files without deleting the directory itself.
View 3 Replies
View Related
Jul 6, 2010
I have a single directory of pairs of files, with the pairs sharing a string as the beginning of the filename:
SF1-27F1492R-clone01_T3_A18_001.ab1
SF1-27F1492R-clone01_T7_A20_002.ab1
SF1-27F1492R-clone02_T3_A19_003.ab1
SF1-27F1492R-clone02_T7_A21_004.ab1
...etc
I need to create a subdirectory for each pair then move the pair into the subdirectory.
I accomplished the first step using:
$find /foo -name '*T3*' -exec mkdir '{}.wrk' ;
I can use a regex to designate the pair and associate the directory, but how do I use regex in a path as the output of a move command?
View 7 Replies
View Related
Jan 3, 2009
After i try to find logfiles follow date/month/year. i want copy this files to another directory with name's directory is time you find(date/month/year).
View 4 Replies
View Related
Jan 29, 2010
I have no Bash skills but Im badly in need of a script to move the first 20,000 or whatever number of files from a directory containing over 200,000 files to a new directory. The problem is that I cant access the directory because its so large so I want to break it into chunks, but keep the files in order if possible. If you know of a script to meet my needs, please post it. Otherwise Ill post my fumblings with Bash until I find the right way to fix my problem.
View 14 Replies
View Related
Jan 13, 2010
im trying to send pages of 4096 bytes from kernel layer of server to kernel layer of client over a network. previously i tried the foll. code , for data less than a 100 bytes it worked fine , but for something larger than that the computer hangs......(even the dmesg's wont say why) i also wanted to know how we could use the 'sendpage' function to solve this problem.
Code:
CLIENT'S KERNEL MODULE
struct iovec iov;
char buf[1024];
[code].....
View 1 Replies
View Related
Aug 8, 2010
K3B says that my drive supports DVD-R DL writing. K3B shows it only having 1 layer.dvd+rw-mediainfo shows
Code:
INQUIRY: [ATAPI ][DVD A DH16A6S ][YA16]
GET [CURRENT] CONFIGURATION:
[code]...
View 8 Replies
View Related
Dec 30, 2008
I want to implement a cross layer approach. I want to pass the network information such as delay from the MAC layer to Network layer. Can you tell me the way I am new to this. I am using linux (fedora). I think some system call will do the trick. Correct me if I am wrong. (I want to implement QoS matrices)
View 1 Replies
View Related
Jun 10, 2011
I get a SD card. Put in the SD reader. It's empty. I go to my super-important-pictures-to-a-monthly-relatory folder and select all files. Select them for MOVE. Paste them on the SD card. When the move/paste process is finished, i click on the "Eject" button on top of the SD card name. Card's ejected. I can't access the card anymore. I take out the card and put on my other computer. From 300 pictures, there are only 10 available, the remaining ones are there, but with 0bytes and unrecoveable. I panic. I go back to my main computer, my pictures are not there anymore. The pictures were on the Home folder. I panic again. I reset the computer and boot on the LiveCD. I install foremost, scalpel, photorec and about everything till my USB drive complains about being filled up. I run everything and I can't recover my files. I'm in the danger of getting fired. Things like that makes Windows sounds more appealing. When you securely remove a pendrive, things get REALLY pasted there before screwing everything up with a removal.
View 8 Replies
View Related
Apr 8, 2010
I was preparing a script which will remove all my files from directory which are 24 hour old.I tried some thing like thisfind . ( -name 'log.*' -mtime +1 ) -exec rm {}; but it is throughing error like : missing argument to exec.
View 8 Replies
View Related
Mar 26, 2010
I am trying to get the total file size for certain files per directory.I am usingfind `pwd` /DirectoryPath -name '*.dta' -exec ls -l {} ; | awk '{ print $NF ": " $5 }' > /users/cergun/My Documents/dtafiles.txtbut this lists all the files in the directoriesI need the total per directory for all dta files.
View 1 Replies
View Related
Apr 7, 2011
Word Count for all files in a directory
View 1 Replies
View Related
Jul 7, 2010
I wanted formated output of all the files under a particular directory. I am trying to use find.Something like find -P ./ -type f -name '*.cpp' -printf "%p "I want all the files with specific extension like .c .cpp .h to be printed out separated by space. One more thing i want is absolute path names instead of relative.
View 5 Replies
View Related
Nov 19, 2008
How can I write a script that will go through the files in a directory and print on the screen the name of the files stating if it is a file or directory. The directory is already provided by the user.
View 12 Replies
View Related
Feb 14, 2011
When I run:make -f mymakefile clean I get:rm -f mybinary *.so.* *.dep *.o mybinary.symand all the above files are removed from the current directory.But I have a directory /src/ where I have all my source files located. The *.o file in this directory are not removed?
View 4 Replies
View Related
Nov 6, 2010
I am trying to write a simple script to list all the files in a directory. The script I wrote was as below where the pdb_files is a directory and all the files which I want to list are in that folder.
Code:
files=`ls -F pdb_files/*THERMO*`
for inFiles in $files
do
echo $inFiles
[Code]....
View 5 Replies
View Related
Jun 23, 2010
I once had a script that when run would find the first 800GB of files in a directory (including subdirectories) and write them to a file (ie: ./800gb.sh > manifest.txt).I used this to create manifests of 800GB worth of data from large directories in order to dump to tape (LTO4).I'm sure its gotta be a pretty simple script, but I am not very skilled at writing bash scripts.
View 4 Replies
View Related
Aug 20, 2010
I got a directory with files in it like: 2006-07-01.foo2007-08-04.foo I need to update the timestamps on these files using "touch -t 200607010000 2006-07-01.foo" on each file in the directory so I came up with the following one liner:
for i in `ls -1`; do touch -t `ls -1 | sed -n 's%([0-9]{4})-([0-9]{2})-([0-9]{2})(.*)%1230000%p'` $i; done
My goal was to use sed and get the timestamp for touch and then loop through each file and touch with the timestamp.However the script, not giving me the results I intended. Can anyone chime in on what I am doing wrong?I have been banging away at this for a couple of hours now and am clueless on what it could be. I also tried another variant such as:
for z in $(ls -1 *.foo); do echo $z $(for i in `ls -1 *.foo | sed 's%([0-9]{4})-([0-9]{2})-([0-9]{2})(.*)%1230000%p'`; do echo "$i"; done); done
View 5 Replies
View Related
Jul 22, 2011
I have about 50 files that the script will operate on, they are all located in the same directory.I need a bash script that will operate on all files in a directory. The script needs to add two lines to the beginning of each file based on the file name, and one line to the end of the file.A file named myfile.h should add these two lines to beginning of the file:
Code:
#ifndef MYFILE_H
#define MYFILE_H
[code]....
View 5 Replies
View Related
Jan 31, 2009
i was wondering if there's a bash script to check the amount of files in a directory with an IF statement..
View 8 Replies
View Related
Feb 15, 2010
How to list only hidden files in current directory ?
View 2 Replies
View Related
Aug 19, 2010
I have a bunch of files that contain a date, then data. When I use join, I get exactly the output I need. But manually joining the first with the second, then that output with the third and so on would take days. I have thousands of files. Can any of you folks help me write a script that would do this?To put it another way, for clarity's sake, here is what I am currently doing
If I were to repeat that 3000 times the final output would be what I need. I know a simple script would do this for me, but I can't figure out how to write it.
View 12 Replies
View Related
Oct 1, 2010
Code:
<html>
<head>
</head>
<body>
[Code]....
Alright this works fine to pull the directories/files in the /var/Store/2010/ directory.
But when you click on of the links it tries to http://'serveradress'/$filename
note that $filename in the url is the filename clicked on so the php script is working. but I need it to change to that dir so that you can see the folder/files there and work your way up/down/side wise thru the folder tree to where you need to go. Not try and pop it as a direct url which doesn't work.
View 3 Replies
View Related
Nov 25, 2010
I have managed to get it to install the files in the BUILDROOT directory correctly but when I add the directories under the file it seems to try and install the files from root. my rpmmacros is as follows:
Code:
%_topdir /home/rpmbuild
# The directory where buildroots will be created.
%_buildrootdir %{_topdir}/BUILDROOT
[code]...
View 1 Replies
View Related
May 16, 2011
I have to create a script to identify those users who have un-sanctioned (forbidden) files in their home directory. I tried something like this (this is a try and I need some opinions):
Code: #!/bin/bash
user_belongs() {
if `groups $var1 | grep $var2`
then
return 0 else
return 1
fi
} .....
View 1 Replies
View Related
Dec 29, 2010
Originally Posted by Kenny_StrawnPlease wrap [CODE] tags aroung any code posted here. The full source that way could still be posted.I am trying to copy all the files in the directory based on the modification date (i.e created on Dec 29). Not able to find the proper command for this. This is what I have tried.
(none) login: root
#
# cd /mnt/hd/
[code]...
View 8 Replies
View Related