General :: LS Hangs On Searching For Filename In Directory

Oct 19, 2010

I have a directory that has a large number of files, around 1.5 million at this point. If I go to the directory and type in "ls filename" for a filename that I know exists, ls just hangs. I have let it run for over 20 minutes and it never does anything. Up until yesterday the directory was working fine through samba serving up files, but now it doesn't return anything. How to proceed from here?

View 7 Replies


ADVERTISEMENT

General :: Split A Directory Based On The Filename Prefix?

Mar 5, 2010

I have a very large directory with probably millions of small files in it. It's taking forever to run ls on the directory.

Is there an easy script that I can run to split the directory into smaller ones, based on the prefixes of the filenames. My goal is to wind up with something similar to what the Debian archives' pool directory looks like.

View 1 Replies View Related

General :: Script To Copy Some Files With Ftp After Searching In The Directory?

Apr 20, 2011

I was trying to develop a script which needs to check the count of files on hourly basis and if it find any addition it has to sftp and send a email on the status with filenames and number of files copied via sftp. I will put it on cron to run every hour.

I'll use ls /abc|wc -l to count the no. of lines for the first time and from then whenever a new file will be inserted it'll copy that file to another location or I'll take the date of the files and whichever is having a new date that will be copied to another location.

View 7 Replies View Related

General :: Recursive Searching Files In Directory Matching Given Name?

Apr 16, 2010

I am writing a shell script that finds all files named <myFile> in a directory <dir> or any of its subdirectories, recursively. I also need to take care of symbolic links that may form cycles, to avoid infinite loops. I am not supposed to use find command for the same

I started writing the code but got stuck. I thought using recursion may be a smart way, but its not working.

