Yesterday I had to select some raws (1, 5, 9, ….) from a text file.
This has been a hard job because I was trying to solve the wrong problem……
Really, before coding you should analyze deeply your problem and then you should think which tool you need to use.
However, come on and see my experiments:
First of all we need a test file, I'll use the following:
This is a preview of
How to select odd (or even ) raws from a text file using the bash
.
Read the full post (292 words, estimated 1:10 mins reading time)
Categories: Bash Tip & Tricks, linux, Mac OS X, sysadmin, Tower of Babel, UNIX TLC, xAppSoftware News Tags: awk, bash, bash script, sed, tip, tips, tricks
One of the more diffcult job, while using the shell, is working with text files to filter their content.
In the following few lines you will find 3 different ways to remove all the duplicate lines from a text file.
First of all, I'll introduce three commands that are available on almost all of the linux distributions, and maybe in all Unix dialects:

uniq
Discard all but one of successive identical lines from INPUT (or standard input), writing to OUTPUT (or standard output).
This is a preview of
3 ways to remove duplicate lines from a text file
.
Read the full post (222 words, 1 image, estimated 53 secs reading time)
Categories: Bash Tip & Tricks, linux, Mac OS X, sysadmin, UNIX TLC, xAppSoftware News Tags: awk, bash, shell, sort, tips, tricks, uniq
Under Ubuntu 8.10, 9.04 and 9.10 the entrypoints for libinfo are part of ncurses.
The libtinfo.so functionality is built into the libncurses.so shared library. So for software that uses the libtinfo.so object you need to install ncurses. I have had to install ncurses because I was trying to build a busybox system on my Ubuntu box and mconf told:
This is a preview of
Ubuntu 9.10: error while loading shared libraries: libtinfo.so.5
.
Read the full post (160 words, estimated 38 secs reading time)
Since iOS 2.x the iPhone operating system comes with the capability to take screen shots from the current running application. This feature sometimes can be very useful, but the gesture to take the screen shots is very simple but it isn't very publicized.

It is possible to use a screensaver as background image in Mac OS X. Simply follow the following steps:
- Set your screen saver to something cool
- Open a new Terminal window
- Type the following command:
# /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background
that's all, now your desktop will show your screensaver.
This is a preview of
A useless trick for Mac OS X: The Desktop Background
.
Read the full post (118 words, estimated 28 secs reading time)
It is possible adding a text string to the login window, for example you can add a welcome message, simply open a new terminal window and type the following command:
# sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Hi man”
This is a preview of
Customizing the login window on Mac OS X
.
Read the full post (231 words, estimated 55 secs reading time)
You can use the clipboard from the directly from the terminal application, Mac OS X gives you two commands:
pbcopy
pbpaste
Naturally pbcopy will copy something on the clipboard and pbpaste will paste something from the clipboard.
This is a preview of
Using the clipboard from the Mac OS X Terminal
.
Read the full post (140 words, estimated 34 secs reading time)
Mac OS X gives you the ability to grab a screenshot of your monitor using the following combination:
Cmd-Shift-3
Also it provides the capability to grab only a portion of your screen using the following combination:
Cmd-Shift-4
On your Mac OS X terminal you can use the open command like a double click.
For example you can issue the following command:
# open .
this command will open the working directory in the finder.
Latest Comments