General :: Grep Command - Show The Files But Not The Line Count

Oct 31, 2010

This has to also show the line count. I can get it to show the files but not the line count. What is the single command used to identify only the matching count of all lines within files under the /etc directory that contain the word „HOST? List only the files with matches and suppress any error messages.

View 4 Replies


ADVERTISEMENT

General :: Find/grep/wc Command To Find Matching Files - Print Filename And Word Count?

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

General :: Identify File Types - Command Line Arguments - And Count - How Many Of Them Are Regular Files

Feb 20, 2010

Write a script that will take a list of filenames as arguments and output a count of how many of them are regular files, and how many of them are scripts (if the file is executable, it will be assumed to be a script file)

Counts always come back as 0

View 5 Replies View Related

OpenSUSE :: Count Lines In Multiple Text Files From Command Line?

Apr 27, 2010

I want to (from the command line) be able to counte lines in a bunch of files of a specific type in a folder and all its sub-folders. How would I do this?

View 1 Replies View Related

General :: Grep String From Logs Of Last 1 Hour On Files Of 2 Different Servers+calculate Count?

Sep 3, 2010

I am trying to grep a particular string from the files of 2 different servers without copying and calculate the total count of its occurence on both files. File structure is same on both servers and for reference as follows:

Code:

27-Aug-2010 10:04:30,601|919122874903|phtunes_app|1282243292627|NotifySmsReception|DMGenerateLogInterceptor - ExternalTransactionID:SDP-DM-26713018, TransactionStatus:Requested
27-Aug-2010

[code]....

View 6 Replies View Related

General :: Command Line - Count Number Of Folders In A Drive Using System?

Apr 9, 2010

I need to organise an external HDD such that there is no more than 500 folders on it.

Ubuntu's "Properties" pane shows only the file count, not the folder count.

Is there a simple CLI line that will tell me the number of subdirectories?

View 3 Replies View Related

General :: Command To Grep Complete Line

May 11, 2011

cat filename| awk '{print $3}' | cut -c -3 | cut -c 2- | grep 66

this returns the lines containing "66" at 2nd 2 characters of 3rd column of a line, now i need complete lines for this, how can i do it?

View 6 Replies View Related

General :: Bash Command To Count Files ?

May 3, 2010

I would like to count all the jpgs in my home folder I need a command like this:

