General :: Xargs And Unzip All Files To Specific Directory?

Jun 22, 2009

I'm trying to find all zip files timestamped from the past 7 days, then unzip them into a different director.I tried the following, but it only unzipped one of three files that meet the 7 day criteria. What am I missing?Code:find /home/user/public_html/zip_files/ -iname "*.zip" -mtime -7 -print0 | xargs -n10 unzip -LL -o -d /home/user/public_html/another_directory/

View 1 Replies


ADVERTISEMENT

General :: Unzip Zip Files To Local Directory?

May 5, 2010

How to unzip the zip files to local directory in linux?

View 5 Replies View Related

General :: Xargs CD Not Working (Echo Some Directory)

Mar 18, 2010

Please explain why
Code:
echo some_directory | xargs cd
is not working.
Code:
echo some_directory | xargs ls
is working as expected.

View 14 Replies View Related

General :: Unzip Only 1 Directory In .zip File?

May 6, 2010

trying to unzip only 1 directory in my .zip file, the reason is that i don't have enough space to unzip all the contents of .zip file. and i am trying to do it with unzip command.

View 4 Replies View Related

General :: Forbid Removal Of Files But Allow Creation Of Them For Specific Directory?

Jun 14, 2010

I have an application that creates temp files and quickly deletes them. But I'd like to keep those files, is there a way to do that in Linux?

View 2 Replies View Related

General :: Overwriting Specific Files In Directory Tree Recursively

Jul 19, 2011

I would like to overwrite files in a directory tree, recursively. The ones I would like to overwrite match the filename "x_alpha*.png" and have a size exactly 456 bytes. Is there any way to search for these recursively in a directory tree, and overwrite them with a reference file, for example "e:mydirgood.png"

I am using Windows 7, but I have UnxUtils, so I can use those too. What I am looking for is something like this, generated automatically:
copy /y e:mydirgood.png e:mydiracx_alpha0023.png
copy /y e:mydirgood.png e:mydirefgx_alpha0045.png
copy /y e:mydirgood.png e:mydirhx_alpha0248.png

View 2 Replies View Related

General :: Find Files With Specific Extension And Move To A Directory?

Apr 18, 2011

I need little help. I want to find all files with extension "*.tar" "*.gz" and "*.zip" and move all those files into "/opt/old" directory. I've tried this command:

Quote:

find . -type f -name "*.tar" "*.gz" "*.zip" -print0 | xargs -0 -r mv /opt/test

It's not working, something wrong after "mv" i guess.

View 10 Replies View Related

General :: Searching A Specific Directory For Files Containing A Text String?

Nov 20, 2010

I am a member of a group which has written a program whose source code is being held in a specific directory (~cs252/Assignments/basicAsst/project) and we want to go through and change the parameters for the function "sequentialInsert." My job is to find all occurances of the function call to "sequentialInsert" and to also list the files from where the code came from. Also, I have to be in the commandsAsst directory when I do this. I have tried grep and find combined together, and I am at a lost.

View 1 Replies View Related

General :: Unzip To Same Directory As Zipped File?

May 6, 2011

So I have a script that simply unzips a file with a line:

unzip /path/to/file.zip

which unzips and puts the unzipped directory in the same directory as my script. The issue is, I want the unzipped directory to be in the same directory as the original zipped file.

I googled and found the -d flag which would let me specify what directory to put it in but the script asks the user to define the directory so I don't see how I could use that (because the user specifies the path all the way to the zipped file, not just the directory where the zipped file is)

View 2 Replies View Related

General :: Making Specific Script Loop Over Multiple Files In Directory?

May 10, 2011

I am trying - to no avail - to take an old script I found in the forum help-needed-in-grep-for-tar-gz-658730/ The code:

Code:
#!/bin/bash
if zgrep $1 $2 > /dev/null 2>&1

[code]....

View 3 Replies View Related

General :: Copy Files Using Xargs From A Folder To Another?

Jun 10, 2009

I'm trying to copy a list of files except the files which has ".log" in the filename to another folder.I can run it correctly when I am located in the Source folder, but not when I am in any other location.cd /home/me/Sourcels /home/me/Source -1|grep -v "^.*log$" |xargs -n 1 -iHERE cp -r HERE /home/me/DestinationHow can I indicate both Source and Destination Folder?

