General :: Given A File Path Search For File Exist?

Jan 27, 2011

I have file which consists of many files with their path,i need to check for the file exists in the given path,how to check?

View 12 Replies


ADVERTISEMENT

General :: Move A File To Some Path And Create That Path When It Doesn't Exist?

Oct 8, 2010

I use this command:

Code:

find ./ -atime +360

to figure out the files that haven't been accessed since 360 days. The command above will return results like this:

Code:

/uploads/2010/02/some-file-name.ext
/uploads/2009/08/another-file-name.ext
... etc

I'm taking here about tins of directories, thousands of files. I'm looking to find a command that makes me able to move the results above to another path, and to create that path once it doesn't exist like below:

Code:

mv /uploads/2010/02/some-file-name.ext /old-files/uploads/2010/02/some-file-name.ext

But I want the executed command to create this path

Code:

/old-files/uploads/2010/02/

If it doesn't exist.

View 6 Replies View Related

CentOS 5 :: Search A Text File For The Existence Of Certain Strings And Execute A Command If They Exist, Something Along The Lines?

Feb 23, 2010

This should be simple but I can't seem to find what I am looking for.I want to search a text file for the existence of certain strings and execute a command if they exist, something along the lines of:

if <string> exists
command
or

if <any member of this list exists>
command

I know how to manually search a file with grep, cat, etc., but the "if this exists" part eludes me.

View 7 Replies View Related

General :: Copy File Whose Source Path Is Mentioned In File To Specified Destination

Jun 3, 2010

I had a situation in which the the path of the file to be copied is written in other file and I had to copy it using shell script..I can use cp $(cat /home/robert/location.txt) /media/sda1 on normal linux shell...But I am using buildroot script where $(cat /home/robert/location.txt) evaluate to nothing..is just blank..

View 1 Replies View Related

Ubuntu :: Multiple File Search \ Search A File For A Certain Keyword?

Nov 13, 2010

for example we search a file for a certain keyword..is there any application available which will enable us to search for a single keyword in all the files within the folder ?i want to search for a keyword in about 1000 files..if i do it manually it will take loads of time..

View 6 Replies View Related

General :: Executable File Contains The Precise Path To SO File?

Aug 13, 2010

Does executable file contains the precise path to SO file? Should it be compiled with precise knowing of SO file location?

View 8 Replies View Related

