08-09-2011
The problem with this is
history 800 | grep 391
It grep for any command that has the string '391' which is not desired.
The problem with the below is
history 400 | grep -e '^391'
I do not have the -e option with my grep.
grep: illegal option -- e
Usage: grep -hblcnsviw pattern file . . .
SunOS mymachine 5.10 Generic_144488-07 sun4v sparc SUNW,SPARC-Enterprise-T5220
fc 391 391 # and clear the buffer before exiting
This works however not sure about "# and clear the buffer before exiting". Can you please explain?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
okay, i did the command: echo `history` >> /new.txt
i got a long line, which due to the size of my screen, it made 3 lines.
i then tried the command: grep emacs new.txt
while in root
and i got a full the same long line
any help appreciated (2 Replies)
Discussion started by: cleansing_flame
2 Replies
2. Shell Programming and Scripting
in my system history command is set to 60
how to remove all the command status even if i give history command.
i mean:
if i give history command in unix it should not show anything.........how to achieve this (2 Replies)
Discussion started by: ali560045
2 Replies
3. Shell Programming and Scripting
Hi all experts,
I want to see all the command that is typed in the server 3 days ago. I typed HISTORY command but it does not show all the things. The reason is my senior DBA could see all the commands ran in the server 3 days ago but i cannot see. Please let me know is there anyway i can view... (6 Replies)
Discussion started by: ma466
6 Replies
4. Shell Programming and Scripting
can someone help me in the awk part...little confuse on that part.
The problem is this: what input each utility gets and what it does with data and what output is provides to the next utility)
history | awk '{a++}END{for(i in a){print a " " i}}' | sort -rn | grep '^'
Thanks (4 Replies)
Discussion started by: Learnerabc
4 Replies
5. UNIX for Dummies Questions & Answers
How do you look at the whole list of previous commands you have used in VI? I know you can use the up and down arrows, but I know there's a way to see the full list. (5 Replies)
Discussion started by: cokedude
5 Replies
6. UNIX for Dummies Questions & Answers
Hi All.
Suppose I am in a "verylongpath" directory and I type "gedit thisfile".
At a later stage, the command is accessible from the hystory, but it is
useless if I have moved to another directory. The same applies to
"cd myfolder", etc.
Is there a way to instruct shell history to... (1 Reply)
Discussion started by: bruno69
1 Replies
7. UNIX for Dummies Questions & Answers
Hi all,
How can i view command history of a day.
when i used history command in my AIX server, it shows only last 16 commands. Is there a location where all the history is stored ?
Thanks in advance! (2 Replies)
Discussion started by: lramsb4u
2 Replies
8. UNIX for Dummies Questions & Answers
Can anyone tell this:
If two users are logged into the same server from different locations. Is there a way to see the history command of the other user? I tried the history command, but it is showing me only the commands I used.
Thanks in advance for your help.
Iamnew2solaris (1 Reply)
Discussion started by: iamnew2solaris
1 Replies
9. Shell Programming and Scripting
Hi,
I tried to grep ".sh_history" (DOTsh_history) file and did not return anything though I found the word in .sh _history file through vi editor in Linux. Then I tried to grep ".profile" to check if it is the prob with hidden files and I got results.
Then I verified the same with my friend... (4 Replies)
Discussion started by: bobbygsk
4 Replies
10. Red Hat
Hi,
I would like to know commands which i have executed on terminal should not be present in the history.How can i approch please help me.
Regards,
Mastan (1 Reply)
Discussion started by: mastansaheb
1 Replies
ZGREP(1) General Commands Manual ZGREP(1)
NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
ZGREP(1)