View 2 Replies View Related

General :: How To Unzip Files On Acer One Running System Lite

Jun 26, 2010

I have downloaded an update of mozilla firefox but don't know how to unzip it. Do I download it to disc(hard drive) or do I download to xarchiver? Then how do I unzip it.Do I have to unzip all files the same way?

View 7 Replies View Related

General :: Copy Zipped (my.zip) Files From Windows To Systems And Unzip Them Without Any Corruption

Jun 11, 2010

Is it possible to copy zipped (my.zip) files from Windows systems to Linux systems and unzip them without any corruption.

I know the command unzip is available, but I want to know if this copying from WIndows to Linux could lead to file corruption.

View 7 Replies View Related

Ubuntu :: Write A Bash Script Which Will Find Files Then Move Them To A Specific Directory?

Sep 1, 2011

I'm trying to write a bash script which will find files then move them to a specific directory.

So far I have:

Code:
#!/bin/bash
#script to find and move files
src_dir="/path/to/source/directory"
des_dir_mov="/path/to/destination/directory/for/movies"
des_dir_img="/path/to/destination/directory/for/images"
find $src_dir -iname '*.avi' -type f -exec mv '{}' $des_dir_mov ';'

I'd like to have all the possible movie file types then the image file types checked in a loop.

Every time I try to include an array in this script it breaks

View 3 Replies View Related

Ubuntu :: Unzip Command, Finish Before All Unzip Is Done?

Jul 11, 2010

Problem is what unzip command, finish before all unzip is done.

Code:
#!/bin/dash
cd /home/ftpuser/www_base/

[code]....

View 3 Replies View Related

OpenSUSE Network :: Setup An Apache Server On Computer Which Will Allow Browsing Of Files In A Specific Directory And Subdirectories?

Jun 13, 2011

I'm trying to setup an Apache server on my computer which will allow browsing of files in a specific directory and subdirectories, without needing any sort of authentication.

I've got the Apache2 server up and running through yast, and everything works fine as long as I try to point it to the /www/htdocs folder. However, I want to point it at another folder, which is on another partition. This partition is formatted as NTFS, if that matters at all (here's some background on some permissions issues I had with the NTFS partitions recently).

When I change the "Directory" setting in the Yast http server configuration utility to the directory on the NTFS partition I wish to use, attempting to access the server results in the following error:

Code: Access Forbidden: You don't have permission to access the requested directory. There is either no index document or the directory is read-protected. If you think this is a server error, please contact the webmaster.

Error 403
192.168.1.100
Mon Jun 13 23:43:29 2011
Apache/2.2.17 (Linux/SUSE)

View 4 Replies View Related

CentOS 5 :: Ability To Unzip Files Using PHP?

Apr 13, 2010

Using PHP 5.2.10 on CentOS 5.4. I need to run a PHP call that will extract all the files from a .zip file. Is there a function to do this or something in PHP I need to enable or install?

View 1 Replies View Related

Server :: Find And Unzip Selected Sub Folders In Tar.gz Files?

Nov 4, 2010

There are few hundred tar.gz files each having several sub dirs in them (ex: ftp_server1_logs, mail_server2_logs). However the main tar.gz files (ex: 20101001.tar.gz) does not contain all sub dirs every time (ex: 20101001.tar.gz may only contain some ftp server log dirs etc..)

what i have to do is find the tar.gz files that contain a specific type of log type (ex: ftp logs) and extract all logs to a single folder (ex: ftp logs)

View 1 Replies View Related

General :: Use Awk To Isolate A Specific Directory Level

Jul 15, 2011

I have used Awk in the past to isolate the file name from a given path..that is to say, I may have a list of files contained in list.txt.Can someone please post the Awk command that would do this? (I assume it will be very similar in form to the Awk command I showed above.)The point is, sometimes I may want to isolate the second directory, sometimes I may want to isolate the third directory or tenth or whatever - so I am hoping that if someone posts the Awk command to isolate the second level directory (to produce the output I showed in Fig.3) it should be fairly obvious by looking at the form of this command how to alter it and so isolate any other directory I want.

