1) I want to display all the files in a directory that start with the word chapter, are followed by a digit 1,2,6,8, or 9 and end with .eps or .prn
so I came up with this
but is there a better way, i.e. combining both file types into the command?
2)I want to display all the types of files in home dir whose name do not start with a,k,G,Q in which the third letter in the name is not a digit and not a letter(upper or lowercase)
(<-- there must be a better way)(I have no idea how to check that the third char is not a digit or letter)?
I have gone over the chapter 3 times and can't find a solution.
btw, this is not a h/w assignment, just self study.
thanks for any help
Last edited by vbe; 01-18-2011 at 05:18 AM..
Reason: Use code tags please
Can I please have some ideas on how to do a recursive grep with certain types of files? The file types I want to use are *.c and *.java.
I know this normally works with all files.
grep -riI 'scanner' /home/bob/ 2>/dev/null
Just not sure how to get it to work *.c and *.java files. (5 Replies)
Hi,
I want to copy data from one directory to another in csh script. But in that i want to skip certain types of file. How can i do that.
Currently i am copying all the files as mentioned below..
foreach d ( $TEST_PATH/*)
cp -R $d $PWD
end
now i want to skip files... (3 Replies)
sorry couldnt think of a proper title lol
ok i have the following script it asks the user how many html tags they want. Im not sure how to display 2 tags if the user eneters the want only 2 tags
tags as in <p></p> or <h1></h1>
read -p "How many tags" tags1
if
then
echo "<$tags1>... (3 Replies)
Hi All,
i need to move two types of files from a directory.
I have used the below command to find the files from the directory..
SOURCE_DIR="some directory path"
TARGET_DIR="Target Dir"
Datestamp=Date_format
find $SOURCE_DIR \( -name "*.log" -o -name "*.out" ) - exec ls -1 {} \;
now i... (9 Replies)
Dear other forum members,
I'm writing a script for my homework, but I'm scratching all over my head and still can't figure out what I did wrong. Please help me. I just started to learn about bash scripting, and I appreciate if anyone of you can point out my errors. I thank you in advance.
... (3 Replies)
I'm trying to create a simple file inventory for a series of huge directories containing e-records. What I'm after is a list of all directories and sub-directories with just the number of each type of file in that directory/sub-directory. For example output would look like:
... (6 Replies)
I need to compare 2 diff type of files and find out the duplicate after comparing each types of files:
Type 1 file name is like: file1.abc
(the extension abc could any 3 characters but I can narrow it down or hardcode for 10/15 combinations).
The other file is file1.bcd01abc (the extension... (2 Replies)
Daily we are getting some datafiles to our unix server location FTPIN.
Incoming File names will be present in the location "/xyz/test/" as below:
"infile_A1_YYYYMMDD",
"infile_A2_YYYYMMDD",
"infile_B1_YYYYMMDD",
"infile_C1_YYYYMMDD"
"infile_C2_YYYYMMDD"
Where A, B and C are the... (3 Replies)
Trying to use the find command to find any directory which contains a file ending in .zip AND a file ending in .o
I'm having trouble specifying multiple files as criteria and have can't seem to figure it out from Unix in a Nutshell and Google. (2 Replies)