Overwhelmed with the response of last two articles of “Lesser Known Linux Article” series namely.
- 11 Lesser Known Useful Linux Commands – Part I
- 10 Lesser Known Linux Commands – Part 2
- 10 Lesser Known Effective Linux Commands – Part IV
- 10 Lesser Known Useful Linux Commands- Part V
22. ^foo^bar Command
Run the last command with modification, in a single instance. Suppose I need to run a command ‘ls -l‘ to long list the content of a directory say ‘Desktop’. Accidentally, you type ‘lls -l‘. So now you will have to retype the whole command or edit the previous command using navigation key. That is painful when the command is long.
Note: In the above replacement we used “^typo(to be replaced)^original_command”. This command may be very dangerous if you knowingly or unknowingly replaced the typo with system command or anything risky say rm -rf.
23. > file.txt Command
This command flush the contents of a file without the need of removing and creating the same file again. This command is very useful in scripting language when we need an output or log on the same file again and again.
I have a file say ‘test.txt’ on my ‘Desktop‘ with a lot of text.
Note: Again, this command can be dangerous, don’t ever try to flush the contents of a system file or configuration file. If you do so, you will be in serious trouble.
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
► Read more: http://adf.ly/1nBSYd
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
No comments:
Post a Comment