10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
for example i have a directory
home/solaris/unix/samplefiles/
with defaults files in it.. those default files have 1 word in common "UNIX". how can i list the files without "UNIX" words in it using grep command
thanks,
im using unix solaris, korn shell.. (1 Reply)
Discussion started by: daveaztig14
1 Replies
2. Shell Programming and Scripting
Hello,
I am running below command as root user
#nodetool cfstats tests | grep "Memtable switch count"
Memtable switch count: 12
Where as when I try to run same command as another user it gives different result.
#su -l zabbix -s /bin/bash -c "nodetool cfstats tests | grep "Memtable switch... (10 Replies)
Discussion started by: Pushpraj
10 Replies
3. Shell Programming and Scripting
grep -i -f panel_genes.txt hg19_refGene.txt > match.txt
seems to be pulling names the do not exist in the input file (panel_genes.txt) - the output is attached as well (match.txt)
For example, RNF185 or ZNF146 are not genes in the input. I am trying to match the input file genes only and am... (9 Replies)
Discussion started by: cmccabe
9 Replies
4. Shell Programming and Scripting
Hi
I have lots of file in on folder and i want to egrep from only few files.
List of files......
Polt_KJ_430_OutputRBS_istUt_CR2.log
Polt_KN_4122_OutputRBS_ncChk_CR.log
Polt_LN_2230_OutputRNC_Hth_CLKLKL.log
Solt_KJ_430_OutputRBS_istUt_CR2.log
Solt_KN_4122_OutputRBS_ncChk_CR3.log... (2 Replies)
Discussion started by: asavaliya
2 Replies
5. Shell Programming and Scripting
Hi,
I have around 500 Text files and Each file will be having either
String1 or String2.
I want to list the file only which has String1 and Sting2 in a single command.. (5 Replies)
Discussion started by: balasubramani04
5 Replies
6. Shell Programming and Scripting
Hi, im taking an entry Unix class, and as part of my lab assignment I have to copy all files in the /home/david/lab3 directory that have the file extension .save to your lab3/temp directory. I'm having trouble getting the grep to do anything worth while
I've been trying to do:
cp... (6 Replies)
Discussion started by: Critical jeff
6 Replies
7. Shell Programming and Scripting
i want to search in the current directory all the files that contain one word for example "hello"
i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies
8. UNIX for Advanced & Expert Users
I am doing "ps -f" to see my process.
but I get lines that one of it represents the ps command itself.
I want to grep it out using -v flag, but than I get another process that belongs to the GREP itself :
I would like to exclude
# ps -f
UID PID PPID C STIME TTY TIME CMD... (2 Replies)
Discussion started by: yamsin789
2 Replies
9. UNIX for Dummies Questions & Answers
hi all
i have directory
/usr
under this directory i have subdirectories
tmp1,tmp2,tmp3
like this
/usr/tmp1
/usr/tmp2
/usr/tmp3
and so on
i want to search string in files (i don't know the name of the files)and i want to serch it in all the directories under the /usr
how shell i do... (3 Replies)
Discussion started by: naamas03
3 Replies
10. Shell Programming and Scripting
What is the meaning of this
grep -v $object grant_BU.sql>temp (1 Reply)
Discussion started by: debasis.mishra
1 Replies
cut(1) General Commands Manual cut(1)
NAME
cut - cut out (extract) selected fields of each line of a file
SYNOPSIS
list [file]...
list [file]...
list char] [file]...
DESCRIPTION
cuts out (extracts) columns from a table or fields from each line in a file; in data base parlance, it implements the projection of a rela-
tion. Fields as specified by list can be fixed length (defined in terms of character or byte position in a line when using the or option),
or the length can vary from line to line and be marked with a field delimiter character such as the tab character (when using the option).
can be used as a filter; if no files are given, the standard input is used.
When processing single-byte character sets, the and options are equivalent and produce identical results. When processing multi-byte char-
acter sets, when the and options are used together, their combined behavior is very similar, but not identical to the option.
Options
Options are interpreted as follows:
list A comma-separated list of integer byte option), character option), or field option) numbers, in increasing order,
with optional to indicate ranges. For example:
Positions 1, 4, and 7.
Positions 1 through 3 and 8.
Positions 1 through 5 and 10.
Position 3 through last position.
Cut based on a list of bytes.
Each selected byte is output unless the option is also specified.
Cut based on character positions specified by
list extracts the first 72 characters of each line).
Where list is a list of fields assumed to be separated in the file by a delimiter character (see for example, copies the
first and seventh field only. Lines with no field delimiters will be passed through intact (useful for table sub-
headings), unless is specified.
The character following
is the field delimiter option only). Default is tab. Space or other characters with special meaning to the shell
must be quoted. Adjacent field delimiters delimit null fields. char may be an international code set character.
Do not split characters.
If the high end of a range within a list is not the last byte of a character, that character is not included in the
output. However, if the low end of a range within a list is not the first byte of a character, the entire character
is included in the output."
Suppresses lines with no delimiter characters when using
option. Unless is specified, lines with no delimiters appear in the output without alteration.
Hints
Use to extract text from a file based on text pattern recognition (using regular expressions). Use to merge files line-by-line in columnar
format. To rearrange columns in a table in a different sequence, use and See grep(1) and paste(1) for more information.
EXTERNAL INFLUENCES
Environment Variables
determines the interpretation of text as single and/or multi-byte characters.
If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari-
able. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization
variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
supports both single- and multi-byte character code sets. International code set characters may be specified in the char given to the
option. recognizes the international code set characters according to the locale specified in the environment variable.
EXAMPLES
Password file mapping of user ID to user names:
Set environment variable to current login name:
Convert file containing lines of arbitrary length into two files where contains the first 500 bytes (unless the 500th byte is within a
multi-byte character), and contains the remainder of each line:
DIAGNOSTICS
Line length must not exceed
characters or fields, including the new-line character (see limits(5).
Missing or option or incorrectly specified list. No error occurs if a line has fewer fields than the list calls for.
list is empty.
WARNINGS
does not expand tabs. Pipe text through expand(1) if tab expansion is required.
Backspace characters are treated the same as any other character. To eliminate backspace characters before processing by use the or com-
mand (see fold(1) and col(1)).
AUTHOR
was developed by OSF and HP.
SEE ALSO
grep(1), paste(1).
STANDARDS CONFORMANCE
cut(1)