Question

Describe the risk of using the history expansion technique of !?string

Describe the risk of using the history expansion technique of !?string

0 0
Add a comment Improve this question Transcribed image text
Answer #1

the question is related to linux commands.

As we know , the history command lists the set of commands that you have used through-out your session.

It is useful, when you forgot to remember the recent commands that you have used.

!1 : displays the command which was used earlier.

!2 : display the second last command that you have used.

!4 : displays the last 4th command that you have used.

We can also use "!" to execute the commands specific commands that are executed previously.

For example :

!ps

here ps is the keyword. It acts like a keyword.And it will display the most used command with ps

let's say we have used ps -ef | grep postgreql for finding all postgreSQL processes that are running .

So, it will the command ps -ef | grep postgres in the command line.

if we use !?string : For example let's take we have used !?linux

it will search for the pattern that is recently used and executes that command which was used with that particular keyword previously.

let's say we have done

/user/local/linux10/bin/linux10 shutdown/stop

let's say this is the command we have used for some purpose.

when we do !?linux it will again shutdown the machine which is we do not want.because there are some processes that are currently executing some jobs.

When we re-execute this kind of commands , we always lose something.

So, it is suggested not to do these kind of activities where lot of risks are involved in that.

Add a comment
Know the answer?
Add Answer to:
Describe the risk of using the history expansion technique of !?string
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT