Sponsored Content
Top Forums Shell Programming and Scripting How to read n number of lines from a file Post 302398920 by varsha on Friday 26th of February 2010 12:22:44 AM
Old 02-26-2010
Hello frds!!!

Hi frds,

I dowloaded a file from net which ends with .bz2 extension den i unzipped the file using the command bunzip2 -d filename. Now i want to view the content of that file my OS is fedora7 please anyone help me regarding this.SmilieSmilie


Thanks SmilieSmilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To read and separate number and words in file and store to two new file using shell

hi, I am a begginer in unix and i want to know how to open a file and read it and separate the numbers & words and storing it in separate files, Using shell scripting. Please help me out for this. Regards S.Kamakshi (2 Replies)
Discussion started by: kamakshi s
2 Replies

2. Shell Programming and Scripting

Read a number from file and place it back

Hi All, I want to read one number from the file. Only one number will be there in the file. then i have to increment the number in my script and put it back in the same file. Is it possible? Can anybody help me? Thanks, Vinay (6 Replies)
Discussion started by: vinayakatj56
6 Replies

3. Shell Programming and Scripting

Read the specified line number from file

Hi Guys, I am new to unix. Actually i want help in writing an single command where i can actually read specific line number in file where the line number will be passed to command as parameter. ex. 1 a 2 b 3 c 4 d And to my command i pass as 2. so i should get output as 2 b ... (15 Replies)
Discussion started by: kam786sim
15 Replies

4. Shell Programming and Scripting

Number lines of file and assign variable to each number

I have a file with a list of config files numbered on the lefthand side 1-300. I need to have bash read each lines number and assign it to a variable so it can be chosen by the user called by the script later. Ex. 1 some data 2 something else 3 more stuff which number do you... (1 Reply)
Discussion started by: glev2005
1 Replies

5. UNIX for Dummies Questions & Answers

Read directory files and count number of lines

Hello, I'm trying to create a BASH file that can read all the files in my working directory and tell me how many words and lines are in that file. I wrote the following code: FILES="*" for f in "$FILES" do echo -e `wc -l -w $f` done My issue is that my file is outputting in one... (4 Replies)
Discussion started by: jl487
4 Replies

6. UNIX for Dummies Questions & Answers

How to read contents of a file from a given line number upto line number again specified by user

Hello Everyone. I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below: if ; then if ; then tail +$1 $3 | head -n $2 else ... (5 Replies)
Discussion started by: grc
5 Replies

7. UNIX for Dummies Questions & Answers

When reading a csv file, counter to read 20 lines and wait for minute then read next 20 till end

Hello All, i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file. Any inputs are appreciated ... (3 Replies)
Discussion started by: victor.s
3 Replies

8. Shell Programming and Scripting

Read line with particular number of lines

Hi all, I have a file sample.txt abc asd adf daf adw add adv wdf I want to control the number of lines to read Like if i give input as ./script_name 2 5 required output asd adf daf (2 Replies)
Discussion started by: krux_rap
2 Replies

9. Shell Programming and Scripting

How to read a number from a file?

hello guys, I'm struggled to get a number from a very long text file. NAtoms= 33 NActive= 30 NUniq= 23 SFac= 1.00D+00 NAtFMM= 60 NAOKFM=F Big=F Integral buffers will be 131072 words long. Raffenetti 2 integral format. The number 33 is what I wanted, always follows NAtoms=... (5 Replies)
Discussion started by: liuzhencc
5 Replies

10. Shell Programming and Scripting

How to read a file starting at certain line number?

I am new to ksh scripts. I would like to be able to read a file line by line from a certain line number. I have a specific line number saved in a variable, say $lineNumber. How can I start reading the file from the line number saved in $lineNumber? Thanks! (4 Replies)
Discussion started by: dcowboys13
4 Replies
GNOME(1)						      General Commands Manual							  GNOME(1)