~$ Sudo count -R /*/*.jpg

View 3 Replies View Related

General :: Show Folder And Only One Subfolder Using Ls In Command Line?

Jul 13, 2011

I have many folders with many subfolders. All I want it to get the folder name and the first subfolder. I tried using ls -R but this give me more than I want it. Let say I have:

dir1/subdir1/sub_1_1/file.a
dir1/subdir1/sub_1_1/file.a2
dir1/subdir1/sub_1_1/file.a3

[code]....

All I want when I execute the command is to show me:

dir1/subdir1
dir1/subdir1
dir1/subdir2

[code]....

View 4 Replies View Related

General :: Use Grep Command To Filter The Log Files Created Between 3:00 PM To 4:30 PM In Buch?

Dec 13, 2010

I would like to know how to use grep command to filter the log files created between 3:00 PM to 4:30 PM in buch of log for whole day in different headings. This files resembles like sar file in linux.

View 5 Replies View Related

General :: Script To Count # Of Chars Per Line - If Line Meets Certain Criteria - And Get Avg #?

Sep 11, 2009

I have several files with many lines something like this:

I'm trying to write a script that will count the number of characters per line that doesn't contain a ">" symbol and give me an average of those values. I have most of the script together but I can't figure out how to connect some of the steps.

Code:

View 3 Replies View Related

General :: Command Line - Show Entire File Contents In Dialog?

May 20, 2010

I want to show the contents of a file on Dialog box for which I have use the "--textbox" dialog and "--tailbox" dialog.

But it doesn't show the whole contents of file, it only shows some of the data.

How do I get it to show the entire file data?

View 1 Replies View Related

General :: Good Desktop/application Or Command Line Tool To Show Two Different Timezone Concurrently?

Jul 18, 2011

I want to find a desktop application or command line tool to show two different timezone concurrently under LINUX.

Anyone knows there are such application?

Say i want to know the time at london and USA at the same time. (different time zone)

View 4 Replies View Related

General :: Grep Lines Containing A Certain String PLUS The Line Following That Line?

Sep 1, 2009

I have a dataset (see example below) that I would like to go through and copy all lines containing a certain string ("LGIG") plus the line immediately following that line to a new file. I have no problem grepping lines containing the string LGIG but I'm lost how to translate that to line number and shift up one line number for each instance of that string.

Example input file:

[code].....

View 5 Replies View Related

General :: Difference Between 'grep "" * | Wc -l' And 'wc -l *' Total Count?

Oct 12, 2010

I am trying to find the number of lines in a directory containing .h and .cpp files.When I type

Code:
grep "
" * | wc -l

[code]....

View 4 Replies View Related

General :: Grep - Output Show Only Right Of?

May 17, 2010

I forgot a lot of my command line. I am doing cat file | grep "error" and i would like it to show everything to the right of G:/ including G:/ if possible. I figure its an awk command but i dont know what. I tried awk '{print $8+}' but + does not work like i hoped and guessed.

View 2 Replies View Related

General :: How To Download Files From Command Line

Aug 29, 2010

For example, see this page Advanced Linux Programming.

I want to download all the pdf files linked from this page. Is there a simple commandline way of doing it?

Something on the lines of

download [URL]

View 2 Replies View Related

General :: Joining Two Files From The Command Line?

Oct 21, 2010

I'm looking for a solution for the following simple problem. I have two files, fileA and fileB. Each file contains only one word per line, and they contain exactly the same number of lines. I would like to create a new file called fileAB, where the i-th line contains the i-th line of fileA, a Tab separator character, and then the i-th line of fileB. I know how to do it in Python or other scripting languages, but it would be nice to have a bash one-liner for that. Is it possible to do this in bash or any other Unix shell, using the tools that are usually available on the command line (e.g., sed, awk and such)?

View 1 Replies View Related

General :: Showing The Line Count Of A Specific File

Mar 30, 2011

Is this the correct way to show the line count of a specific file?

cat file | grep * -c

View 3 Replies View Related

Ubuntu :: Search Files Containing A String / Grep Command?

Sep 1, 2011

how to search for those files which contain word "AM_COLLECTION=22". I need to know all the files with this string. ( I know the grep command can do it but either

View 4 Replies View Related

General :: SQL Like Group By And Sum For Text Files In Command Line?

May 2, 2010

I have huge text files with two fields, the first is a string the second is an integer. The files are sorted by the first field. What I'd like to get in the output is one line per unique string and the sum of the numbers for the identical strings. Some strings appear only once while other appear multiple times. Given the sample data below, for the string glehnia I'd like to get 10+22=32 in the result. how to do this either with gnuwin32 command line tools or in linux shell?

[Code]...

View 2 Replies View Related

General :: Command Line - Trying To Cleanse Log Files On A Machine - Currently Using Sed

Feb 21, 2011

I have a large amount of log files that I need to remove sensitive data from. The sensitive data is provided to me in a text file and is prone to change. I had hoped to do the equivalent of this:

[Code]....

The commented out egrep works fine, the sed doesn't. Am I right to use sed for this? Or is there a more apt route to take?

View 2 Replies View Related

General :: Command Line - Compressing All .pdf Files Recursively (.tar)?

Jun 20, 2011

At the linux command line, I'd like to compress all .pdf files in a directory, any of it's subdirectories and so on - but only .pdf files. I'm struggling to figure out the syntax

View 2 Replies View Related

General :: Access Files With Spaces From Command Line?

Mar 17, 2011

How do I access files with spaces from the command line?
for example I want to go to a file called "New File" and let's say is in Downloads/Books/(and here is the file)
how do I input the space since the command line doesn't recognize it?

View 2 Replies View Related

Ubuntu :: Command Line Option To Show Rhythmbox?

Aug 26, 2010

Does anyone know the command line option to show rhythmbox?

Basically I just want to make a shortcut to show the rhythmbox screen as opposed to clicking the icon and selecting show rhythmbox

rhythmbox-client --(option) --no-start

View 9 Replies View Related

General :: Splitting Text File Into Several Parts By Line Count

Sep 21, 2009

I have a utility that works with files. The utility is crashing at after about 120 files. The input to the utility is a file containing a filelist. I want to cut the file with the file names in it to seperate files containing about one hundred or so. My thought was to determine the number of lines/100 and then use head and delete to create temporary files to run the utility multiple times to prevent the crash. When I tried to create a variable using the wc -l command the output gives me the number of total lines but it also includes the filename of the input file. (873 Filename.txt) I can not figure out how to remove the Filename.txt from the variable.

View 2 Replies View Related

Programming : Find Out Files That Are Changed Less Than 10 Hours With Grep Command?

Mar 20, 2010

Getting the list of files in the root directory that have changed less than 10 hours earlier, using grep, but without the directories.

View 1 Replies View Related

General :: Delete Files On The Command Line With Regular Expressions?

May 6, 2010

Lets say I have 20 files named FOOXX, where XX is the number of the file, eg 01, 02 etc. At the moment, if I want to delete all files lower than the number 10, this is easy and I just use a wildcard, eg rm FOO0* However, if I want to delete specific files ina range, eg 13-15, this becomes more difficult. rm FPP[13-15] does not work, and asks me if I wish to delete all files. Likewse rm FOO1[3-5] wishes to delete all files that begin with FOO1 So, what is the best way to delete ranges of files like this? I have tried with both bash and zsh, and I don't think they differ so much for such a basic task?

View 2 Replies View Related

General :: Inserting Multiple Files To Mysql On Command Line?

Mar 5, 2011

I am using ubuntu and mysql.I have a list of many .sql files, like 1.sql, 2.sql, 3.sql ... 100000.sqlI need to insert them into the database mysql mydb < *.sqlGives me: -bash: *.sql: ambiguous redirect

View 2 Replies View Related

General :: System Command Line Utility For Watching Log Files Live?

Jan 5, 2011

What's a good linux command line utility for watching a log file live? It's probably obvious but I totally forgot it.

View 2 Replies View Related







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