Fedora Installation :: Total Number Of Lines And Characters
Dec 25, 2010
View the entire contents of the file / etc / passwd, showing first 10 lines of file / etc / group, 10 displayed the last line of the file / etc / group. And
- The total number of lines and characters in file pwd and grp
I made a fresh ubuntu server installation with two of the same hard disk drives in RAID1 mode.When the installation finished, I had some errors in random times rendering the system unresponsibleCode:end_request: I/O error, dev sda, sector <Number>From the above error, it looks like there was a problem with disk sda so I decided to change it with another same disk and rebuild the RAID1.
When I put the new hard disk on it, created a raid partition of the maximum allowed size and tried to add it to the raid array (after having removed the previous disk) I got an error saying that the new partition is not large enough to join this existing RAID1 array!Then an "fdisk -l" command shown something weird...The existing working hard disk in the RAID shows that it has 38913 cylinders but the partition starts at 1 and ends at 38913+1=38914!!How is this possible? When I create a partition myself I am not allowed to put numbers larger than the total number of cylinders!
Code: # fdisk -l Disk /dev/sda: 320.1 GB, 320072933376 bytes
I need to write shell script which can take number of files and count total rows from all CSVs and display total number of rows counted in all files. Is there any possibility of doing that using shell script and if yes then how.
I have a file with a random word on each line (3k+ lines). How can I get the lines with only five characters? I tried using grep file | more, but it returns all the words (even those less than 5 characters).
Edit: I also tried grep '.{5}' file | more but it doesn't show anything. And grep '.{5}' file | more returns all lines with four or more characters (I'm really confused about why it's doing this).
I would like to modify the content of a text file in Linux, in the following way:=> the file has several of these lines:./run_pest3 ./g134366.04080_0.062 x 2_d043 1 0.43 results_EC=> I want to modify all lines to be:./run_pest3 ./g134366.04080_0.062 x 2_d043 1 0.43 results_EC0.062i.e., the last number of $2 should be "attached" to the end of $7, for each line.
For example, I have a file called "file" like this one: type=strongsubj len=1 word=absolve pos=verb stemmed=y priorpolarity=positive type=strongsubj len=1 word=unique pos=adj stemmed=n priorpolarity=neutral type=strongsubj len=1 word=absolutely pos=adj stemmed=n priorpolarity=neutral type=weaksubj len=1 word=taking pos=verb stemmed=y priorpolarity=positive type=weaksubj len=1 word=friend pos=noun stemmed=n priorpolarity=positive type=weaksubj len=1 word=usually pos=adverb stemmed=n priorpolarity=positive type=strongsubj len=1 word=purecolor pos=anypos stemmed=n priorpolarity=negative type=strongsubj len=1 word=accusingly pos=anypos stemmed=n priorpolarity=negative
I want to add the plural for the noun, for example if find this line: type=weaksubj len=1 word=friend pos=noun stemmed=n priorpolarity=positive will add one more line : type=weaksubj len=1 word=friends pos=noun stemmed=n priorpolarity=positive where we add "s" for the word friend I did try to do like that: <code> cat file | while read LINE ; do
set -- ${line} if [[ "${4#pos1=}" == "noun" ]];then #I tried this line but it doesn't work properly: v3==$(echo $line |sed 's/$3/$s') #I want to find the third word "word=friend" in that line and add "s" after that word # I don't know what command to add this new line "$v3" to the file ??? done </code>
I am using 'sed -e /foo/d' to match lines which I want to delete from a file. I discovered I have some lines which contain random (extended?) characters like 'ủ' which I would also like to delete. The lines in the file should only contain alpha numeric characters.
Slackware 13.37, tested on 2 different PC; affected: mousepad and tcl/tk applications
I am using mousepad and tcl/tk application to view text files with long lines. Sometimes ago I found that some characters (part of line) in long lines disappear. The problem is shown on a very small video. [URL]
In Windows's CMD when you execute a command and then start writing the next one (while still executing the former one) the characters remain in the buffer and they all come up nicely to the new line once the previous command has been executed. In Ubuntu when I do this the newly typed characters annoyingly get in the beginning of the previous command's output lines. I don't really understand why isn't the default method as in Windows's CMD. I mean otherwise almost _everything_ sucks with it when compared to Unix/Linux shells/terminals (commands are longer, syntax is annoying, etc.) So I'd like to know how to do this in both Bash and Zsh.
I'm trying to find a script that will return me the largest number of repeating characters. Say, I have the following line in a text file: 12345AAAAA6789AAA
I want it to return 5, because "A" is repeated 5 times in this line (more than 3 at the end).
I'm attempting to search through a rather large assortment of html files created in Word using 'save as html'. what I'm trying to do is find and delete these tags (they're causing browsers to display black diamonds with white question marks):
<span style='mso-spacerun:yes'> </span> Tags contain from 1 to 4 spaces between opening and closing. I get positive results from this:
grep <span style='mso-spacerun:yes'> filename.html but once I attempt to tell it to match any number of characters up until the next '>' symbol, it tells me I'm using an invalid regex: grep <span style='mso-spacerun:yes'>[^>]+> filename.html
I've been nose-deep in regex tutorials for the past day or so, and I'm still not understanding why this doesn't work. If I put the pattern (without backslashes) into a separate file and use `grep -f patternfile filename.html`, I get no error but no matches either. So far as I can figure, the above regex boils down to: Match the string "<span style='mso-spacerun:yes'>", followed by any number of characters that are not a ">", followed by a ">". If someone could tell me where I'm going wrong with this,
My Linux server which is running my company website have been hacked. Today I saw a number of clients (customers) with some fun characters entries on my database. Access denial on really clients. Please assist, am running Linux Ubuntu 9 and I dont know where to start troubleshooting this. let me confession that I am still on the learning curve on Linux
I am not sure if this is really a Ubuntu question but lets try it!Received email shows a long header which includes lines of code. I can scroll through it but I can't reduce the number of lines on screen.This significantly reduces the number of lines available for the message. There must be a way to reduce or eliminate this header.
Just installed fedora 13. Everything is great except for the total lack of sound. I'm trying to use the onboard audio. Motherboard is asus M4A89TD. In alsamixer all of my devices are turned on to max.
When I open pavucontrol, under output devices it lists 'HDA ATI HDMI Digital Stereo (HDMI)' and 'Internal Audio Analog Stereo'. I think the correct device needs to be the the ATI SB one, but is missing from the list.
I recently found myself in possession of a large file (a few million lines in length) of short strings and would like to count the number of lines that are unique to the file. I thought this would be an easy process, but while working on the problem, I encountered the following. Can anyone explain this weird result to me?
I need to create a script to count the number of lines from a text file . The output must be put on another text file (no_lines.txt) and in this file i need to generate from the script this output :"File $FILE has $NO_LINES lines ".
i need to count the number of files and put the output into a variable. i used wc -l filename but i couldnt find an option to put the output to variable. example if the number o line is 5, i need the output of echo $x is 5.
I would like to parse an input file in which there are two columns per each row. We want to see how many lines are duplicated where we define duplicate to be having the same second field and different first field. For instance if the input file looks like the following:
I'm looking for a way to insert the number of lines in a file to the start of the aformentioned file. This should be simple but as I am not used to scripts in Linux, I am finding it tough going. I can find the number of lines in a file easily enough via
filesize=$(awk 'END {print NR}' $1)
but as for inserting this into the first line, i'm failing to do so. I've tried some of the other approaches on these forums but none so far have been able to do so.
I've tried:
sed '1i$filesize' $1
but sed i requires a string, not a variable so no go I've also tried:
but again with no luck as cat seems to need an input stream Just to recap, i want to insert a line at the start of a given file that holds the number of lines the original file has.
I quit using Fedora when FC4 came out, but I decided to switch back now that F11 has come out. I'm liking everything so far, though it is different from what I became used to (Ubuntu). My main question so far has to do with language support, and I cannot seem to find an answer anywhere for this. I need to have language support for several languages (including support to enter complex characters) for all applications for which it they are available. How do I install all the language files at once for, say, Korean, rather than installing each library one by one?
Downloaded the F10 live CD. Booted to it, got past the white, blue, and dark blue loading bar then my screen would be covered in black and white lines. No sign of the GUI except for a mouse cursor. ctrl+alt+backspace would cause the display to blink off and then come back on to the same thing. ctrl+alt+f2 would bring me to a terminal, logged in as root, but from there I couldn't do anything. startx would tell me I had x running on another screen.
hitting tab when booting the livecd and adding "xdriver=vesa" and "nomodeset" to the boot line. That works. I get to the desktop at native res with desktop effects. Killer. I tried to install; install went flawless, rebooted to my HDD and the same issue, black and white bars. When booted to my HDD, however, ctrl+alt+f2 doesn't bring me to a terminal, it causes my monitor to go into sleep mode and my computer becomes unresponsive so I can't do anything from the command line.
Here's what I'm getting at : how do I get my installed version of F10 to do the "xdriver=vesa" and "nomodeset" args that the livecd can do?
My machine is a home built machine I bought off of a friend. P4 2.4 ghz, GB RAM, 2 80GB HDDs, Radeon x1600.
installed fedora with the minimum option on the dvd. After that i logged it and im tring to install gnome, heres the catch though i only have 950MB worth of space. I noticed if i use the groupinstall "X Window System" it fails because of the space. Also it installs alot of things that I am not interested. what are the command lines to install gnome but with the minimal, no FF, no evolution, you get my point.