Guest anon Posted September 13, 2003 Report Share Posted September 13, 2003 : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Killing mp3s playing in the background LOST #401 #!/bin/sh kill $(ps fa | grep 'mp3' | awk '{print $2}') ####[jijojose79 (at) rediffmail.com]########################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Typing CTRL characters at shell prompt LOST #402 To type Ctrl characters at the shell prompt, keep the CTRL key pressed, then press v, followed by the desired character. e.g. to have ^M, press CTRL and then v and m in sequence, without releasing the CTRL key. This, one liner would remove ^M from DOS files: "tr -d '^M' < dosfile > newfile" ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Repeated su logins LOST #403 Do you hate having to type: '/bin/su' at every su login ? Use "suspend" after a su login, and you are back as that user. If you type in "fg" at any time, the su login is brought to the foreground again ... ####[dileep (at) kumarayil.net]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Keyboard shortcut for clearing screen LOST #404 If your terminal type is "linux" (check with 'echo $TERM)', then, typing in "^L" [Ctrl-L] on the shell prompt is enough to clear the screen ... much shorter than typing "clear". It also works on xterm. ####[siddhant (at) rediffmail.com]############################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Finding the version of sendmail on localhost LOST #405 Type in: echo $Z | /usr/sbin/sendmail -bt d0 And you get a response like: ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > 8.10.2 ####[siddhant (at) rediffmail.com]############################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : LILO error messages LOST #406 L : First module loaded, but cannot load second stage. LI : Loading correct. Failed to execute. LIL : Loading and execution ok. Descriptor table not loaded. LIL? : Second module loaded at incorrect address. LIL- : The descriptor table is corrupt. ####[bharathi (at) lantana.tenet.res.in]###################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Useful links for laptops/ mobiles LOST #407 For *nix and Linux solutions for laptops and mobile devices (PDAs, cell-phones, wearables etc.) visit: o Laptops: http://www.linux-on-laptops.com o Mobile Devices: http://tuxmobil.org o Handhelds: http://handhelds.org ####[wehe (at) tuxmobil.org]################################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Installing True Type (TTF) fonts RH-8.0 LOST #408 While running X, just copy the ttf file into $HOME/.fonts and then run the command fc-cache. ####[unmadindu (at) Softhome.net]############################# : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : pinfo - an alternative to info LOST #409 pinfo (Przemek's Info Viewer) is an info/ man page viewer with a colourful ncurses interface with all reference links working (similar to lynx). It supports regular expression searches. URL: http://zeus.polsl.gliwice.pl/~pborys/ ####[unmadindu (at) Softhome.net]############################# : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Monitoring disk usage on your system LOST #410 # cd / # du -S | sort -n > chksize.txt # less chksize.txt ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Extracting columns from databases LOST #411 You can use the 'cut' command to extract certain columns from standard input: for example, say you want the first and third column of a file, where columns are delimited with spaces: cat file | cut -d " " -f 1,3 ####[arnouten (at) bzzt.net]################################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Backing up full partitions to CDs LOST #412 #tar -czvf home-backup.tar.gz /home # Make big tarball #split -b 650m home-backup.tar.gz # Split into chunks #for i in `ls xa*`; do mkisofs -o $i.iso $i; done #for j in `ls xa[a-z].iso`; do cdrecord -v blank=fast speed=2 dev=0,0 $j; done # And burn CD [for joining: cat /path/to/cdrom/xa* >> home-backup.tar.gz ] ####[ajitabhpandey (at) users.sourceforge.net]################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : To know latest kernel version LOST #413 To know the latest version of the kernel (stable, beta ...) type in a console, after getting on line: $finger (at) finger.kernel.org ####[caronte (at) eresmas.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Editting files with long lines in vim LOST #414 When editting files with lines spanning several rows on the screen, it's sometimes desirable to go down or up one row (as opposed to one line). The keys for this are (in command-mode) 'gk' for up and 'gj' for down. ####[arnoutenlst (at) bzzt.net]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Saving sent-mails under mutt LOST #415 By default mutt mailer does not keep a copy of all mails that are sent. To enable this feature, add following to .muttrc set record="=sent-items" ####[dvb (at) users.sourceforge.net]########################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : bash tricks (#xx) LOST #416 Use the $_ alias in bash to save yourself typing the last argument of a command again. For instance: $ ls /path/to/directory $ rm -rf $_ # same as 'rm -rf /path/to/directory' ####[rory.winston (at) telewest.co.uk]######################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Monitoring socket state LOST #417 The command: "$ netstat -na | grep 80 | awk '{print $7}' | uniq -c" will give you a neat summary of the current state of all sockets connected on port 80. (Depending on the output of netstat, you may need to change $7 to be higher or lower). ####[rory.winston (at) telewest.co.uk]######################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Lowercasing filename extensions LOST #418 #!/bin/sh if [ $1 ]; then for f in $(ls *.$1) do lower=$(echo $f | tr A-Z a-z); mv $f $lower; done else echo "Usage: `basename $0` [suffix]"; exit; fi ####[rory.winston (at) telewest.co.uk]######################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : using eval and sed LOST #419 Ever tried: "$foo="abc" ; sed 's/def/$foo/' myFile" and it didnt work? To get sed to substitute using a shell variable, use eval to re-evaluate the expression: $ foo="abc"; eval sed 's/def/$foo/' myFile ####[rory.winston (at) telewest.co.uk]######################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : bash extended regular expression LOST #420 In order to be able to do neat regexes in bash like: $ ls *.+(c|cpp|h|hpp) # show all .C,.CPP,.H,.HPP files Turn on extended globbing with: $ shopt -s extglob ####[rory.winston (at) telewest.co.uk]######################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Improving speed of ssh sessions LOST #421 Compressing your encrypted ssh tunnel improves session speed. Use: `ssh -C <hostname.domainame>' ####[ragu (at) vsnl.com]###################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : A digital clock for your prompt [#2] LOST #422 If bash is your default shell, you can have a digital clock as your prompt, by adding this to your .bash_profile. It has a transparent background and looks good on Eterm/ xterms: PS1='u (at) h[33[36;25m[t][33[32;25m:w$[33[m ' ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Cut Copy and Paste in Emacs. LOST #423 Mark - Ctrl+Space Copy - Esc+W Cut - Ctrl+W Paste - Ctrl+Y ####[dileep (at) kumarayil.net]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Subject: Finding out details of serial ports LOST #424 'setserial -a /dev/ttySn' (where n=0,1 etc) gives you details of serial ports on your system. These include Line, UART, Port IRQ, Baud_base, close_delay, divisor, closing_wait and flags. ####[gdprasad (at) nettlinx.com]############################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Subject: Configuring single user mode under grub LOST #425 title Your_Distro_Linux (2.4.n-nn) single user mode lock root (hd0,0) kernel /vmlinuz-2.4.n-nn ro root=/dev/hdaN s initrd /initrd-2.4.n-nn.img ####[balaji (at) irtt.org]#################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Finding all executables in a dir [#2] LOST #426 #!/bin/sh find . -type f -perm +111 [For current dir: 'find . -type f -perm +111 -maxdepth 1' ####[sacha (at) free.net.ph]################################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : sed hints (deleting a specific line) LOST #427 To remove a specific line from a text file where the line number "x" is known: "sed -e 'xd' /path/to/some/file" ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : sed hints (deleting sequential lines) LOST #428 To remove a range of lines from "x" through "y" of a text file where the limits x and y are known: $ sed -e 'x,yd' /path/to/some/file ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : sed hints (displaying non-matching lines) LOST #429 To display non-matching lines, e.g. remove comments (#) from a listing: $ sed -e '#d' /path/to/some/file Also useful in displaying lines which do NOT have the pattern $ sed -e '{pattern}d' /path/to/some/file ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : sed hints (displaying matching lines) LOST #430 To display only lines having the specified pattern: $ sed -n '/{pattern}/p' /path/to/textfile ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : sed hints (substituting patterns) LOST #431 To substitute one pattern with another globally $ sed -e 's/{pattern1}/{pattern2}/g' /path/to/textfile ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : sed hints (printing within defined limits) LOST #432 To print out a block of text that begins with a line contain- ing "foo", and ending with a line that contains "bar": $ sed -n '/foo/,/bar/p' /path/to/some/file ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Squid log analyzer LOST #433 Install calamaris. URL: http://cord.de/tools/squid/calamaris/ Run the following through cron: cat /var/log/squid/access.log | calamaris -a -f squid -w > /var/www/calamaris/index.htm ####[dileep (at) kumarayil.net]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Return to previous working dir (bash) [#1] LOST #434 If you want to go back to the previous directory you were in, make an alias in .bash_profile/ .bashrc: alias cdp='cd $OLDPWD' The command 'cdp' would take you to the last working directory ####[unmadindu (at) Softhome.net]############################# : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: mpeg encoder in mplayer LOST #435 A little known feature of mplayer (www.mplayerhq.hu) is that it contains a movie-file encoder, 'mencoder'. Try divx enco- ding with 'libavcodec' that comes bundled with it; to shrink larger 'mpeg' files to half-sized 'avi' files. ####[tathagatabanerjee (at) gmx.net]########################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Direct ps and pdf file creation (OpenOffice) LOST #436 You can produce ps and pdf files from openoffice directly. file -> print -> print to file -> choose file type. ####[tathagatabanerjee (at) gmx.net]########################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Finding all users on your system LOST #437 To find out the usernames of all users on your system, try: # awk -F: '$3 > 100 { print $1 }' /etc/passwd ####[mallet (at) efn.org]##################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Displaying syslog output on unused console LOST #438 Edit your /etc/syslog.conf, and append the lines below. [Note: use TABS (not spaces). syslog does not like spaces] # Dump everything on tty9 (if unused) *.* /dev/tty9 ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Useful links for documentation LOST #439 The Linux Documentation Project - TLDP offers a HOWTOs and FAQs about almost every aspect of Linux: http://tldp.org ####[wehe (at) tuxmobil.org]################################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Hard copy with margin for hole punching LOST #440 #!/bin/sh # /usr/local/bin/print # Leaves left margin for hole punching for a binder cat $1 | pr -t -o 5 -w 85 | lpr ####[mdickey (at) thorplus.lib.purdue.edu]#################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Testing/ stepping through your bash script LOST #441 $ bash -x my_shell_script 2> shell_script.log Your bash script runs a bit slower but, every line that is executed and every o/p generated gets logged ... View the log later with any pager or editor. ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Themes for KDE and GNOME LOST #442 Where to download themes for KDE and GNOME ? Visit: http://themes.freshmeat.net/ ####[spcalicut (at) hotmail.com]############################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Linux resources on the net [#1] LOST #443 Wondering how to set up your new hardware, some software or some system resource ? Before you raise a cry for help, visit The Linux Documentation Project [http://en.tldp.org] ####[fred (at) bytesforall.org]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Linux resources on the net [#2] LOST #444 The mother of all GNU/Linux links http://yolinux.com. This has very helpful documentation on various matters, besides having numerous Free/Libre and Open Source Software (FLOSS) links. ####[fred (at) bytesforall.org]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Linux resources on the net [india] LOST #445 Some useful GNU/Linux related Indian mailing lists lists: linux-india-general (at) lists.sourceforge.net linux-india-help (at) lists.sourceforge.net linux-india-programmers (at) lists.sourceforge.net ####[fred (at) bytesforall.org]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: GNU/Linux in education LOST #446 Want to promote GNU/Linux in education? Check out following mailing lists: o schoolforge-discuss (at) schoolforge.net o life (at) mm.hbcse.tifr.res.in ####[fred (at) bytesforall.org]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Blocking incoming mails under sendmail LOST #447 To block mails coming from a particular user in sendmail, edit /etc/mail/access, and add a line like: idiot (at) example.com REJECT Mail from you not allowed Then do: '#/usr/sbin/makemap hash access.db < access' ####[mallet (at) efn.org]##################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Re-initialising personal setup LOST #448 You have made some changes to your personal set up through .profile, .bashrc or .bash_profile. There is no need to log in all over again. To activate the changes, merely do: $source <filename> [where filename would be the changed file] ####[mallet (at) efn.org]##################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Directories-Only ls [#2] LOST #449 The following alias will list just the directories and files are excluded. It will list a directory as a directory even if the directory is a symbolic link. alias dir='ls -Lla|grep ^d' ####[http://www.ugu.com/]##################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub: Finding out your uid/ gid LOST #450 Your uid: 'id -u' and 'id -nu' is same as 'whoami' command Your gid: 'id -g' and 'id -ng' gives literal output of group ####[bish (at) nde.vsnl.net.in]############################### : Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.