I am looking for Windows Search equivalent looking for file name patterns (not file contents but file names)....
I am aware of "globbing" and wildcard recursive search functionality in ls but I am still not capable of finding files under directories.
for example: I want to find all files starting with a string lsnr* under root directory / and any sub-directories.....
ie I want to look for files like lsnr*.* anywhere under / and any sub-directories under / such as /dir1/dir2/dir4 and dir1/other/dir/someotherdir/sub-dir etc.
so if I have /dir1/lsnrcontrol and also have /dir1/dir/2/dir3/lsnr-tinit.dat then I want to list the files names etc.
I want to search a particular string in a directory , that directory contains N number of subdirectories, and files and my requirement is inside the directory and subdirectory what are the files contains particular string like "TBone" i want to display that files. Is it possible to do that..
Is it possible to find out the directory Thunar is currently displaying from the command line? I will only have one instance of Thunar open at one time.
1. How can you find all first level subdirectories under the current directory? 2. How will you show the last 100 lines of the file "foo.log"? 3. How will you Stream the contents of a the log file "foo.log" as it gets written to? 4. How can you grep for a pattern on a gzip'ed file? e.g., find "foo" in bar.gz 5. Find all lines in the file "foo" which DON'T have the pattern "bar" 6. Your web server is running very slowly. If you can login to the server, what command will you run to find out cpu and memory use? 7. Extract the file foo which is a part of the tar'ed, gzip'ed file bar.tar.gz 8. You attach a usb disk to your linux desktop, but it does not show up. How can you get more information about the error? 9. What is the secure way to login to remote systems? 10. What is the difference between TELNET and SSH? 11. Given a file 'a' with the following permissions -rwxrwxrwx 1 rohit rohit 0 2011-01-24 13:30 a Change its permissions such that it is only readable and writable by its owner, not accessible by anybody else in the group and only executable by the world 12. Difference between using ' and " for quoting a string / command in a shell 13. In the attached text file (test.txt) replace all occurrences of 'red' with 'yellow' without using an editor (i.e. from the command line) 14. How would you suppress output written to stderr by a command 15. Meaning of the #! notation in scripts e.g. #!/bin/sh 16. What is the output of the attached shell script test.sh Scripting questions, all based on the attached file access.log. Use one of perl, python, ruby, or shell scripts to solve these questsions. If any answer is obtained using just the command line, please include those commands as well. 17. How many accesses were made between 10am and 11.30am on Jan 24, 2011? 18. How many unique IP addresses accessed this server? 19. For every IP address which accessed this server, output a report showing number of hits for every type of HTTP status. For e.g., IP 192.168.1.20 has 164 hits with status 404 and 1690 hits with status 200.
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.
After hours (literally) of searching the web and reading man pages, I think I've come up with the following:Code:find . -exec grep 'path/to/file' -print | xargs -0 -I new_path mv {this is where I get confused}So my code above is incomplete, obviously. In order to finish replacing the string, I need to mv the new file into the old file's spot. How do I do this, by incorporating it into my line of code?
What command will provide you with the number of files in your current directory? Choose one answer. A. ls -c B. ls | wc -w (this one) C. ls -n | count D. ls -wc (this one ?)
I'm quite new to linux but I have configured a simple ftp server and it's working great. I have a FTP-Shared folder with upload and download subfolders. Under upload's and download's I have identical category subfolders like mp3's, movies, software etc. in both. As the guy's upload, I would like to create a line crontab where I can move all the content under /FTP-Shared/upload/mp3/* older than 14 day's to FTP-Shared/downloads/mp3/ recursively (Like in cp command), but the timestamp must be searched on the first directory and not sub files example: /mp3/Club Dance/CD1/Hallo world.mp3This is how far I got:[root@clients ~]# /usr/bin/find /FTP_Shared/upload/Mp3s/ -depth -mindepth 1 -mtime +14 -type d -exec mv -f {} /FTP_Shared/download/Mp3s/ ;This command moves the directory and files, but it is not recursively
I need to write a script that is given a directory as an argument, and it prints the last modified file from that directory and all its subdirectories.
for example:
$ newest /usr/etc --> /usr/etc/httpd/httpd May 28 12:16
If I had to do it only for the current dir, it would be easy...I'd probably use "ls -lt" and then show only the first line...
i need to know how to find number of files in a directory? is there any system calls in fedora 12.And i need to know how to perform a operation if the that count increases by one?
I am trying find files in a directory that contain numbers. I have tried ls /etc *[0-9]* but that doesn't work. If I cd to /etc and run ls *[0-9]* it almost works but it also includes results from within files. My last thought was to try: find /etc [0-9] -type f but this does not work either. My second problem is that I am trying to get list of files in a directory that were changed less than 10 hours ago, using grep, while leaving out directories. I am completely stuck with the second problem.
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?
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:
What is the vim command I have to use when I want to perform a text substitution not on the current line or on the whole document or on lines from number x to number y but just from the current cursor position down to the end (or up to the beginning) of the document?
I have a series of file names in a text file that I generated by running Code:
bash-4.1# ls -alt *.txz | awk '{print $8}' and then copy pasting the output. All of these file names have the version number Quote: -4.4.1-x86_64-1alien.txz
I just want a method to remove that version number from all the filenames so that I can then add all the packages without version numbers to a blacklist file.
I've tried kwrite and mousepad and both have a search feature and a replace feature but I haven't been able to just have the text removed successfully.
If I runls -R1I get a recursive listing of all files under the current directory.However, if I dols -R1 *.avi, ie I want to search only for files with the file descriptor .avi, I get an errorQuote:ls: cannot access *.avi:No such file or directorySo it seems I am using ls incorrectly. What's the correct way to use wild card pattern matching when using the -R switch? Or maybe that isn't possible?
I want to run a script that runs after every 15 minutes that i will do using crontab. But in script want to search a string from the last 15 minutes logs in log file containing data of whole day.
how i can search the string according to time difference that is logs from from current time and current time - 15 minutes.
Sample logs are as follows:
26-Aug-2010 16:38:46,055|9172310750|subscription_app|31ba267e%3A12aadd47bdc%3A50e9|ChargeAmount|ChargingIntercep tor - subscriber details processed sucessfully- {arg0.referenceCode=balanceEnquiry:true;subsChannel:Unknown;channelType:Subscription;transactionId:3
I am in my current directory. I want to copy a directory somewhere else into this current directory. Lets say I want to take it from direc1/direc2 and the directory I want to take is called demo.
Code:
That is what it shows in the man pages, but when I do that, it says cp: no match
Moving right along, I have a folder of MP3 files containing various Movie sound tracks and scores. I'm using Audio Tag Tool to tag all the files at once with an "Artist" of "Soundtrack", and to inherit the "Title" tag from the file name. After that, I will rename all the files (Using Audio Tag Tool -- awesome program, btw) with the format "<Artist> - <Title>.mp3"
The problem, is many of my files already contain the string "Soundtrack", which would be redundant. I happen to be a perfectionist, so I'm unable to ignore it and move on. Hence my question to you fine folk: I want to delete all instances of "soundtrack" (-i case irrelevant) in the filenames before I go through the above steps. But, its not quite that simple. This is a sample of some of the file names:
With bash is there a way to push and pop the current working directory? I tried writing bash;cd dir; ./dostuff;exit; but the current directory is now dir.
1. is there a way to prohibit a program from writing data on the hdd? 2. can i have different icons on each gnome workspace and how? 3. how to untar to current directory? "tar -xvvf blablah.tar.gz" does not work "tar -xvvf blabla.tar.gz -C ./" does not work in both cases, the files go into some strange random locations. 4. how can i change the way colors are displayed for different content in the xfce terminal? I used to have red for archives, blue for dirs etc. in kde, but lost all that after changing to gnome.