commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
I often find the need to number enumerations and other lists when programming. With this command, create a new file called 'inputfile' with the text you want to number. Paste the contents of 'outputfile' back into your source file and fix the tabbing if necessary. You can also change this to output hex numbering by changing the "%02d" to "%02x". If you need to start at 0 replace "NR" with "NR-1". I adapted this from http://osxdaily.com/2010/05/20/easily-add-line-numbers-to-a-text-file/.
Find C/C++ source files and headers in the current directory.
This should work on any unix platform running bash. Just type the program into cat and give it a ^D when you're done, at which time it will compile, run, and remove the program. Obviously, you can run it without the "rm a.out" if you'd like to keep the binary. If you want to keep the source, well, you might as well just write it in vi or emacs first then.
You can get what functions at which addresses are inside a dynamic link library by this tool.
will display typedefs, structs, unions and functions declared in 'stdio.h'(checkout _IO_FILE structure). It will be helpful if we want to know what a particular header file will offer to us. Command 'cpp' is GNU's C Preprocessor.