background preloader

Command Line

Facebook Twitter

EnglishFrontPage - Greg's Wiki. 8 Useful and Interesting Bash Prompts. Many people don’t think of their command prompt as a particularly useful thing, or even pay it much attention.

8 Useful and Interesting Bash Prompts

To me, this is a bit of a shame, as a useful prompt can change the way you use the command line. Well I’ve scoured the Interwebs looking for the best, most useful, or sometimes most amusing bash prompts. Here, in no particular order, are the ones I’d be most likely to use on my computers. Note – to use any of these prompts, you can copy & paste the “PS1=” line directly into your terminal. To make the change permanent, paste the line to the end of your ~/.bashrc file. 1. This prompt is probably the most amusing one on the list, but remains useful. Example: Code: A Beginner's Guide to Grep: Basics and Regular Expressions. Grep is one among the system administrator’s “Swiss Army knife” set of tools, and is extremely useful to search for strings and patterns in a group of files, or even sub-folders.

A Beginner's Guide to Grep: Basics and Regular Expressions

This article introduces the basics of Grep, provides examples of advanced use and links you to further reading. Grep (an acronym for “Global Regular Expression Print”) is installed by default on almost every distribution of Linux, BSD and UNIX, and is even available for Windows. GNU and the Free Software Foundation distribute Grep as part of their suite of open source tools. This tutorial focuses primarily on this GNU version, as it is currently the most widely used. Grep finds a string in a given file or input, quickly and efficiently. The tool has its roots in an extended regular expression syntax that was added to UNIX after Ken Thompson’s original regular expression implementation. Ttyrec: a tty recorder.

What's ttyrec?

ttyrec: a tty recorder

Ttyrec is a tty recorder. Recorded data can be played back with the included ttyplay command. ttyrec is just a derivative of script command for recording timing information with microsecond accuracy as well. It can record emacs -nw, vi, lynx, or any programs running on tty. What's New 2006-06-11: ttyrec 1.0.8 Released Introduced a hack to reduce the playback time drift. Usage Recording % ttyrec (In the executed shell, do whatever you want and exit) % ttyrec -e command (command specified by -e option will be executed) Playback % ttyplay ttyrecord -s2 option makes the playback speed doubled.

You can change the speed while playback by the following key strokes. "+" or "f" to speed up the playback twice "-" or "s" to speed down the playback twice "1" to change the playback to the normal speed File Transfer. 30 Fantastic Geeky Tricks to Get The Most From Your Mac. If you’re one of those Mac users that loves to dig in and play with hidden features and settings, this post is for you.

30 Fantastic Geeky Tricks to Get The Most From Your Mac

Below you’ll find 30 tips and tricks to help both seasoned and beginner Mac users to get the most out of their OS X experience. We’ll cover everything from obscure Terminal commands to keyboard shortcuts that every Mac user should know and use. Let’s get started! Dock Tricks Recent Items Stack Stacks are quite the handy addition to your Mac’s dock and the good people at Mac OS X Hints figured out a way to make them even more useful by creating a stack that automatically contains your most recent applications. These can of course be found under the Apple menu as well but it’s much more convenient to have them right in the dock. Recent Items Stack To accomplish this feat, simply copy and paste the line below into Terminal. Top 50 Terminal Commands. Hey Terminal is Mac OS X way into the command line world. It is designed for you to typing in specific commands that you would not be able to do otherwise.

This is great for customizing your Mac and unveiling hidden features. It is also a good way to destroy you system because you screwed something up. What I have done is crawl the web look of the Top 50 Terminal commands. 1) 2D Dock This quite a popular hack for the people running Leopard and don’t like the 3D feel. Show Hidden Files in Mac OS X. If you find yourself needing to access hidden files on your Mac, like an .htaccess file you downloaded, a .bash_profile, a .svn directory, – literally anything preceded with a ‘.’ indicating it is invisible by default – you can run the below command from the terminal to toggle hidden files to become visible.

Show Hidden Files in Mac OS X

For some quick background to fill in those who don’t know, files that are hidden in Mac OS are determined so by preceding the filename with a single period symbol (.), you can actually make any file hidden by placing a period in front of the name, thus making it invisible to the Finder. Let’s make all hidden files become visible in OS X: Show Hidden Files on your Mac This changes the default setting of Mac OS X so that Finder always shows all files. Launch the Terminal (found in /Applications/Utilities) and enter these commands exactly as shown.