Check These Out
The previous alternative dont work (the cd command was missing).
If you want to decompress the files from an archive to current directory by stripping all directory paths, use --transform option to strip path information. Unfortunately, --strip-components option is good if the target files have same and constant depth of folders.
The idea was taken from http://www.unix.com/solaris/145941-how-extract-files-tar-file-without-creating-directories.html
% cat ph-vmstat.awk
# Return human readable numbers
function hrnum(a) {
b = a ;
if (a > 1000000) { b = sprintf("%2.2fM", a/1000000) ; }
else if (a > 1000) { b = sprintf("%2.2fK", a/1000) ; }
return(b) ;
}
# Return human readable storage
function hrstorage(a) {
b = a ;
if (a > 1024000) { b = sprintf("%2.2fG", a/1024/1024) ; }
else if (a > 1024) { b = sprintf("%2.2fM", a/1024) ; }
return(b) ;
}
OFS=" " ;
$1 !~ /[0-9].*/ {print}
$1 ~ /[0-9].*/ {
$4 = hrstorage($4) ;
$5 = hrstorage($5) ;
$9 = hrnum($9) ;
$10 = hrnum($10) ;
$17 = hrnum($17) ;
$18 = hrnum($18) ;
$19 = hrnum($19) ;
print ;
}
This will enable the possibility to navigate in the history of the command you type with the arrow keys, example "na" and the arrow will give all command starting by na in the history.You can add these lines to your .bashrc (without &&) to use that in your default terminal.
Starting with a large MySQL dump file (*.sql) remove any lines that have inserts for the specified table. Sometimes one or two tables are very large and uneeded, eg. log tables. To exclude multiple tables you can get fancy with sed, or just run the command again on subsequently generated files.
I put this command on my ~/.bashrc in order to learn something new about installed packages on my Debian/Ubuntu system each time I open a new terminal
no grep, no perl, no pipe.
even better in zsh/bash4:
$ for i in **/*oldname*; do "mv $i ${i/oldname/newname/}"; done
No find, no grep, no perl, no pipe
List all MAC addresses on a Linux box. sort -u is useful when having virtual interfaces.