View 5 Replies View Related

General :: Copy Directory Into Another Preserving Specific Structure?

Jul 20, 2011

I would like to find the command that copy my eclipse options to another workspace code...

It doesn't work, and it could be source of error to write the path .metadata/.plugins manually. It certainly a better idea to create a complete script ?

View 1 Replies View Related

General :: Add User With Specific Home Directory That Already Exists

Apr 9, 2010

Im trying to add users to my nfs server with a specific home directory that already exists. Can this be done? I've done some research on google and other forums but cant seem to find the answer.

View 7 Replies View Related

General :: Search For A Specific File In The Sysconfig Directory?

Mar 10, 2010

If i am in the root directory and i need to search for a specific file in the sysconfig directory, is there any way to search this directory for a file?

View 10 Replies View Related

General :: Copy All .jpg Images In Subdirectories To A Specific Directory?

Aug 5, 2010

I have .jpg files in many subdirectories from where I need to copy all the images from all the sub directories and paste them to a specific directory.I have used `cp -rf *.jpg media/sik/` which only copies the .jpg files of the directory in which I was working.

View 5 Replies View Related

Ubuntu Servers :: Does Unzip/untar Always Append Files To Existing Folders

Mar 4, 2011

Will unzipping always append files if the directories already exist? What about tar?

I unzipped an archive the archive had 3 folders and dozens of subfolders within those. app, skin, js

The folder I unzipped it to also already had those 3 folders as well as many child folders etc.

My website is still working so I'm just wondering. Is this safe or is there anything I should worry about. The other option was to manually upload each file manually that is in those 3 folders and the dozens of sub folders.

View 1 Replies View Related

General :: Difference Between Using "jar Xvf" And "unzip" To Unzip The Zip-file?

Aug 27, 2009

difference between using "jar xvf" and "unzip" to unzip the zip-file?

View 4 Replies View Related

General :: Give Directory Permission To A Group And Not Specific User?

May 26, 2010

I'm trying to do something like thisi created a group called www and made this group the owner of the directory/var/www/htmlso i can read and write to it.of course I've add my self to this group, but it seems i can't read and write.the syntax i used was something like chown :www /var/www/html.didn't workonly when i used chown samurai:www /var/www/html i could finally could create new file.the reason i don't want to specify the user name is because I'm thinking of a scenario when i need to give permission to a large group of ppl and don't want to do it user by user.

View 5 Replies View Related

Programming :: Search A Bunch Of Files In A Specific Folder For A Specific Number?

Jul 24, 2010

I need to search a bunch of files in a specific folder for a specific number and add all the numbers together to a total sum. I use Rsync everyday, everytime I run rsync i get a logfile (rsync output) witch contains the textstring "Total bytes sent: xxxxxx".

The "xxxxx" can vary in lenght. I need to extract the "xxxxxx" from each file and add the numbers together to a total size over a week or a month. Is this possible? And I wish to only use bash. One way of doing stuff at a time my friends .

View 5 Replies View Related

General :: Mount A Specific Directory On Server To A Local Windows Machine?

Jan 20, 2011

I have a directory on my server at /home/dave/www/images/site (ext3) which I want to mount directly to my Windows computer so that I can transfer data easily via command line tool. Is that something possible?

View 4 Replies View Related

General :: Use Symlink To Provide Access To A Specific File Under A Restricted Directory

Jan 24, 2011

My home directory's permissions allow only myself access to it. Is it possible to put a file inside my home directory with.. say.. full permissions, and create a symlink to it so other users can access that file alone inside my home folder? System is Ubuntu Karmic.

View 2 Replies View Related

General :: Expanding Globs In Xargs?

Jun 29, 2011

I have a directory like this:
mkdir test
cd test
touch file{0,1}.txt otherfile{0,1}.txt stuff{0,1}.txt

I want to run some command such as ls on certain types of files in the directory and have the * (glob) expand to all possibilities for the filename.

echo 'file otherfile' | tr ' ' '
' | xargs -I % ls %*.txt

This command does not expand the glob and tries to look for the literal 'file*.txt'

How do I write a similar command that expands the globs? (I want to use xargs so the command can be run in parallel)

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved