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)
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.
Often I use tar files downloaded from the internet, sometimes these files don't include a directory containing all other files and directories, so it's very tedious removing all files generated by the extraction, but I can use the following command to remove all the files generated:
This is a preview of
How to remove all files generated by an extracted tar archive
.
Read the full post (97 words, estimated 23 secs reading time)
Latest Comments