Ubuntu :: Logon Script - Create A File (if It Doesn't Already Exist) And Checks The File For Some Info

May 24, 2010

I want to create a logon script (or somesuch) that creates a file (if it doesn't already exist) and checks the file for some info otherwise. If it finds a given trigger in that file, it logs into a local database and does some operations.

Now my problem isn't with creating that file or even getting it to function as a logon script -- it's with permissions. After the logon script creates the file, I want that user to have read access on it ONLY. Further, I don't want to give the user any kind of root access so that they could do the database operations in question or chown/chmod the file.

What's the best practice here? I'm noticing that whenever the script runs (in .bashrc right now) the script runs with the current user's permissions. Ideally, I'd like to make it so the login script can run at a higher level of permissions, (higher than the user has). Is this even possible? What's the best way to do this?

View 1 Replies View Related

General :: Error - Client IP - File Does Not Exist

Apr 24, 2010

when I reviewed the error_log I found that it is logging thousands of errors which are similar. I've included a sample of the errors. The following error seems to happen constantly, from many different ip's...

Code:

[Thu Apr 22 01:02:06 2010] [error] [client (the ip address removed)]
File does not exist: /home/virtual/site4/fst/var/www/html/colombia-news,

View 2 Replies View Related

General :: Bind Configuration File Not Exist

Oct 31, 2010

I had installed BIND packages but /etc/named.conf file is missing as the packages are shown,

[root@nisserver ~]# yum list bind*
Loaded plugins: rhnplugin, security
This system is not registered with RHN.

[code]...

View 3 Replies View Related

General :: Wine File Or Folder Does Not Exist

Nov 19, 2010

I want to install kindle in kubuntu. I seem to have successfully installed wine and and added ms explorer.exe. but when I click on Browse C drive...
Unable to run the command specified. The file or folder file:////Documents/.wine/dosdevices/c: does not exist.

View 1 Replies View Related

Ubuntu Networking :: File 'path Omyfile' Has Been Changed On The File System?

May 28, 2010

I have asked this over on Launchpad and have found bugs filed on the eclipse bug tracker but it seems to be going nowhere so I guess ill ask here.

I am using Eclipse for some development work and having saved a file, defocus the eclipse window (to test changes in a browser) when I refocus the eclipse window I get the following error...

The file 'path omyfile' has been changed on the file system.Do you want to replace the editor contents with these changes?

I have searched and searched and this seems to be a CIFS/SAMBA problem. I even found one solution suggesting that changing his mounts from cifs to smbfs fixed his problem however that would appear not to be an option for me since using smbfs in the fstab causes cifs mounts. This problem would seem to occur in Bluefish as well as some other IDE's so it is not an Eclipse issue.

---------- LINKS TO RELATED ----------
Launchpad Question
Eclipse Bug
--------------------------------------

View 2 Replies View Related

Slackware :: Default PATH - Python: Can't Open File 'SABnzbd.py': [Errno 2] No Such File Or Directory

Nov 24, 2010

I have just installed SABnzb application in my home folder. The executable file is SABnzb.py When I run the command in the Konsole # python SABnzb.py I have this Quote: python: can't open file 'SABnzbd.py': [Errno 2] No such file or directory

View 5 Replies View Related

General :: Run Command Through Ssh But Also Run A If Check In Bash To See Ifa File Exist?

Aug 1, 2011

So I want to run command through ssh but also run a if check in bash to see ifa file exist. I know that to run ssh commands you do ssh user@server YOURCOMMANDbut if i need to run an if statements, how would this work??

View 4 Replies View Related

Ubuntu :: Find File Name And File Path From A String?

Feb 28, 2010

How to find filename and file path from a string

View 7 Replies View Related

Ubuntu :: "Can't Load Image From File '/usr/share/firefox/icons/mozicon128.png': File Does Not Exist."

Apr 12, 2010

Tried running simdock from software center...uninstalled because I was getting this error after trying to run ap "Can't load image from file '/usr/share/firefox/icons/mozicon128.png': file does not exist."

View 3 Replies View Related

General :: How To Search File At Server

Jul 16, 2010

1. i want to make backup database(use mysqldump)

2. copy from server(use linux-server) to client PC (use linux- ubuntu 9.0)..

3. before that i want to search that DB file using terminal..

4. bcoz i dont know where the files are located

View 2 Replies View Related

General :: Search For An Element In File

Jul 27, 2009

I have a doubt, i have a file which contains around 3000 elements, now i want to search for an element in that file.what will be the Efficient way of searching ? without consuming much memory and time..

1) is this efficient if i take all the 3000 elements from file to a list or array and sort them and search ?
2) or is it efficient to search directly inside the file ??
Can anyone please suggest some algorithms for an efficient way to search in this case ?I am using C for coding..

View 14 Replies View Related

General :: Command Line - Create Directories That Don't Exist While Creating A New File?

May 8, 2010

I can do:mkdir messages and then: touch messages/hello.txt Is there a command that will do both - create the directory if it doesn't exist, and then the empty file? Something like: touch -p messages/hello.txt

View 1 Replies View Related

General :: Executable File Apparently Doesn't Exist When Trying To Execute With Bash

May 9, 2011

I downloaded a program called tonespace http://www.mucoder.net/en/tonespace/ which I extracted and then tried to execute the executable file with ./tonespace. This gives me the following message:

bash: ./tonespace: No such file or directory

When I use the command: file ./tonespace I get this: tonespace: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

I dont get it. The file is clearly there, yet when trying to execute it bash doesn't seem to recognize it.

It has permissions rwxr-xr-x and is not owned by root. Am I overlooking something?

View 2 Replies View Related

General :: Checking Path To File ?

Nov 14, 2010

I am trying to load a driver (xxx.ko) and uncertain if the path given is correct.

I do not have any direct access to my linux device, so I need a small script that will create a text file telling me if the file was found or not.

View 6 Replies View Related