NAME
GNOME MIME configuration files The GNOME system uses MIME types to classify content. Each MIME type on the GNOME system has a number of attributes attached to it. Some of these attributes have a special meaning to the GNOME system. MIME type of files There are two ways of classifying a file in the GNOME system: by matching their extension or a regular expression with their name or by its content. GNOME applications use one of those two methods depending on speed contraints and the specific setup. The MIME types available on the system can be configured at runtime by putting special files in either the GNOME MIME directory (/usr/share/mime-info) or the user ~/.gnome/mime-info directory. MIME type definition files. The routines that classify a file by its name, use the contents of all of the files with the extension .mime from the /usr/share/mime-info directory and the ~/.gnome/mime-info to build the database for filename matching. The latter is supported to enable users to provide their mime types to extend the system defaults. Application that wish to install their own MIME types only need to install a file in this directory. The file /usr/share/mime-info/gnome.mime is special, as it contains the defaults for gnome, and is read first. In addition, the file ~/.gnome/mime-info/user.mime is read last. This will guarantee that there is a way to set system defaults, and there is a way for the user to override them. There is currently no way to tell anything about the order of the other files in those directories, nor is there anyway to override system defaults yet. The format is the following: mime-type-name ext[,priority]: ext1 ext2 ext3 ext[,priority]: ext4 regex[,priority]: regex1 regex[,priority]: regex2 where "mime-type-name" is a valid MIME type. For example "text/plain". For example, for a vCalendar application, this file would be installed: ------ calendar.mime ------- application/v-calendar: ext: vcf ----------------------------- MIME key information To add keys to a MIME type, it is necessary to install a file with the extension .keys in the /usr/share/mime-info directory or in the ~/.gnome/mime-info directory. The former is for system-provided mime-information and the latter is to enable the user to extend the actions as provided by the system. The file /usr/share/mime-info/gnome.keys is special, as it contains the defaults for gnome, and is read first. In addition, the file ~/.gnome/mime-info/user.keys is read last. This will guarantee that there is a way to set system defaults, and there is a way for the user to override them. There is currently no way to tell anything about the order of the other files in those directories, nor is there anyway to override system defaults yet. The .keys files have the following format: mime-type-match: []key=value Above, the key is the key that is being defined and value is the value we bind to it. The optional [LANG] represents a language in which this definition is valid. If this part is specified, then the definition will only be valid if LANG matches the setting of the environment variable LANG. The LANG setting is used to provide keys which can be displayed to the user in a localized way. This is an example to bind the key open to all of the mime-types matching image/* and the icon-filename key is bound to the /opt/gimp/share/xcf.png value: image/*: open=gimp %f image/x-xcf: icon-filename=/opt/gimp/share/xcf.png This will make the GIMP the handler for the open action. Files of type xcf would use the filename pointed in the icon-filename key. %f gets interpolated with the file name or the list of file names that matched this mime-type. As you can see from the example above, a .keys file does not need to provide all of the values, it can just provide or override some of the actions. User defined bindings in .keys file will take precedence over system installed files. Special key used by the GNOME system The following keys are currently used in the GNOME desktop: open Open the file with this command. icon-filename The filename with the icon that should be used to represent files of this type. view Command to view the file contents. ascii-view A command that should be used to do an ascii-rendering of the file. Used as a fallback by the filemanager if a view action does not exist. fm-open file-manager open. If present, the file manager will use this action instead of the value in open to perform this action (the file- manager for example will open archive files as if they were directories by using the VFS). fm-view file-manager view. If present, invoking the view opertion on the file manager will use the value defined here instead of the value in "view". fm-ascii-view Fallback operation for the file manager as well. Those keys are also queried on the metadata (except in the cases where the lookup would be too expensive). AUTHOR
This manual page has been written by Miguel de Icaza (miguel@gnu.org) GNOME 1.0 GNOME(1)
All times are GMT -4. The time now is 01:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy