How to Fix the Terminal After Viewing Binary File
Every now and then, I open up a file only to realize that it is a binary file (yes, I keep ignoring the warning that I am about to view a binary file, not text). Then the terminal ends up messy, or in other words, wonky. The characters have turned out in various colors, the lines are indented, and you can’t see what you are typing.
To fix it, run this command:
$ reset
As the name implies, this will reset the terminal back to its normal state.
Tip: How to Use watch Command
I have never known that there is a command in Linux called watch. Basically, watch runs a program in a period of time, and displaying the output in real time.
watch command syntax is very simple. One typical use of the command watch is running it with traceroute. This is one example:
watch 'traceroute google.com'
This will run the traceroute command, display the output and when it is done, it repeats the process again.
Here a couple more examples of the watch command:
watch -n 10 free -m
This command will run the command free in ten-second intervals, and display the output.
watch -n 3 'cat /proc/interrupts'
This command will display the interrupts in 3-second intervals.
Tip: Using find Command in Linux
Doing command-line stuff in Linux is fun. It may be intimidating for some at first, now that we are in the age where GUI is no longer an option. But with CLI, we can do so many things that can be accomplished faster if we know how to utilize the features of a certain command.
One command that is very flexible is find. With find, you can search not only based on filenames, you can also use other identifiers like GUI and UID, timestamps and file types.
Here are some examples of find commands:
This command will find all files in /home directory with .doc as extension and was modified 24 hours ago:
find /home -name *.doc -mtime 1
This one will find the same files, but not directories, and delete them using -exec option (great for disk usage maintenance, but BACKUP first!):
find /home -name *.doc -type f -mtime 1 -exec rm ’{}’ \;
You can also find files owned by a certain UID:
find /tmp -user johndoe find /tmp -uid 502
Or by GID:
find /home/development -gid 1000
You can also search for files and directories with certain permissions:
find . -perm -777
And from those examples, you can build your own command to find what you are looking for.
Unpopular But Useful Windows Shortcut Keys
I may be a Linux user but from time to time, I use Windows since I have it as my workstation OS and my Linux runs as VM. Then I found these tips from technotraits.com that should make my work in my Windows machine a little faster and more efficient.
The best thing about these shortcuts? Some are also applicable to Linux machines.
Windows Explorer
1. F2
Rename files by highlighting the file and pressing F2. Same goes to Linux.
2. F6
Lets you move across various panes of Windows Explorer.
3. Alt + Enter/ Alt+Double Click
Highlight a file in Windows Explorer and hit Alt+Enter or Alt+Double Click to view the file properties.
4. SHIFT+Right Click
Show the right context menu listing alternative commands.
5. SHIFT+Double Click
Runs the alternate default command (the second item on the right context menu).
6. BACKSPACE
Move one folder up.
7. Ctrl+Double Click
Open a folder in a new explorer window.
8. SHIFT+Click Close Button
When using Shortcut #7, pressing Shift while closing the window will close the parent windows as well.
9. SHIFT
Autorun will not start if Shift is pressed while inserting CD/DVD.
10. F3
Hit F3 in Explorer and Search will open to search for files and folders.
11. Ctrl
Press Ctrl Key and drag files to another folder to copy the selected files.
12. Ctrl+Shift
Press Ctrl+Shift and drag a file to another location and shortcut will be created.
13. ALT+SPACE
Open up the active window’s system menu.
Windows Management
14. CTRL+ESC
Open the Start Menu.
15. Windows Key+M
Minimize all open windows.
16. Shift+Windows Key+M:
Maximize all open windows.
17. Windows Key+D
Same with Shortcut #15
18. ALT+F6
Press F6 to switch between windows of the same program.
19. F5
Refresh. Same with Firefox, IE and Linux
20. CTRL+TAB/CTRL+SHIFT+TAB
Switch between tabs of properties window.
Miscellaneous
21. SHIFT+F10
Opens up right context menu. Similar with right click.
22. Windows Key+Pause/Break
Open System Properties Box.
23. Windows Key+L
Lock your current screen.
I tried most of the commands here and they work! If you find these shortcuts useful or otherwise, you can use the comment form below.
Tip: Resume Session with screen
Network infrastructure is the backbone of your computer’s connectivity and therefor should be stable, reliable and very little, if no downtime. If it isn’t the case, can you imagine getting disconnected from the server while you are remotely running your scripts via ssh? Not only that the script has to be re-run, but might damage other important files as well.
If you are in a situation where you need something to remain connected to the server, you can use screen. screen is a full-screen window manager that multiplexes a physical terminal between several processes typically interactive shells). When screen is called, it creates a single window with a shell in it (or the specified command) and then gets out of your way so that you can use the program as you normally would. Then, at any time, you can create new (full-screen) windows with other programs in them (including more shells), kill existing windows, view a list of windows, turn output logging on and off, copy-and-paste text between windows, view he scrollback history, switch between windows in whatever manner you wish, etc. All windows run their programs completely independent of each other. Programs continue to run when their window is currently not visible and even when the whole screen session is detached from the user’s terminal. read more
Search PinoyTux
Subscribe to Email Feeds
Blog Lounge
Popular Posts
Recent Posts
Drop your Card Here
Recent Comments
- mega-mind.net , , Dien Dan,Forums,Blog,CMS,php,cgi,asp,software,serial,hardware,game,games,choi game,Thuong mai dien tu, hoc tap, mua ban, download,choi nhac, xem phim, dien anh,cac van de khac,nokia,hp.vaio,iphone,ipad,itune,gmail,yahoo,chat,crack,an nic on President of United States of America: Barack Obama
- Belarus Hava Yolları, Belarus airlines, Uçak Bileti, Air tickets, Belarus uçak on Cebu Pacific Sucks
- Cezayir Hava Yolları, Cezayir airlines, Uçak Bileti, Air tickets, Cezayir uçak on Cebu Pacific Airlines is Evil!
- Lambchop on Cebu Pacific Airlines is Evil!
- rabat on Linux Comics of the Day