General :: Search For A String In A Php File Using `grep`?

Jan 19, 2010

I am searching for Class declaration on a site with hundreds of PHP files, how can I do this in the current folder and subfolders using GREP?

I tested cding to the folder and then something like

grep -r 'class MyClass' *.php

View 5 Replies View Related

General :: Bash Script Search File

Dec 19, 2010

total newb here. call me a script kiddie if you want but here is what i need to do and what i have.

need to:search a hidden log file for a specific string, find what comes after that part, and then output the result to a variable or something that can be used by an application or other script to carry out further actions.

View 3 Replies View Related

General :: How To Search Logs Between Two Timestamps In Log File?

Nov 19, 2009

The requirement was to write a shell script for a cron job set for every two hours for all days.The Script has to scan log files (*.log) for the logs posted only for the last two hours.... and append them in a new file...I am clueless abt how to scan/compare based on time stamp seen in above logs.

View 2 Replies View Related

General :: Locate Cmd Couldn't Search File

Jul 7, 2010

I used locate cmd to search file abc.txt (for example) as I didn't know in which directory it would be present and couldn't find it. But when I did find . -name abc.txt, it traced the file, luckily the file was in the same directory. I am wondering how find was able to search abc.txt and locate not. How these two are behavinb differently? Usually I use locate when I don't know the path to the parent dir.

View 8 Replies View Related

General :: Search Within A Log File Within A Time Range

Jun 24, 2011

I want to search in my apache log, for events which have occurred say between 11:00 AM to 2:00 PM. I have got few scripts/commands but they are not conclusive, some of then are trying to do an exact match(awk) and for some i am just getting the pattern wrong (eGrep)

I am running RHEL.

Apache log eg:
================================================================
10.92.120.129 - - [24/Jun/2011:01:29:07 -0500] "GET /favicon.ico HTTP/1.1" 302
================================================================

now if i want to find out the logs from 1 PM to 2 PM

some example i had was:

cat <apache.log> | grep -E '07/Apr/20110[1-2]:[0-5][0-9]|02:00)'

small script in which i can pass the start time and end time range, and it should give an output of the rows which fall under that time range.

View 5 Replies View Related

General :: Cant Run Downloads - No Ar File Path Found

Oct 13, 2010

i can download but i cant run anything because there is no ar file path for ark. please dont tell me to download something to get the ar file path because if i download it i can't open it

View 1 Replies View Related

General :: Can Open A File Without Path Via Terminal

Mar 5, 2011

Usually in Gnome, under Ubuntu, the terminal command I use is:

Code:

gnome-open (path)

In most cases, I won't know the path and I'd rather not search for it with:

Code:

locate (file name)

View 1 Replies View Related

General :: File And Path Names Of Configurations?

Jul 21, 2011

what is the file and path name of the configuration file to which you would add to the AllowUsers charlie linus lucy?

View 3 Replies View Related

General :: File Permissions In Every Element Of Path Or Just Last One?

Dec 17, 2010

Kernel 2.6.21.5, slackware 12.0 For a given app run by me as user john to be able to create a file in /foo1/foo2/, what do I need? (a) john to have write permissions in /foo1/? (b) john to have write permissions in /foo1/foo2/? (c) john to have write permissions in both /foo1/ and /foo1/foo2/? Any hint will be welcome. Note: No. It's not homework. KTorrent complains when trying to create the files being downloaded, saying 'permission denied'. But I think he is being run by another user. I can explain in a different thread.

View 3 Replies View Related

General :: Get Path Of Sourced Bashrc File?

Feb 11, 2011

I want to assign the path of a sourced sub.bashrc file to an environment variable. E.g. if I type (or execute) from a known relative location

$ source ../../someDir/sub.bashrc

the sub.bashrc should set a variable like

export MyOwnLocation=/home/user1/unknownlocation/someDir

The problem is I can't use $0 as reference because the script is only sourced not executed. I also don't want to hardcode the path because the location might change and there will be more copies. Is there an easy way to create this information from within the the sourced bashrc file? I use Gnu bash 2.05b on Suse Linux 9.

View 6 Replies View Related







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