Get A Past Bash Command Quickly
It's one thing to to surf for past Bash commands if we've only run a few of them in one day, but what if we've been running hundreds (or thousands) of Bash commands and we want to look through our history to get one and re-use it quickly? Given that a short command could easily be typed, we'll assume that we're surfing for a past command that would take some time to type out, or a past command that we may have forgotten and need to consider. What happens when we want to get that specific Bash command without re-typing the whole thing in this scenario? In the video, Bash Hack: Get History and Select Past Command In Bash, we learn how we can look through past Bash commands and select one for re-use.
Some examples we see in the video:
- What's a quick way to get the past commands in Bash that we see in the video?
- For quick re-use (and to save us time), how to set the current command to a past one?
- Think of an example when this may be useful - consider that sometimes our commands will be similar to each other and we can get a past command, make a quick edit, then execute it.
- In the context of security, what might be something we want to consider when we write a command that might involve information we may not want "surfable"? What is a way that we can protect this data?
For mastering data transformation from one form to another form, check out the highest-rated Automating ETL course on Udemy. For a coupon to the course, check out the trailer video on the channel SQL In Six Minutes.
When we want to get a past line, but edit it we can get the past command, then quickly edit the line before running it. Keep in mind that we'll want to confirm that we obtained the correct past command or else we may end up running something that we didn't want (depends on the actual command). I also note how we can search the history of past commands, then extract what we want and edit as appropriate (if required). Given that this feature exists, it should raise concerns about the commands that we use - a history of these exist and we want to reflect over this in the context of security. While this goes unmentioned, we should be extremely careful about running commands with key data, such as passwords, certificates, etc.
Are you looking for tech consultants that can assist with design and development? From building custom applications to working with existing infrastructure that's causing you trouble, we can get you connected to consultants who can assist. You can contact for assistance.
SQL In Six Minutes | Automating ETL | T-SQL In 2 Hours | Consumer Guide To Digital Security
Leave Get A Past Bash Command Quickly to:
Read more #development posts
Best Posts From SqlinSix
We have not curated any of sqlinsix's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From SqlinSix
- Solution When ISJSON May Not Be A Recognized Function Name
- Creating a GUID For Each GUID
- Get A Past Bash Command Quickly
- Connecting A Data Factory To An Existing Runtime In Azure
- Backing Up A Database With MongoDump
- SQL Tutorial: Using UNION ALL or UNION and Why
- T-SQL: How To UNION ALL Tables and Why
- SQL Tutorial: Solving Data Differentials With LEFT JOINs Only
- Solving Data Differentials With LEFT JOINs
- Spark Scala: Grouping Values In A Key-Value Pair
- Transaction Log Becoming Full Due To Replication
- Why We Should Be Skeptical About Data Regarding the Physical World
- Does the Same Data Mean the Same Conclusions?
- SQL Tutorial: How To Use ROW NUMBER() and Why
- Not Able To Drop Table Because of Reference
- T-SQL: How To Use DENSE_RANK()
- The Decentralized Myth - Beyond the Hype
- SQL Tutorial: INNER JOINs vs LEFT JOINs
- T-SQL: How To Use PARTITION BY and Why
- Weekly Tech Lesson: CROSS JOINs Versus CROSS APPLY