Code:
#!/bin/sh
findFiles()
{
thisDIR=$1
#cd $thisDIR
code....

View 5 Replies View Related

General :: Searching A Directory And Pulling Out Filenames With A Certain Pattern?

May 17, 2010

I would like to search a specific directory and pull out filenames that have this pattern: "_bsc_" Then I want to do some processing and move the file to another directory

View 5 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 :: Set A Pattern That Will Output A Filename Equal To The Original Filename In SoundConverter?

Jan 23, 2011

$ uname -a
Linux a 2.6.35.10-74.fc14.i686.PAE #1 SMP Thu Dec 23 16:10:47 UTC 2010 i686 i686 i386 GNU/Linux
$ lsb_release -a
LSB Version: :core-4.0-ia32:core-4.0-noarch

[Code].....

How can I set a pattern that will output a filename equal to the original filename? E.g.

something.mp3 → something.ogg

And why isn't this implemented in SoundConverter?

PS: {Filename} doesn't work.

View 1 Replies View Related

General :: Shell - What's The Difference Between Filename And ./filename

Apr 23, 2010

What is the difference between filename and ./filename? Under what circumstances is one preferred to the other?

View 5 Replies View Related

General :: Move All ".txt" Files, Adding Parent Directory To Filename?

Sep 13, 2009

I am trying to move all the txt files with a script from multiple directories to one directory, adding the parent directories of the files to the file names.It's a little complicated to explain, but i hope the script i have so far explains what im trying to do better:

Code:
for i in `ls /home/monty/scripting`
do

[code]...

View 9 Replies View Related

General :: Rename A Directory Filename With " " Character

Jun 7, 2011

in error the directory filename has " " character and i ca not open it, somebody can help me either to rename de directory or delete it, i tried to delete i and rename, but it is no possible

itcam /itm/media =>rm itmmedia
>
rm: itmmedia: A file or directory in the path name does not exist.
itcam /itm/media =>rm -i itmmedia
> s
rm: itmmedias: A file or directory in the path name does not exist.
itcam /itm/media =>

View 8 Replies View Related

Fedora :: Delete Directory With ??? Characters In Filename?

Jun 6, 2010

I have downloaded torrent from some chinese tracker. It has ???? and some other symbol charaters in directory name. How to delete that file and directory?

View 5 Replies View Related

Debian Programming :: Using Perl To Replace Filename Strings In A Directory

Jun 12, 2013

I have a directory of orchestral music .ogg files from a family member. Each track is from a different artist and the CDDB entry adds a ":" character after the artist name in the track title.

Here is an example of what I am referring to:

Code: Select all13_-_Mozart:_Sonata_in_A_major_KV_331.ogg

I would like to parse file names in any given directory and search for the string Code: Select all: and replace it with Code: Select all_ According to this post on stackoverflow, I can use Perl to accomplish this task. I've tried Code: Select allperl -i.bak -pe 's/:/_/' but since I am still learning Perl I'm probably commiting a PEBKAC error.

How would I go about solving this issue with regular expressions using Perl?

View 3 Replies View Related

Programming :: Shell Script Searching File In A Directory?

Feb 23, 2011

I am trying to search particular directory which has files with extensions like .html,.mp3,.xml etc I have a list of such files What I am doing in my script is

for file_name in `find /home/ -name index.html -o -name song.mp3 -o -name help.xml`;
do
if [ $file!='' ]
then

[code]....

I have around 100+ files name with some particular extension , this code works fine if the directory name does not have any special character in it like " "(white character) .

It is failing to give the output. IF I run the find command on the console the I am getting the correct file name with location

/home/user1/public_html/mediawiki/config/movie.mp3
/home/user1/public_html/mediawiki/movie.mp3
/home/user1/public_html/mediawiki/pop.mp3
/home/user2/public_html/index test/pop.mp3
/home/user2/public_html/index test/web.xml
/home/user2/public_html/song.mp3

If I echo the file name from the script Then output is little missed match when a directory name has special char like " "

/home/user1/public_html/mediawiki/config/movie.mp3
/home/user1/public_html/mediawiki/movie.mp3
/home/user1/public_html/mediawiki/pop.mp3

[code]....

I am not sure what is wrong with script or my code .. Does shell have un-controlled behavior of manipulating the output of any command.

View 14 Replies View Related

Ubuntu Security :: Disabling Filename Encryption On An Encrypted Home Directory?

Jan 3, 2010

Not using filename encryption when you create a new encrypted folder is easy, but how to disable it in the home encryption that is automatically set up by the Karmic installation CD?

View 1 Replies View Related

Server :: Split A Filename Into Its Filename And Extension?

Apr 6, 2010

I need to split a filename into its filename and extension, so I can append a datestamp to the filename. I'm using bash.

View 8 Replies View Related

CentOS 5 Hardware :: How To Compile Filename.c Into Filename.o

Nov 20, 2009

I've installed ethernet adapter, it is made in china from a manufacturer called FOX. The driver for that adapter is supported for sco linux kernel version 2.4.x and 2.5.x .However, I'm using Centos5 but the OS didn't recognize the adapter alone, so I'm trying to follo instructions on the driver on the attached CD.

The CD contains file named "SC92031.c", the instructions tell me to do the following "Compile the driver source files and it will generate sc92031.o"

View 8 Replies View Related

Software :: Difference Between <filename>.rpm And <filename>.src.rpm?

Nov 22, 2010

what is the difference between <filename>.rpm and <filename>.src.rpm?

View 2 Replies View Related

Programming :: Convert A Dynamic Library (filename.so) To A Static Library (filename.a)?

Nov 18, 2009

How can we convert a dynamic library (filename.so) to a static library (filename.a) using gnu gcc . Can we get a static library form a dynamic library . I saw a few post in which the conversion form a static library to a dynamic library is mentioned but, unfortunately, not the other way.

View 4 Replies View Related

Server :: MD RAID5 Hangs On Directory Creation

Mar 26, 2010

So here it is, I have a fileserver setup on Ubuntu Server 9.10 AMD64. In this system is 4 1.5TB SATAII drives. They are configured in RAID5 using MD. Now everything is working beautify, except when you need to create a directory. When you do, the system hangs for about 30 seconds. The I/O wait in top jumps up as well. Then the directory is created and everything works once again.

The odd part is it is only Directory creation that does this. I can copy, move, download and stream files off the server perfectly. I am baffeled as to what is causing it. It might be related to the fact that I expanded the array from 3 to 4 drives, it was after that, that I first noticed the problem.

View 2 Replies View Related

General :: Get Substring Of Filename?

Oct 28, 2010

i have filename like the following

1_40_37573.dbf
1_41_37573.dbf
1_42_37573.dbf

[Code]....

actually i want to extract the substring between 2 underscores
e.g. in case of 1_40_37573.dbf i need 40 and in case of 1_101_37373.dbf i need 101 and so on

View 8 Replies View Related

General :: Create A .tgz With The Filename?

Apr 21, 2011

I have some school work that involves creating a script that creates a backup of my /home folder, everything goes well but the problem is with the filename.

I am supposed to create a .tgz with the filename : hostname-day-date-HH:MM:ss.tgz

The .tgz gets created with the correct filename but when I try to unpack it the filename can't be resolved, it's the : that mess things up.

View 2 Replies View Related

General :: Can Source Filename Be Used In Makefile

May 7, 2010

in directory a_dir, have a file named a_file.i can type "source a_file" under directory a_dir and execute successfully.but if i write the command to a Makefile under directory b_dir, the "source" function can't be executed well. it will generate some error message like this:

./a_file: line 1: setenv: command not found
./a_file: line 2: setenv: command not found
./a_file: line 3: setenv: command not found
./a_file: line 5: setenv: command not found

View 3 Replies View Related

General :: Extract Last Number From Filename

May 27, 2010

I have to extract last number from filename.

ex- my file name is a10b8c1000

so i want to extract 1000 from it.

i tried using sed
sed 's/[a-z][0-9]*[a-z][0-9]*[a-z]//g' a10b8c1000

but sed looks for content inside file.

View 8 Replies View Related

General :: Remove A Part From A Filename?

Feb 25, 2011

I would like to remove a part from wiz_khalifa-black_&_yellow-(82_bpm).mp3
The part to be removed is -(*_bpm)

so that makes wiz_khalifa-black_&_yellow.mp3

Also a problem is that sometimes multiple "(" occur in a filename (wiz_khalifa-black_&_yellow-(remix)-(82_bpm)), so how can i only remove from the last "("

View 11 Replies View Related

General :: Replacing Part Of Filename?

Apr 25, 2010

I have just re transcoded a bunch of avi's. to tell the new ones from the old ones I put '[xvid]' at the end of all the new avi's. but now I have deleated the old avi's I want to remove the [xvid] part of the file name. This is what I have so far

Code:
#!/bin/bash
for name in *.avi
do
newname=`echo "$name" | tr -d [xvid]`

[Code]...

View 10 Replies View Related

General :: Rsync Directories By Path / Filename Only?

Aug 22, 2010

Is there a way for me to rsync two directories comparing only filenames (and not file size, date modified, or any other criteria)?

View 2 Replies View Related

General :: Basic Bash Filename Escaping ?

Nov 18, 2010

What I have done wrong with my escaping here:

Code:

The original filename is:

Code:

View 4 Replies View Related

General :: Delete All Files On A Server With A Particular Filename?

Mar 23, 2011

I run 5GBFree.com a free hosting site. As you can imagine, it gets quite a few people signing up to abuse the service.Recently I've found a LOT of people setting up sites with a particular script that floods forums and IRC chat rooms. The names of the files are as follows:

peindom1.php
peindom2.php
peindom3.php
peindom4.php

Is there a command I can run to remove files with these filenames ANYWHERE on the server (so basically, a command to go through all folders on the server and remove instances of that name

View 14 Replies View Related

General :: Make A Variable = Filename Without The Extension?

Apr 23, 2011

I am trying to strip the .wav file extension from a file name so that I can pass the result to lame encoder. I started to write a BASH script that looks like this:

Code:

for f in /home/user/wavfiles*; do FILE=basename $f .wav; lame $FILE; done

It doesn't work very well though. For the life of me I can't seem to discover how to use basename in a suitable way for a script like this.

View 8 Replies View Related

General :: Searching Mac Through Terminal?

Aug 18, 2010

are there any commands to search your Mac using terminal? I tried usin grep to search but it seems somewhat unresponsive and nothing comes up.

For example, I would type "grep Files" (A folder name) and it just prints a blank line and nothing happens.

View 4 Replies View Related







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