Check These Out
Even faster without the need for cut... :)
additionally use "find /etc/cron*" for cronscripts
An advantage is that this doesn't modify remained string at all. One can change {0,1} with {0,n} to drop several columns
Get the first 10 google results form a querry, but showing only the urls from the results.
Use + to search diferent terms, ex: commandlinefu+google .
Generate a changelog between the v1 and v2 tags
Applies each file operator using the built-in test.
$ testt /home/askapache/.sq
/home/askapache/.sq
-a True - file exists.
-d True - file is a directory.
-e True - file exists.
-r True - file is readable by you.
-s True - file exists and is not empty.
-w True - the file is writable by you.
-x True - the file is executable by you.
-O True - the file is effectively owned by you.
-G True - the file is effectively owned by your group.
-N True - the file has been modified since it was last read.
Full Function:
testt ()
{
local dp;
until [ -z "${1:-}" ]; do
dp="$1";
[[ ! -a "$1" ]] && dp="$PWD/$dp";
command ls -w $((${COLUMNS:-80}-20)) -lA --color=tty -d "$dp";
[[ -d "$dp" ]] && find "$dp" -mount -depth -wholename "$dp" -printf '%.5m %10M %#15s %#9u %-9g %#5U %-5G %Am/%Ad/%AY %Cm/%Cd/%CY %Tm/%Td/%TY [%Y] %p\n' -a -quit 2> /dev/null;
for f in a b c d e f g h L k p r s S t u w x O G N;
do
test -$f "$dp" && help test | sed "/-$f F/!d" | sed -e 's#^[\t ]*-\([a-zA-Z]\{1\}\) F[A-Z]*[\t ]* True if#-\1 "'$dp'" #g';
done;
shift;
done
}
This command turns a multi-line file into a single line joined with <SOMETEXT>. To skip blank lines, use:
$ perl -pe '(eof()||s/^\s*$//)||s/\n//g' file.txt
Convert JSON to YAML.
Note that you'll need to have PyYaml installed.
--delete will delete copies on remote to match local if deleted on local
--stats will output the results
-z zip
-a archive
-A preserve ACL
-x don't cross filesystem boundaries
-h human readable
-e specify the remote shell to use