Newsgroups: oc.general, la.general, misc.misc, comp.unix.shell, comp.unix.programmer, alt.sources.wanted, comp.misc, ca.general
From: cont...@pride386.PP.COM (contest one liners)
Date: 6 Jun 91 22:47:23 GMT
Local: Thurs, Jun 6 1991 6:47 pm
Subject: one-liners !!!
first I wold like to thank all of you who entered this contest! so here they are enjoy, use them but always, don't claim you wrote them *************************************************************************** **** From: da...@dhw68k.cts.com (David H. Wolfskill) ls -lgt /usr/spool/uucp/LCK* From: da...@dhw68k.cts.com (David H. Wolfskill) cut -d: -f1 /etc/passwd | sort | pr -8 -t From: jim@anacom1 (Jim Bacon) $ for i in `uustat -a | grep mapN | cut -f 1 -d' '` > { This is one line since the shell does not act upon it untill the final > uustat -k${i} > } closing brace. I have shown the prompts as they appear on my screen. # From: r...@ttank.ttank.com (Karl Bunch) eval `date '+DAY="%d";FF=\`expr %w \* 3 + 23\`' | sed 's/DAY="0/DAY=" /'`;/bin/cal | sed "s/^\(.\{$FF\}\)\($DAY\)/\1`tput smso`\2`tput rmso`/" [Neat .. on systems that support it. inverse video on the day of the month ] From: zardoz!share!MBParker With enough gross csh hacking, MBParkerRmailDates and grepRmail can be From: uunet!neuron6.jpl.nasa.gov!harry (Harry Langenbacher) Ok, here's the best ones out of my .cshrc: alias dszs 'find . -name "\!{*}*" -ls|sort +6n -7|tail -100|sed -e "s/^[ ]*[1-9][0-9]*[ ]*[0-9]* //" -e "s/^d[-r]........[ ]*/d /" -e "s/^-[-r].\(.\)......[ ]*/\1 /" -e "s/^p[-r]........[ ]*/p /" -e "s/^l[-r]........[ ]*/l /" > /var/tmp/junk.$user.dszs.lis ; ls -l /var/tmp/junk.$user.dszs.lis ; tail -40 /var/tmp/junk.$user.dszs.lis' which at the prompt would be: find . -name "*" -ls|sort +6n -7|tail -100|sed -e "s/^[ ]*[1-9][0-9]*[ ]*[0-9]* //" -e "s/^d[-r]........[ ]*/d /" -e "s/^-[-r].\(.\)......[ ]*/\1 /" -e "s/^p[-r]........[ ]*/p /" -e "s/^l[-r]........[ ]*/l /" > /var/tmp/junk.$user.dszs.lis ; ls -l /var/tmp/junk.$user.dszs.lis ; tail -40 /var/tmp/junk.$user.dszs.lis The above lists all files (not beginning with ".") in &/or under the alias purge 'rm -i \!{*}*.bak \!{*}*.old \!{*}*junk* \!{*}*.~* \!{*}*% \!{*}.*% \!{*}.*.old' which at the prompt would be: rm -i *.bak *.old *junk* *.~* *% .*% .*.old This gets rid of some useless junk in the current directory. In the alias form of the one-liners, the construct " \!{*}" has the purpose From: r...@ttank.ttank.com (Karl Bunch) cd /usr/spool/lp/request;cd 'cat ../default';ls d0* | sed 's/d0/'`cat Cancels all pendings requests on the default printer. We really us cd /usr/spool/lp/request/PRINTERNAME most of the time PRINTERNAME is 'printer' under SCO Xenix. From: r...@ttank.ttank.com (Karl Bunch) uustat -m | sort -r -d +.25 Sorts your UUCP connections by most recent contact. Great if you From: r...@ttank.ttank.com (Karl Bunch) expr "`echo \`echo '_availmem=X' | adb -p "" /xenix\`"/D" | adb -p '' /dev/kmem`" : '[^ ]*\(.*\)' Prints the number of free pages of memory available under SCO Xenix. expr `expr "\`echo \\\`echo '_availmem=X' | adb -p "" /xenix\\\`"/D" | adb -p '' /dev/kmem\`" : '[^ ]*\(.*\)'` \* 4096 Prints the number of free bytes of memory availble under SCO Xenix. *************************************************************************** ***** From: Raymond Butte <uunet!devnet.la.locus.com!raymond> cc -g -o \!^ \!^.c \!:2* >& ,e;grep -v ^$ ,e >,e2;rm ,e; if !(-z ,e2) $EDITOR ,e2 \!^.c It's used like this: cshprompt> ccg foo <args> Where foo.c is a stand-alone C program you wish to compile. [ note.- once in vi type :n then you can flip using [Ctrl ^] or :e # ] From: uunet!auspex!ams (Allan Schwartz) # 411 -- cshell script to give "directory assistance" # cfmt -- filter a c-style comment block throught the fmt filter # closeall -- close all shelltools and cmdtools on an unsuspecting user # colm -- place text (such as /etc/fstab) in columns, ignoring comments # force_cmd -- use the "send_line" feature of the Televideo terminal # illegal -- leave a notice that SCCS/RCS was circumvented # lu -- "look-up" a word in the dictionary # mailbars -- filter to reformat text on the left half of the page # pr1page -- print 1 page of an nroff output file # reverse_cat -- display a file backwords # rot13 -- filter to translate a dirty joke # scroll -- emit 24 linefeeds # set_kernel_word -- shell script to set a kernel variable # sum_column -- awk script to sum up the last column of stdin # sum_du -- awk script to sum up the first column of stdin # textfiles -- decide which files are "text" files # unln_cp -- shell script to change ownership in a writable directory # writable -- script to find the edited files in a development directory From: Peter da Silva <uunet!ficc.ferranti.com!peter> ls -alR ${1+"$@"} | awk '{if (NF==9) h($3) += $5} END {for(i in h) print i,h(i)}' List disk usage by user in the named directories. [this is the portable version ... orignal had "hog" insted of "h" ] From: Wes Morgan <uunet!ukma!morgan> From: zardoz!conexch!root This one reports the number of bytes used in the default dirctrory tree: This one list files 6 across: From: uunet!NCoast.ORG!allbery (Brandon S. Allbery KB8JRR/AA) ls|sed -e h -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' -e 's/.*/mv \& /' -e G|sh -x This renames files off a DOS floppy to lowercase. And yes, I *have* typed -------------------------------------------------------------------------- Esix Tshirts every one else! P.S. Believe it or not ..... Cray called me this morning (better late than never) You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||