General :: How To Know If The Command Find Any Result
Oct 21, 2010
#!/bin/shLOOK_FOR="NTLMAuthenticationFilter"for i in `find ./ -name "*jar"`doecho "Looking in $i ..."grepjar -e $LOOK_FOR $idoneI wrote the script above, and try to find if there any file name LOOK_FOR exist in those jar,my quest is: grepjar -e $LOOK_FOR $ihere how can I check if there are any successful result , and output them ?
View 2 Replies
ADVERTISEMENT
Nov 10, 2010
Every time I need to find a file and then open it, I have to use :
find ./ -name **.properties. , then copy the result, and then vi "paste the result here" .
If I need to use a mouse, it can be a little trouble. So is there any better way to do this?
View 6 Replies
View Related
Apr 19, 2011
I want to store the result of wc -l as a variable so I can use it later in my script...so far unsuccessfully.
I have tried this:
set `echo awk '{ print $1, $6}' | wc -l` | echo $1
but it is far from working.
View 11 Replies
View Related
Jul 1, 2011
I am frustrated by running a script on the Fedora 14 computer as a cron job. I paste the code:
Code:
#!/bin/bash
#a backup script to copy data from sda to sdc
ROOTVOL=`blkid -U ea210a08-6212-4dc8-be1c-23fce3b965bc`
[code]....
So when I run this as root, for example:
Code:
# /root/myscript
the result is what I expect:
Code:
Jul 1 13:41:16 svn root: ADMIN: Executing backup-svn
Jul 1 13:41:16 svn root: using blkid ea210a08-6212-4dc8-be1c-23fce3b965bc as /dev/mapper/vg_svn_backup-lv_root
[code]....
View 3 Replies
View Related
Aug 8, 2011
I am working at a client who has a project where code is a mixture of different source control systems. So a layout might be like this
project/a/.svn
/a/subfolder/.svn
/b/.hg
/c/subproject/.svn
/d/.hg
So I am trying to put together a simple command that when executed from the project folder will run the appropriate hg/svn command in each project i.e:
[Code]...
Since the client has many such projects, Instead I am looking for a solution similar to find -exec where the svn/hg commands are automatically executed on each first level of match (i.e. svn up is run in the project/a folder but not in project/a/subfolder). How can such a command be constructed ?.
View 1 Replies
View Related
Mar 31, 2011
I have the following commande /sbin/fuser -f -u /u/DT01/F010107 1>/tmp/null 2>/tmp/seausr.T0069 when executing as root 'su' this give me all user using the file. but when tried with 'sudo' i am asked with 'user password'. Is ther anyway to simply get the result without having to supply a password and to see all user not only me. (i have the file open also).
View 1 Replies
View Related
May 30, 2011
I came across this reult of the type command (hashed) in another post. (see below).
Code:
fraespappp8:/data/apps > type topic_file_publish.sh
topic_file_publish.sh is hashed (/data/apps/pnbgstk/publication/topic_file_publish.sh)
This (result = hashed) is new to me.
I wonder which kernel/distro/shell it is from.
View 1 Replies
View Related
May 4, 2010
I'm trying to create a program that would locate the oldest file of a certain type on a server. Here's the commands:
OLDEST_PATH=`find -L / -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1`
OLDEST_FILE=`find -L $OLDEST_PATH | grep .mp3 | sort -f | head -1`
ls -al $OLDEST_FILE
I'm writing this all in expect but I'm having problems. The main problem I have is whenever I try to run the first command, I can't seem to isolate the result of the OLDEST_PATH so that the 2nd command will work. There always seems to be a newline in the variable and the result is only "find -L" command running and it bypasses the variable. If I can just figure out how to get the 1st and 2nd command to work, then I can figure out the 3rd. Here's some code:
Code:
send "find -L / -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1
"
sleep 20
expect -re "(.*)
[Code]....
I know there is a better way to write this. I've tried multiple ways and this just happens to be the last way I've tried it. If you try running this, you'll notice that there is still carriage returns after the result of OLDEST_PATH and it prevents the 2nd "find" command from working properly.
View 2 Replies
View Related
Sep 7, 2010
I have 4 Linux machines with cluster.My target is to find all kind of IP address (xxx.xxx.xxx.xxx) in every file in the linux system remark: need to scan each file in the linux system and verify if the file include IP address if yes need to print the IP as the following
more /etc/inet/file.example1
182.23.2.4
255.255.0.0
10.10.1.1
View 1 Replies
View Related
Sep 11, 2009
I am trying to do a find/grep/wc command to find matching files, print the filename and then the word count of a specific pattern per file. Here is my best (non-working) attempt so far:
wc `find . ( -name "*.as" -o -name "*.mxml" ) -exec grep -H HeightResizableList {}` ;
View 10 Replies
View Related
Jul 15, 2011
Is there a way to specify to find that I only want text files (and not binary files)? Grep has an option to exclude binary files, so I thought find probably has a similar feature, but I've been unable to find it.
View 2 Replies
View Related
Jan 25, 2009
I know how to search for normal files but can you let me know " How to search for 5 setuid files on the system. Also explain, for each file, why setuid mechanism is necessary for the command to function properly"
View 1 Replies
View Related
Aug 3, 2010
am new to linux and trying to find a file in sub directories using find command as:find .-name *.jpg -type fBut I am unable to get the result as find command is not permitted by the server administrator.Is there any way to find files without using find command.
View 14 Replies
View Related
Nov 23, 2010
I want to use GCC 4.1.2 on a SLES 11.0 x86_64 system. SLES 11 comes with GCC 4.3, so I compiled 4.1.2 and `make install`'d myself. When trying to use it, I get:
Code:
# /usr/local/bin/gcc-4.1 hello.c
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
hello.c is simply:
[Code].....
basically, I took SLES' gcc-4.3 ./configure line and removed the prefix & path directives and changed the program suffix. Considering I don't know the use of half those options I'm trying again taking as many defaults as possible.
But I don't know what I am missing. How do I get it so that I don't have to use -L or -static to use my gcc-4.1?
View 3 Replies
View Related
Sep 8, 2010
I want to scan a particular directory recursively and run a particular command with each file as input. For this I am using "find /dir/path". I dont want to write any long script containing loop on the output of "find". I want a single command which will allow me to run a command on each file of the "find" command output.
View 3 Replies
View Related
Mar 31, 2010
When I run find command with exec option, it just hangs on me. what am I doing wrong?
find /stdlist -type d -mtime 0 -exec cp -r {} joblogs ;
View 7 Replies
View Related
Nov 1, 2010
What is the difference between *.xml and *.xml in find command in Linux/macThe results of:find . -name *.xml and find . -name *.xml are different. But why?Also, is locate '*.xml' better than find? Which one is the most commonly used?
View 1 Replies
View Related
Aug 12, 2010
I've got a script where I have to parse out the last modified time for a large amount of files. Piping the output for "ls" into "cut" seems to work most of the time, but the output is unpredictable.The "fields" argument doesn't find the date modified columns consistently, and using character count is as well since the output can vary in width depending on the file name
View 3 Replies
View Related
May 17, 2010
I want to know the command which will list the local users created by me not system users.
View 6 Replies
View Related
Jun 13, 2010
How to find info and contents of the SD card via linux terminal. I found a command "mount"in internet. According to it it's in dev/sdb/.. but I didn't found such. I saw dev/sdc/
View 5 Replies
View Related
Jan 20, 2011
command to find the Distribution of Linux.
View 7 Replies
View Related
Feb 5, 2011
i have this find command to find modified files and copy them.Code:find $SRC_DIR -type f -ctime -1|xargs -i cp --parents {} $BACKUP_DIR/$DAY/and it works good but it want to exclude files that exist in some folders like $SRC_DIR/cash and $SRC_DIR/woks/tmp
View 3 Replies
View Related
Jun 20, 2011
If someone has done something wrong on a shared linux machine. If i want to find out who is that person or ip from where it is been done what are all the possible ways. 1 possibility I thought was to get the PID of the command and get other details from that PID?
View 4 Replies
View Related
Oct 27, 2010
t has been long time since i used the command that used to display the most widely used command in the distribution .It was in following format.(I guess it was a combination of history head sort grep or something like that)
50 ls -ltr
3 neat-tui
1 touch abc
I tried finding the command in google but wasnt able to find it
View 1 Replies
View Related
Jul 12, 2010
Ive tried to rsync from one ~/home on hdd a, to ~/home hdd b, using a live cd, but it returns a load of; eg:
rsync: opendir "/media/a2ab9331-effd-4855-8e0a-6c7f1a9d63b5/home/nnjond/.Skype" failed: Permission denied (13)
So i think i should fresh install and it would be convenient if i knew the refined commands to locate the saved files in /home hdd a, since 02_06_10 (not including all the hidden or deleted files), and then copy to a memory stick using the nautilus gui.
View 2 Replies
View Related
May 25, 2010
My goal is to find all pdf files on a remote machine, so I resort to the useful command find. So I type find .pdf or find .pdf" and I get nothing. I do the same on my machine and I get nothing. I do a regular search from the menu on my machine and I find quite a few pdf files. Would somebody please tell me what am I doing wrong?
View 5 Replies
View Related
Jun 29, 2011
I need to find out hardware information for the below items under Linux:
CPU (and cores)
CPU speed
Memory
Hard disks
OS version
View 6 Replies
View Related
Aug 17, 2011
Is there any command in Linux which will find a particular word in all the files in a given directory and the folders below and replace it with a new word?
View 4 Replies
View Related
Apr 12, 2010
We often require to find an equivalent text command for any GUI operation. Just as an example we click on a folder (say ABC) from the current directory in order to see the contents of that directory. The equivalent command for it to happen would be->
Code:
cd ABC ls Now the thing is that we often don't know what that equivalent command will be. So I want to know that is there any way out to find it. What I want to do is that I shall perform any operation using mouse in the GUI mode(whatever operation it could be) and then I can see a log file to see what I actually did last(rather what the command would have been if I have worked in the text mode)...
View 1 Replies
View Related
Nov 30, 2010
If the filesystem is mounted with noatime option does it influence find -atime behaviour? I tested and it looks that find is able to see access time but why should it if mounted with noatime? Or maybe it depends on the type of filesystem (I`m using XFS)?EDIT: Looks the answer is [URL]htmlIf a file system has been mounted with this option, reading accesses to the file system will no longer result in an update to the atime information associated with the file like we have explained above. The importance of the noatime setting is that it eliminates the need by the system to make writes to the file system for files which are simply being read. Since writes can be somewhat expensive, this can result in measurable performance gains. Note that the write time information to a file will continue to be updated anytime the file is written to.
View 1 Replies
View Related