New answers tagged utilities
1
If you are using a GUI in the virtual machine, install vmware-tools-esx. If your virtual machine has no GUI, install vmware-tools-esx-nox. Either way, this will pull in all the necessary dependencies.
1
GNU banner
figlet
toilet (tutorial)
As usual, you can read their man pages with the commands man banner, etc.
You might find these scripts useful: reverse the output horizontally, pad the output
2
As of Feb 2013 coreutils includes numfmt:
numfmt reads numbers in various representations and reformats them as
requested. The most common usage is converting numbers to/from human
representation (e.g. ā4Gā ==> ā4,000,000,000ā).
E.g. :
echo 5607598768908 | numfmt --to=iec-i
outputs:
5.2Ti
Various other examples (including filtering, ...
4
When using tr -t command, string1 should be truncated to the length of string2, right?
Isn't that what happened?
abcdefghijklmn
123
Notice which letters are and are not swapped:
the 3ell1r is the s1fest pl13e
'a' and 'c', but not e, f, i, or l, which were in the original (non-truncated) set 1.
Without the -t, you get:
t33 33331r 3s t33 s133st ...
0
Bash and some of its kindred shells have the convenient (( ... )) notation wherein arithmetic expressions can be evaluated.
So as an answer to your third challenge, where both the repeat count and delay between each repeat should be configurable, here's one way to do it:
repet=10
delay=1
i=0
while (( i++ < repet )); do
echo Repetition $i
sleep ...
4
tac is easier to understand in the case it's primarily designed for, which is when the separator is a record terminator, i.e. the separator appears after the last record. It prints the records (including each terminator) in reverse order.
$ echo -n fooabara | tac -s a; echo
rabafooa
The input consists of three records (foo, b and r), each followed by the ...
2
The AVFS filesystem presents a view of the filesystem where every archive file (e.g. /path/to/foo.zip) is accessible as a directory (~/.avfs/path/to/foo/zip# for this example). AVFS provides read-only access to most common archive file formats.
mountavfs
cp -Rp ~/.avfs$PWD/large_file.zip\# extraction_directory
Avfs uses external helpers which can be ...
3
Here's a little shell function that takes care of several archive types.
extract () {
if [ ! -f "$1" ] ; then
echo "'$1' does not exist."
return 1
fi
case "$1" in
*.tar.bz2) tar xvjf "$1" ;;
*.tar.xz) tar xvJf "$1" ;;
*.tar.gz) tar xvzf "$1" ;;
*.bz2) bunzip2 "$1" ;;
...
9
I use atool. It does the job. It works with many, though not all formats:
tar, gzip, bzip2, bzip, lzip, lzop, lzma, zip, rar, lha, arj, arc, p7zip etc.
These compression tools are still needed, though as atool is simply a front end for them.
I particularly like the als command it provides which lists the contents of any supported archive format.
The main ...
0
Actually, the major difference is that curl includes a library (libcurl), and that library is widely used by other applications. wget is standalone.
Top 50 recent answers are included
