Notes on Linux Geared towards Red Hat 8/Fedora Core 1 intro ----- GNOME GNU Network Object Model Environment for Linux - window manager is mwm, Metacity Window Manager - file manager is nautilus - taskbar is gnome-panel KDE 'K' Desktop Environment for Linux - window manager is kwin - file manager is kfm - taskbar is kicker TWM Tab Window Manager Helpful tips ------------ You can move or resize a window by right clicking on the hortizontal bar at the top or along the perimeter of the window. This is sometimes necessary if you change screen resolutions and the window's widgets move off-screen. apps ---- /sbin/apcaccess status Show status of ups /sbin/arp -a Show arp cache ar x libSDL.a Extract files from an archive arj x test.arj extract files from arj file artsd run the KDE sound server aterm -tr -fg white Run aterm with transparency on and foreground is white aterm -bg black -fg white Run aterm with black background and white foreground aumix adjust volume at the command line baby-gui-game-archive Loads a list of chess games in pgn format bin2iso file.cue -c file.bin Create cue file for file.bin bin2iso file.cue Create iso file using bin and cue file bitmap create a bitmap bitmap -size 400x300 create a bitmap of size 400x300 cam -s 0 -r 1 Retrieve 1st pic from Kodak DC215 cdda2wav -D /dev/cdrom Rip audio cd cdda2wav -D /dev/cdrom -x -t 1+20 -B Rip audio cd with 20 tracks to separate files cdrecord dev=ATAPI -scanbus Check for IDE burners cdrecord-prodvd -checkdrive dev=ATAPI:0,1,0 shows what drive can do cdrecord dev=1,1,0 -checkdrive newer method cdrecord -v -dev=1,0,0 speed=1 -dao -pad -useinfo track-01.wav ... make audio cd from wav file(s) cdrecord -v gracetime=2 dev=ATAPI:/dev/hdd speed=40 -dao driveropts=burnfree cuefile=videocd.cue -eject use cue file to write svcd cdrecord -v gracetime=2 dev=ATAPI:0,1,0 speed=8 -dao driveropts=burnfree cuefile=DATCD.cue -eject use cue file to write audio cd clamscan -r --mbox /var/spool/mail Scan mailboxes for viruses composite -dissolve 50 pic1.jpg pic2.jpg combo.jpg dissolve pic1 into pic2 creating combo convert *.xwd img_%04d.png convert all xwd files to png convert *.jpeg my_movie.mpeg convert jpeg files to mpeg convert -size 640x480 xc:"#000000ff" bl.jpg create a jpg convert -append one.jpg two.jpg combo.jpg append two images top to bottom convert *.jpg -resize 640x480 -bordercolor white -border 640x480 -gravity center -crop 640x480+0+0 %02d.jpg convert all jpg files to 640x480 and preserve aspect ratio cut -b 7-40 text.txt > text-col.txt cut out a column of text from postition 7 to 40 curl dict://dict.org/d:$1 bash script to look up dictionary meaning of a word cvs -v display version of cvs darkstat shows network traffic dos2unix file convert file from dos format to unix format dos2unix -c mac rubik.java convert file rubik.java using mac conversion method dos2unix --version display version of dos2unix dosbox config -writeconf dosbox.conf run dosbox and create dosbox.conf /sbin/dumpe2fs /dev/hdc1 -h show superblock information for partition hdc1 dvdauthor -o test -x dvd.xml create dvd file system in subdirectory test using dvd.xml as a template dvdbackup -M -i/dev/dvd -o/temp create a duplicate of a dvd dvdbackup -i /dev/cdrom -o /mnt/usb1/video/tmp -e 27 create a backup of a dvd with 1 title and 27 chapters dvd+rw-mediainfo /dev/cdrom1 display media info edict word give dictionary entry for word eog Eye of Gnome, image viewer ethereal Packet Sniffer festival --tts file.txt convert text file to speech text2wave test.txt -o test.wav convert text to wav echo hello world | festival --tts use standard input with festival echo "My Message" | wall echo message to all users, kde will show via kwrited echo TEST | tee test echo TEST to stdout and also to file test echo TEST > /dev/stdin | wc echo TEST to stdin and pipe output to wc echo "control alt keycode 101 = SAK" | /bin/loadkeys map the SAK (Secure Attention Key) to keycode 101 ffmpeg -i testo.flv -ab 56 -ar 22050 -b 500 -s 320x240 testo.mpg convert flash video to mpeg ffmpeg -i test.flv -target ntsc-vcd test.mpg convert flash video to vcd compliment mpg ffmpeg -i test.flv -ac 2 -target ntsc-vcd test.mpg convert flash video to vcd with stereo ffmpeg -i test.avi -target dvd -sameq output.mpg convert avi video to dvd compliant mpeg file ffmpeg -i test.wmv -aspect 4:3 -target dvd -sameq output.mpg convert wmv video to dvd compliant mpeg file ffmpeg -i test.avi -target ntsc-dvd -sameq test.mpg -aspect 4:3 convert avi video to ntsc-dvd ffmpeg -i test.wma -acodec vorbis -aq 100 test.ogg convert wma audio to ogg flac audio.wav Lossless audio compression, creates audio.flac freewrl test.wrl run VRML files g++ lesson02.cpp -lSDL -lpthread compile a SDL program gconf-editor edit the gconf system gcc -dumpversion show version of gcc gcc --version show version of gcc gcc test.c -o test -g compile with debugging information gcc -time hello.c -o hello report amount of time taken by each process during compilation gcc -o arm4_hello arm4_hello.c -larm4 compile hello world for arm gdb program run gnu debugger with program gimp file.psd use gimp to read psd files glade-2 glade interface designer glxinfo display information about a glx extension and OpenGL renderer file-roller gnome archive manager gnome-calculator gnome scientific calculator (also called gcalctool) gnome-character-map shows all 255 characters gnome-dictionary gnome dictionary gnome-sound-properties sets sound properties gnome-system-monitor shows processes and system load gnome-pdf-viewer gnome pdf viewer gnome-terminal Gnome terminal emulation gnomeradio Gnome radio program gataxx Gnome ataxx gocr -d -1 -v 1 scan.jpeg > output.txt convert scan.jpeg to text format gphoto2 --port "serial:/dev/ttyS0" --camera "Kodak DC210" --shell access gphoto2 shell to get or delete pictures gphoto2 --port "serial:/dev/ttyS0" --camera "Kodak DC210" -P --speed 38400 download all pictures gphoto2 --auto-detect -P auto-detect camera and download all pictures gqview gnu image viewer gqview -f -s display slideshow of files in current directory gqview --version display version information growisofs --help display help for growisofs grub-install --root-directory=/ /dev/hda reinstall grub gtk-gnutella run file sharing gvim vim with gtk frontend hwbrowser browse hardware identify -format '%w %h\n' *.jpg report the width and height of jpg files in pixels ilbmtoppm test.lbm > test.ppm import test.png -delay 10 wait 10 seconds then get current window img2iso file.img file.iso convert img file to iso (isodump renamed) /usr/bin/internet-druid configure internet setup /usr/sbin/irattach /dev/ttyS1 -d actisys -s run irattach on COM2 isoinfo -i homedvd.img -l check iso file homedvd.img java -jar JNetCube.jar run a jar file java -classpath . test run class file test javac Hello.java compile java program, creates class file java Hello execute java program java -version display java runtime version jsattach --spaceorb /dev/ttyS0 attach a serial line to a joystick device idle python shell with gui akregator KDE news aggregator amarok KDE audio player ark KDE archiving tool k3b KDE CD/DVD burning facility k3b --version display version info kaddressbook KDE address book kaffeine KDE media player kaffeine --version display version info kalarm KDE personal alarm message, email scheduler kalzium KDE periodic table kate KDE advanced text editor kaudiocreator KDE cd ripper kcalc KDE calculator (convert hex to decimal) kcharselect KDE character selector kcontrol KDE control centre kcron KDE task scheduler kdcop KDE graphic DCOP client/browser kdesu KDE su (run program with elevated privileges) kdevelop KDE integrated development environment kdict KDE dictionary kdiskfree KDE diskfree (reports % of use on each partition) kedit KDE text editor kfloppy KDE floppy utility kfontview KDE font viewer kget KDE download manager kghostview KDE ghostview kgpg KDE key management khangman KDE hangman game khelpcenter KDE documentation khexedit KDE hex editor khotkeys KDE hotkeys utility (via kcontrol -> regional -> keyboard shortcuts) note: do not use from konsole kinfocenter KDE info centre (info on ports, irq, dma etc) kit KDE instant messenger klinkstatus KDE web link checker klipper KDE clipboard utility kmahjongg KDE mahjong game kmines KDE mine sweeper kmix KDE mini mixer kmidi KDE midi player kmldonkey KDE frontend for mldonkey kmplayer KDE frontend for mplayer knights KDE chess interface knode KDE news reader knotes KDE version of sticky notes kolourpaint KDE paint program konsole KDE terminal emulation kooka KDE scanner program kopete KDE (another) instant messenger korganzier KDE personal organizer kpackage KDE package installer kpaint KDE (another) paint program kpat KDE patience card games kpm KDE process manager kpdf KDE pdf viewer and printer kppp KDE internet dialer kpoker KDE poker game kpresenter KDE presentation tool kradio KDE radio program krandrtray KDE resize and rotate screen utility krename KDE batch file renamer kreversi KDE othello kruler KDE screen ruler krusader KDE twin panel file editor kscd KDE cd player ksim KDE system monitor ksirc KDE IRC client ksokoban KDE sokoban kstars KDE desktop planetarium ksnapshot KDE screen capture program kspread KDE spreadsheet program ksysguard KDE system guard ksysv KDE SysV init editor kthesaurus KDE thesaurus ktimer KDE countdown timer, only accurate to 1 second ktip KDE useful tips kuickshow KDE image viewer kuser KDE user editor kwin4 KDE connect four kworldclock KDE world clock kview KDE image viewer #2 kword KDE word processor (handles rtf files) quanta KDE web development environment kdialog --display :0 --msgbox "hallo" send a message to all users with kde kmixctrl --restore restore default volumes (needed for tv card) dcop kmix kmix-mainwindow#1 resize 1 1 sets kmix window to smallest size possible dcop kmix Mixer0 mixerName display name of the first mixer dcop kmix Mixer0 setVolume 0 0 set volume on first mixer device 0 to 0% dcop kmix Mixer0 toggleMute 6 toggle mute on device 6 (input line) dcop kmix Mixer0 setRecordSource 6 1 set device 6 as the record source dcop kdesktop KBackgroundIface currentWallpaper 1 return the name of the current wallpaper dcop kmix Mixer0 mixerName return the name of the first mixer kooka -d hp:/dev/usb/scanner0 run kooka for specific device lame sample.wav sample.mp3 convert wav to mp3 lame audio.wav -b 320 audio.mp3 convert wav to 320 kbps mp3 lame -h audio.wav audio.mp2 convert wav to mp2 lame file-in.mp3 -b 128 file-out.mp3 convert mp3 to 128 kbps lame --decode test.mp3 test.wav convert mp3 to wav latex2html sample.tex -image_type gif -split 0 convert latex file to html with one page and gifs links -version display version of links locale get locale specific information locate xyz | grep -e xyz$ locate files ending in xyz locate -r httpd$ locate files ending in httpd lxdvdrip -st=copy backup a dvd lxdvdrip -st=mplayer -lang=en backup a dvd alternate method lxdvdrip -h -lang=en show help lxdvdrip -st=trans_par -lang=en -t=1 parallel transcoding title 1 lxdvdrip -st=vamps -f=2 -bp=1 -t=1 -lang=en title by title (cancel burning t=1,2,3 etc) lynx url run lynx on command line lynx --version display version of lynx mozilla url run mozilla on command line To remove lock file for mozilla: cd /home/cubeman/.mozilla/default/xxxxx.slt (substitute xxxxx for the directory name) rm lock make -f makefile.unix compile using makefile.unix as a makefile makemap -r hash genericstable.db < genericstable Update genericstable makemap hash /etc/mail/virtusertable.db < virtusertable Update virtusertable mail user Send mail to local user mc visual shell for unix type systems can be used for undeleting files on ext2 partitions and viewing contents of rpm files shows numeric and character permissions of files mc --version display version info mc --color display in colour mode mc -a disable use of graphic characters for line drawing mformat a: format a 1.44 disk for msdos /sbin/mkfs.ext2 -cv /dev/sde2 format logical partition on usb drive using ext2 filesystem /sbin/mkfs.ext2 /dev/mmcda1 format logical partition on sd card using ext2 filesystem mkisofs -dvd-video -o /mnt/r1/DVD/homedvd.img /mnt/r1/DVD/ make image for DVD mkisofs -dvd-video -udf -o dvd.iso dvd/ include udf support mogrify -colors 2 pic.jpg reduce pic.jpg to 2 colours mogrify -transparent "#3d8ff3" pic.png make colour #3d8ff3 transparent in pic.png mogrify -modulate 120,120 *.jpeg increase brightness and saturation 20% mogrify -sharpen 10 pic.jpg sharpen pic.jpg mogrify -scale 1024 pic.jpg scale pic.jpg down so that it's width is 1024 pixels montage -tile 1x3 -geometry 800x1000 file1.jpg file2.jpg file3.jpg fileall.jpg combine 3 pictures into 1 picture and tile vertically mencoder -endpos 1:00 VTS_01_1.VOB -o file.vob -oac copy -ovc copy copy first minute of stream to file.vob mencoder file.mpg -o file.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4 convert mpg to avi mencoder file.mpg -o file.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4 -sub subtitle.srt convert mpg to avi and add subtitles mencoder file.mpg -o file.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4 -sub subtitle.srt -ffourcc DX50 convert mpg to avi and use different encoding mencoder dvd://1 -o test.mpg -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=3600 cuts size of dvd to 50% mencoder "mf://*.png" -mf fps=10 -ovc lavc -o file.avi convert a bunch of png files into an avi video mencoder -oac copy -ovc lavc -lavcopts vcodec=mpeg4 -o output.mpg input.avi -of mpeg experimental file conversion mencoder "mf://*.JPG" -mf fps=3 -o test.avi -ovc lavc convert JPG files to avi video at 3 frames per second mencoder input.wmv -oac -ovc lavc -lavcopts vcodec=mpeg2video -of mpeg -o output.mpg convert wmv to mpeg mencoder -vf rotate=2 -o output.avi -oac copy -ovc lavc input.avi rotate input.avi anti-clockwise and create output.avi mencoder -vf rotate=2 -o tempest-new.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg1video tempest.avi rotate and keep mpeg1 encoding mencoder -noskip -vf eq2=1.0:-.8 -o out-file.mpg -oac copy -ovc lavc -lavcopts vcodec=mpeg2video in-file.mpg -of mpeg -mc 0 create inverted video from mpeg2 to mpeg2 mencoder part1.flv part2.flv part3.flv -o all.flv -ovc copy -oac copy -of lavf -lavfopts format=flv combine flv files into one file mencoder test.avi -o out.avi -oac copy -ovc copy copy video stream and one audio stream this was needed since tovid was using the wrong audio stream mencoder test-in.mpg -ovc copy -oac copy -of mpeg -o test-out.mpg -mpegopts tsaf:vbitrate=5800:muxrate=7500 -noskip -mc 0 convert from hitachi mini-dvd to standard dvd (renamed test.iso to test-in.mpg first) mplayer -vo null -vc null -ao pcm:fast:file=audio.wav test.avi extract audio from avi file mencoder dumpstream -o 1.avi -ovc lavc -lavcopts -oac mp3lame -lameopts cbr:br=128 -ofps 15 -vf harddup convert asf to avi midentify file.mpg find information on a video file /usr/sbin/mouseconfig redhat mouse configuration utility necessary to get mouse working in tty mp3splt -s big.mp3 split big.mp3 on silence mp3splt -c big.cddb big.mp3 split big.mp3 based on big.cddb mpgdemux -b output video.mpg remultiplex video mplex -f 8 -M -V -o newvideo.mpg output* mpgtx -d -b test.mpg /mnt/cdrom/celtic.mpg mplex -f 8 -M -V -o output.mpg test.mpg-0.m2v test.mpg-0.mp2 remultiplex celtic.mpg the two commands above fix the problem of "WARN: Skipping sector, waiting for first VOBU..." mpgsplit -2 file.mpg split file.mpg into 2 parts mplayer *.avi -loop 25 Loop a video 25 times mplayer checker.avi -vo x11 -loop 0 Use x11 window, loop continuously mplayer * -shuffle play files in random order mplayer *[Ff]leet* play files with fleet, not case sensitive mplayer -ss 37:00 file play file 37 minutes in mplayer -aid 2 file play audio id 2 (for multi-language files) mplayer -sid 0 file.mpg play subtitles on id 0 mplayer -brightness 20 file.mpg play file with more brightness mplayer -zoom file.mpg play file in window which can be resized mplayer file.mp3 -ao artsd play audio through arts sound server mplayer file.mp3 -ao esd play audio through esd sound server (Enlightned Sound Daemon) mplayer -vo dga file.mpg play file using direct graphics access (must be root) mplayer -vo help list the available video output drivers mplayer -vc help list the available video codecs mplayer -vf help list the available video filters mplayer -ao help list the available audio output drivers mplayer -ac help list the available audio codecs mplayer -af help list the available audio filters mplayer mms://media.exn.ca/exnmedia/exn20030903-cubeing.asf -dumpstream play a media file from exn.ca and save file mplayer -playlist play.pls -ao arts reference urls in text file play.pls mplayer -nocache -playlist mms://wm.cbc.ca/cbcr1-toronto listen to CBC Radio 1 (change r1 to r2 etc) mplayer -nocache -playlist http://microcrud.com/livestreams/crud.asx -dumpstream record stream via asx file mplayer -nocache -playlist http://mfile.akamai.com/8588/live/reflector:57833.asx?bkup=59561 how I listened to us open tennis radio mplayer -nocache -playlist http://mfile.akamai.com/8583/live/reflector:41143.asx?bkup=44574 how I listened to australian open tennis radio mplayer -playlist radio.asx to listen to australian open, wget radio.asx first mplayer -playlist file -dumpstream -dumpfile file.asf record stream and save as file.asf mplayer cdda://1 play audio cd track 1 mplayer dvd://1 play dvd title 1 mplayer dvd://2 play dvd title 2 mplayer -dvd-device /dev/cdrom dvd://1 specify path to dvd device mplayer -dvd-device DVD21 dvd://11 -vf pp=lb play dvd files from directory DVD21 mplayer -ao pcm -aofile radio.wav radio.asf convert asf stream to wav mplayer -ao pcm -aofile week2.wav week2.rm -srate 44100 convert rm to audio cd ready wav file mplayer test.wmv -ao pcm:file=test.wav process audio from wmv to wav file mplayer -vo null -ao wav pcm:fast:file="test.wav" *.mp4 process audio from mp4 to wav file mplayer -demuxer lavf flash9.flv play flash 9 file mplayer -tv driver=v4l:device=/dev/video0:width=640:height=480:norm=ntsc:chanlist=us-cable tv:// watch tv using mplayer mplayer radio://88.7 listen to radio mplayer tempest.avi -vf rotate=1 watch and rotate tempest video by 90 degrees clockwise mplayer tempest.avi -vf rotate=2 rotate video 90 degrees anti-clockwise mplayer -vo aa -monitorpixelaspect 0.5. video.mpg watch video in ascii mode mplayer -vf hue -hue -100 test.mpg watch video in negative colour mplayer -vo xv -vf eq2=1.0:-.8 04.mpg watch video in inverted colour (white<->black) mplayer -mc 2 test.flv will help correct bad sync on some videos mplayer test.mkv -lavdopts skiploopfilter=all:fast will help play mkv files on a slow machine mplayer -vo null -nosound -benchmark test.avi test a file's integrity mplayer test.mpg -vf pp=lb play test.mpg and deinterlace the video mplayer -fs video.mpg play video using full screen mutt -f mailbox load another mailbox with mutt mutt -v show version and compile info mysqldump --opt drupal > drupal.sql backup drupal mysql drupal < drupal.sql restore drupal mysql --version display version of mysql /usr/sbin/netconfig Redhat network configuration utility newspost -i nntp file -n newsgroup -s subject -a -y post a file to usenet with pars using yenc encoding nice -20 test run process test at high priority nmap 192.168.0.* scan ports on 192.168.0.1 through 192.168.0.255 nmap -sV 192.168.0.1 check software versions nmap localhost check your ports nroff -man manpage.1 using nroff to display a man page /usr/sbin/ntpdate -s ntp2.cmc.ec.gc.ca sets correct date and time (must be root) /usr/sbin/ntpdate -u chime.utoronto.ca update time objdump acm.o --section-headers see all the sections in the object file for the module acm oggenc audio.wav -o file.ogg Encode audio.wav to ogg format oocalc OpenOffice Calc for spreadsheets (*.xls, *.ods) oodraw OpenOffice Draw for powerpoint (*.pps, *.odp) e.g. oodraw rubik.pps oodraw rubik.ppt ooffice OpenOffice suite ooimpress OpenOffice create presentations oosetup OpenOffice setup oowriter OpenOffice word processor (*.doc, *.rtf) par c file.par Check parity archive par c *.PAR &> x.txt Redirect standard error to x.txt par r *.par Restore missing files par2 r *.PAR2 Restore missing files using PAR2 par2 c -r10 alpha * Create par2 files called alpha for all files in current directory /sbin/parted /dev/sde run partitioning program on usb drive /sbin/parted -v display version of parted pkg-config libdv --modversion display version of libdv pkg-config glib --modversion display version of glib pkg-config libpng --modversion display version of libpng powwow lambda.moo.mud.org 8888 log onto mud server ps2pdf invoice.ps invoice.pdf convert postscript invoice to pdf radio -S scan radio stations and write radio.fmmap rar a -m5 jones.rar jones.mpg Create jones.rar with maximum compression rar a -m0 -v4700000 abc.rar abc.dat Create dvd sized chunks for file abc.dat no compress rar a -v700000 jones.rar jones.mpg Create jones.rar in 700 meg chunks rar e file.rar Extract files rar e -kb file.rar Keep broken extracted files rar e file.rar file1 /files Extract file1 to /files rar e file.cbr rar can extract cbr files rar e file.rar /mnt/floppy extract to floppy drive rar x file.rar extract files with full path readcd -v dev=1,0,0 f=cd.iso make an iso of a cd readcd -v dev=1,1,0 f=dvd.iso make an iso of a dvd realplay Realplayer plays rm files rec file.wav record a wav file rec -s w -c 2 -r 44100 record a wav file in 16-bit stereo with 44100 samples per second rexxc guess.rex guess compile guess.rex as guess rexx guess.rex execute rexx script guess.rex rsync -vu *.txt holdit update all *.txt files to subdirectory holdit rsync --version show version of rsync sar -n DEV Report network statistics rxpck/s total packets received per second txpck/s total packets transmitted per second rxby/s total bytes received per second txby/s total bytes transmitted per second rxcmp/s compressed packets received txcmp/s compressed packets transmitted scanimage -d hp:/dev/usb/scanner0 --mode color --resolution 100 -x 50 -y 50 > test.pnm Example of using a scanner from the command line, in this case the scan was 198x198 pixels scanimage --list-devices List available scanners scanimage --test Perform a scanner test scanimage --version Display version of scanimage scid Chess database program scp -r cubeman@24.112.147.60:/home/cubeman/polymake/png/* . transfer files securely /usr/bin/sensors show information from motherboard sensors (part of the lm-sensors package) /bin/setserial -bg /dev/ttyS0 displays information on 1st serial port sg_scan -i does a scan of sg devices sha1sum file compute and check SHA1 sort -k2 units.txt > units1.txt sort on 2nd column sox -h shows supported formats sox file.au file.wav Convert au to wav sox file1.wav file2.wav fade t 0 315 3 Make wav file fade out in last 3 seconds sox file1.wav file2.wav speed 2.0 make wav file at double speed sox file1.wav file2.wav trim 1:43:30 6:33 Trim file1 starting time 1:43:30 for 6 min and 33 s sox file1.wav -v 5 file2.wav make file2.wav really loud sox file1.wav file2.wav reverse file2.wav is the reverse of file1.wav sox -w -r 32000 -t ossdsp /dev/dsp3 -t ossdsp /dev/dsp pipe output from /dev/dsp3 to /dev/dsp sox -c 1 -u -r 32000 -t ossdsp /dev/dsp3 dsp.wav record tv audio (via btaudio) spumux spumux.xml < input.mpg > output.mpg add subtitles to an mpg file strings /lib/tls/libc.so.6 | grep GLIBC check version of glibc ssh cubeman@24.112.147.60 open secure shell ssh -vvv test@192.168.0.3 open secure shell with maximum debugging ssh -X cubeman@server /usr/local/bin/xrubik open secure shell with X forwarding enabled and run xrubik on remote machine switchdesk [ desktop name] switch to a different desktop, e.g. kde, gnome, fvwm switchdesk-gnome gui version of switchdesk sysbench --test=cpu run run cpu benchmark talk user talk to a user tar -xpvf file.tar extract files from tar archive tar -z -xpvf file.tar.gz extract files from gz tar archive tar -j -xpvf file.tar.bz2 extract files from bz2 tar archvie tar -cvf file.tar . make a tar archive file.tar including all files tar -tf file.tar list files in file.tar tar -vtf file.tar list files verbosely showing permissions and sizes tar -zcvf file.tar.gz . make a compressed tar archive including all subdirectories tar -jcvf test.tar.bz test make a compressed tar archive using bzip2 compression from file test tar --version display version of tar tclsh hello.tcl execute a tcl script tclkit clock.kit execute a kit file telnet freechess.org 5000 logging into fics using text mode telnet localhost 113 test identd telnet localhost imap test imapd telnet localhost 873 test rsync telnet localhost 25 test sendmail timidity file.mid play midi file timidity file.mid -Ow convert midi file to RIFF wav file timidity file.mid -Ow -o out.wav convert midi to wav and output as out.wav tovid -svcd -full file.avi file.mpg convert file.avi to svcd format tovid -dvd -full file.avi file.mpg convert file.avi to dvd format and use 4:3 aspect ratio tovid -half-dvd -full -fps 24000:1001 file1.mpg file2 convert file1.mpg to 352x480 (half dvd) force 24 fps tovid -dvd -in antipode.avi -out antipode convert avi to mpeg using tovid 0.30 tovid -dvd -in /mnt/cdrom/celtic.mpg -out test -quality 10 make a dvd with highest quality using tovid 0.30 tovid -svcd -in file.wmv -out file -quality 10 mak a svcd wit highest quality using tovid 0.30 makexml file.mpg -out MyDisc generate xml output makedvd -speed 2 -device /dev/cdrom1 -burn MyDisc.xml last part of tovid script (must be root) tput cols display the number of columns tput lines display the number of lines tput home home the cursor tput smcup save the screen tput rmcup restore the screen tput smso set reverse on tput rmso set reverse off traceroute -I torfree.net print the route packets take to network host (using ICMP echo) unshar bsplit.shar unpack a shar file unzip test.cbz unzip works on cbz files unzip -l file.zip list files updatedb update the slocate database usbview usb viewer (reads /proc/bus/usb/devices) userdel -r user Remove a user usermod -l newname change current user's name to newname /home/oldname must be changed as well usermount user mount tool uudeview file Decoder for binary files vcdgear -cue2mpg -track02 ga_v2s01.cue gav2_02 Extract track 02 and creat file gav2_02.mpg (don't try to extract track 0) vcdimager --iso-volume-label="test" track1.mpg track2.mpg ... create bin and cue files for vcd2 (default) vcdimager --iso-volume-label="test" --type=svcd file1.mpg file2.mpg ... create bin and cue files for svcd vcdimager --type=svcd --update-scan-offsets file1.mpg file2.mpg ... vobcopy -I display info on mounted dvd including titles and chapters cdrdao --version display version of cdrdao cdrdao write --device 0,0,0 --driver generic-mmc --speed 8 videocd.cue write vcd w shows who is logged on and what they are doing also shows uptime watch -n 3 w watch output of w updated every 3 seconds wget --version shows version of wget wget custom.lab.unb.br/pub/lbl/sphere.c Grab a file off the web wget http://movies.apple.com/movies/paramount/team_america/team_america_m480.mov grab a trailer off the web wget 192.168.0.1/index.html grab a file from gateway wget ftp://linux.org/file.iso --limit-rate=40k grab a file but limit bandwidth use to 40k per second wget http://something.com/file.txt -O /home/test/file.txt grab a file and save it in /home/test wget -c http://something.com/file.txt resume a download partially completed wget -i file.txt grab a file from url contained in file.txt who -r check current run level wine wincube.exe run windows program wincube.exe wine --version show version of wine wish Simple windowing shell wish clock.tk execute clock.tk (widget toolkit) xbasic Basic interpreter xbc Basic compiler (needs libtermcap.a) xboard -size small run xboard with small board size xboard -size large run xboard with large board size xcalc scientific calculator for X xclipboard Show clipboard xclock defaults to analog clock xclock -digital -update 1 show clock as digital and update each second xdosemu -home run dosemu in a window and use $HOME directory XFree86 -version display version number X server, currently using 4.3.0 http://www.xfree86.org/4.3.0/mouse.html xine -u 0 file.mpg play subtitles on 0 for file.mpg xine -f start xine in full screen mode xls2csv newprice1024.xls > newprice1024.csv convert xls files to csv xmessage send a windowed message xmkmf create a Makefile from an Imakefile xmodmap -pke > old_layout.txt save old keyboard layout xmodmap usapl.txt load apl union keyboard xmodmap -e "pointer = 1 2 3 6 7 4 5" map mouse buttons xmtr Trace route (X My Trace Route) xpdf -z 200% book.pdf view book.pdf with 200% zoom xpdf -v display version of xpdf xrandr -s 0 set video resolution to default (size 0) xrandr -q display all possible video modes xsane --version display version of xsane yum install package install package yum remove package remove package yum update package update package yum update XFree86-tools update package XFree86-tools yum clean clean up yum cache yum list list the installed packages and available packages yum install pdksh install the korn shell yum install gcc-c++ install the c++ compiler yum install xorg-x11-fonts-75dpi xorg-x11-fonts-100dpi install fonts (needed this for xboard on fedora 11) /usr/sbin/zdump -v /etc/localtime | grep 2007 check to see if DST is working zip -r aug14_2003_mail.zip * archive everything in current directory zip -T file.zip test integrity of file.zip commands -------- adduser user add a user apachectl start start apache web server apt-get update resynch the package update files apt-get install x install package x e.g. apt-get install rpm-build apt-get install kernel-source at -f moray-radio.sh 14:00 run moray-radio.sh script at 2 pm atq list user's pending jobs awk --version display version of awk /sbin/badblocks /dev/hdc1 check for bad blocks /sbin/badblocks -s /dev/hdc1 check for bad blocks and show progress /sbin/badblocks -s -c 128 /dev/hdc1 check blocks, show progress, test 128 blocks at a time basename /home/user/test.c returns basename, e.g. test.c bc -l run bc with standard math library /sbin/blkid utility to locate/print block device attributes (e.g. uuid) bzip2 -9 -z cube.txt compress cube.txt using maximum compression bunzip2 file.bz2 uncompress bz2 file cal show calendar cal -V display version of cal cat /proc/bus/usb/devices show usb devices cat /proc/cpuinfo show info on cpu cat /proc/devices show info on device drivers cat /proc/driver/nvidia/version show version of nvidia driver cat /proc/interrupts show info on interrupts cat /proc/ioports show ioports cat /proc/meminfo show memory usage cat /proc/modules show modules cat /proc/pci show pci devices cat /proc/scsi/scsi show scsi devices (includes cdrom, usb devices etc) cat /proc/self/maps show memory map cat /proc/slabinfo show kernel slab allocator statistics cat /proc/swaps show swap partitions and files cat /proc/sys/dev/parport/parport0 show info on parallel port cat /proc/sys/net/ipv4/neigh/eth0/gc_stale_time show arp cache time cat /etc/passwd show all users cat -n .bash_history show bash history cat *.mpg > all.mpg concatenate all mpg files into one file cat test.txt > /dev/lp0 send text directly to parallel port cat /dev/urandom > /dev/dsp listen to static cat test.wav > /dev/dsp listen to a wav file chage -l user show password expiry information chattr +i file set immutable bit for file chfn change finger information /sbin/chkconfig --list checks runlevel information for services /sbin/chkconfig --level 345 sshd on turn sshd on for runlevels 3, 4 and 5 chmod 755 / / should have 755 permisson chmod 700 /root /root should have 700 permission chmod 775 /var/spool/mail /var/spool/mail should have 775 permission chmod 666 file change permissions of file to read/write chmod 700 file read, write, execute by owner only chmod 766 file read, write, but only owner can delete chmod 600 file only owner can read or write chmod --reference file1.txt file2.txt sets permissions of file2 the same as file1 chown user file change owner of file to user Also increase security, don't let users reboot, shutdown, etc e.g. chmod 700 shutdown chmod 700 reboot chmod 700 halt chmod 700 poweroff While we're at it lock down internet programs chmod 700 wget chmod 700 elinks chmod 700 curl chmod 700 lynx chmod 700 vsftpd chmod 700 ftp chmod 700 lwp-download chmod 700 lwp-rget chmod 700 lftpget And let's lock down daemons chmod 700 acpid chmod 700 klogd chown -R user dir change all files to owner user in dir including all subdirectories chgrp -R user dir change all files to group user in dir including all subdirectories cmp -l file1 file2 compare file1 to file2 and print out differences csplit file /OFF/ {*} split a file on OFF as many times as possible date +%W show the week date +%D show date as mm/dd/yy date +%r show time as a 12 hour clock with AM/PM date +%c show date and time with 12 hour clock date "+d %b %Y" show date as "04 JUL 2010" date 06:33 set time to 6:33 am date -s 063012002010 set date to June 30 2010 and time to 12:00 e.g. date MMDDhhmmYYYY date -s "06 30 1200 2010" this will also work dd if=soundfx.wav of=test1.wav bs=1 skip=10564 count=155586 dd if=/dev/zero of=/mnt/cf/swapfile1 bs=1024 count=8192 mkswap /mnt/cf/swapfile1 setup swap file for zaurus on /mnt/cf dd if=disk1.img of=/dev/fd0 write disk image to floppy df -h show drive space df -lh show drive space on local volumes only df -hT show drive space and file system type diff -N file1 file2 > file.patch make a diff file dig +trace cooldomain.com ns @nameserver.com | more check if a nameserver is listed with the root servers dirname /home/user/test.c returns dirname e.g. /home/user dmesg > file capture boot messages to file /usr/sbin/dmidecode > dmidecode.txt DMI table decoder (Desktop Management Interface) du -hs data reports on size of data du -h -c *.zip reports on size of all zip files and give total du -ch *.pdf reports total size of all pdf files /sbin/e2fsck /dev/hda1 check a Linux second extended file system /sbin/e2fsck /dev/sda1 check usb hard drive /sbin/e2fsck /dev/sde1 another example of checking a usb hard drive eject eject cdrom eject -t close cdrom env TZ=EDT date force date to display time in EDT timezone eval 'dircolors .dircolors' set colours for ls dircolors -p >.dircolors create a default profile for colours export TZ=America/Toronto set TZ variable for Toronto time expr 45 + 5 evaluate expression factor 100 factor number into primes /sbin/fdisk /dev/sdb run fdisk on usb 2.0 drive /sbin/fdisk -l /dev/pda run fdisk on usb 1.0 drive to show partitions /sbin/fdisk -v display version of fdisk fdformat /dev/fd0H1440 low level format a 1.44 floppy /sbin/mkbootdisk 2.4.20-20.8smp make a linux boot disk with a label /sbin/mkbootdisk --device /dev/floppy /sbin/mkfs -t ext2 -c /dev/fd0H1440 make a ext2 file system on a floppy find / -perm +111 -name file -print find file with any executable permission set find . -inum -exec rm {} \; find file by inode number and remove find . -type d -maxpdepth 1 list directories find . -type f -perm +1 list executables find . -type f -perm +1 | xargs ls -d list executables and format output find ~ -size 5000k | xargs ls -l list files larger than 5 megs find / -user apache -print find files owned by apache find / -perm -002 -type d find world writeable directories find . -iname readme.txt find file using case insensitive match find / -user username | xargs rm -rf delete all files owned by username find . -size 0 -type f -print0 -exec rm -i {} \; delete all files size zero free -s 1 Show free memory results every second ftp host.org open ftp connection to host.org sftp host.org open secure ftp connection to host.org (shows progress of file transfers) sftp user@host.org open secure ftp connection to user@host.org sftp root@zaurus 4242 open secure ftp connection to zaurus on port 4242 ftpput -v -u user -p password 192.168.0.202 /home/user file upload a file to 192.168.0.202 fuser -vn tcp 80 show if there's anything on port 80 fuser -k /hd1 kill any process accessing /hd1 gethostip cubeman.org Get host ip for cubeman.org gpm General Purpose Mouse server /usr/sbin/gpm -v show gpm version grep [.] mame.txt | wc count literal "." grep " 1"[.] mame.txt | wc count literal "1." grep -n '[,].*[,]' file show lines with more than one comma grep -E [Cc]olou?r show lines with Colour, colour, Color or color grep -i blah * search for blah ignoring case egrep -i 'one.*two' * search for lines containing 'one' and 'two' groups displays the groups a user is in /sbin/grub runs the grub shell /sbin/grub --version display version of grub shell pgrep sendmail check if sendmail is running gzip -9 file.tar gzip a tar file with maximum compression, creates file.tar.gz gzip -9 *.mpeg gzip a group of mpeg files gzip -d file.gz decompress file.gz /sbin/hdparm -Tt /dev/hdc test hard drive speed /sbin/hdparm /dev/hda show concise information /sbin/hdparm -I /dev/hda show detailed information including serial number /sbin/hdparm -c1 -d1 /dev/hdc turn on dma and enable 32 bit support, put in /etc/rc.d/rc.local host blah.org lookup ip address for blah.org hostname display hostname hostname maxhost.org change hostname /sbin/ifconfig shows all ip addresses /sbin/ifconfig eth0 mtu 1452 sets value of mtu /sbin/ifconfig -a show all interfaces even if down /sbin/ifconfig plip0 down shut down plip0 /sbin/ifconfig plip0 192.168.0.101 pointopoint 192.168.0.100 up setup plip between two computers ispell file check spelling of file ispell -a check spelling of standard input (gives suggestions) e.g. at the prompt $ ispell -a $ type words here /sbin/ksyms display exported kernel symbols last shows last logins and logouts last -a list hostname in last column last -d -f wtmp.1 shows older logins with ip addresses ldconfig configure dynamic linker run-time bindings note: do this after compiling and installing new libs located in /sbin ldd programs display a list of the shared libaries each program requires init n set runlevel n 0 - Halt 1 - Single-user mode 2 - Not used (user-definable) 3 - Full multi-user mode 4 - Not used (user-definable) 5 - Full multi-user mode (with an X-based login screen) 6 - Reboot (tip: If X messes up you can go init 3 then back to init 5 via ssh) jobs list current jobs kill -l display a list of signals kill -s 4 18564 send signal (illegal instruction) to process 18564 this should force a core dump killall mplayer kill all processes named mplayer killall -9 mplayer kill mplayer with SIGKILL killall -9 gconfd-2 kill gconfd-2 (had to do this to get gnome apps to work) killall bonobo-activation-server Had to kill the bonobo-activation-server to get realplay to work killall mingetty reset terminal services /usr/sbin/kudzu detects new or changed hardware ln -s /home/cubeman/j2sdk_nb/j2sdk1.4.2/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so libjavaplugin_oji.so create a symbolic link to libjavaplugin_oji.so in /home/cubeman/.mozilla/plugins so that java will work in mozilla 1.5 ln -s /usr/java/j2re1.4.2_05/plugin/i386/ns610-gcc32/libjavaplugin_oji.so needed so that java will work for firefox 1.5 ln -s /var/www/maxhost/alex public_html make a link to web files in user's home directory ln -sf /usr/share/zoneinfo/America/Toronto /etc/localtime set timezone ln -sf scd0 /dev/dvd make a link from scd0 to /dev/dvd ln -sf scd1 /dev/dvd make a link for 2nd dvd player /usr/sbin/lpc status Displays the status of one or more printer or class queues lp file print out file lp -d canon file print out file to destination canon lprm -a all flush all print jobs lpq show all print jobs lp -o cpi=17 file print file using 17 characters per inch ipcs -a display info on process communication /usr/local/lib/ipsec verify Check install for freeswan (must be root) /sbin/iptables -nvL Check rules for iptables /sbin/iptables -A INPUT -s 211.157.98.25 -j DROP block 211.157.98.25 cp `locate file` . copy file to local directory cp /mnt/c/rrr ~/rrr -r copy directory and all subdirectories cp -v *Concerto*09* /mnt/usb1 when copying files to a usb device like an mpeg3 player it's useful to see that each file successfully copies **Probably best to umount usb device before disconnecting cable** cp test.txt{,.bak} copy test.txt to test.txt.bak isodump shows contents of an iso file lastlog examine lastlog file ls -1 list files in a single column ls -author list files by author ls -i list files by inode ls -lh list files in long format but with human readable form (time is only displayed for files younger than one year) ls -l --full-time show all time and date information ls -Slh list files sorted by size ls -lt list files in long format sorted by time ls -rt list files sorted by time in reverse order ls -lR / | grep -i .jpg list files with jpg, JPG, Jpg, etc extension ls | grep -i hamburg list file names containing hamburg ls -Slh | awk '{print $5}' parse 5th field ls | awk '{print $NF}' parse last field ls | grep -i juno list files with juno, not case sensitive ls *[Jj]uno* list files with Juno or juno ls *[1-2][0-9][0-9]* list files containing numbers 100 to 299 ls *[[:digit:]]* list files containing a number ls -Ifile.png list all files not matching file.png ls | wc -l list all files and show count ls -ld /proc/*/fd/* 2>&1 | fgrep '(deleted)' list all deleted files held open by processes ls --color=never list files without using colours ls -d h* list directory entries instead of contents, and do not dereference symbolic links ls | head -n5 list only the first 5 lines ls ~- list the previous directory /sbin/lsmod list kernel modules currently loaded /usr/sbin/lsof -i list internet open files /usr/sbin/lsof -v display version of lsof /usr/sbin/lsof | grep /mnt show open files on /mnt /usr/sbin/lsof | grep /dev/dsp show open files on /dev/dsp /usr/sbin/lsof | grep /dev/ttyS show if serial ports are in use (lircd uses this device) /sbin/lspci show motherboard and card info /sbin/lspci -vv show all info (works best as root) /sbin/lspci -vv | grep HCI look for all types of Host Controller Interfaces /sbin/lsusb list all usb devices man ascii information about ASCII man intro an introduction to Linux commands man -a usleep Get all pages for usleep, not just first match man -k vi Find all man pages which refer to vi man -s 2 time display entry on time from section 2 man sane-rts8891 list info on sane backend for rts8891 based scanners /sbin/mkdosfs -s 8 -F 32 /dev/sdb1 creates a FAT32 partition with a cluster size of 4KB regardless of the partition size mkdir /hd1/pics/{dir1,dir2,dir3} create /hd1/pics/dir1 /hd1/pics/dir2 /hd1/pics/dir3 mknod /dev/usb/scanner0 c 180 48 make character device for usb scanner mktemp test.XXX make a temp file test with a random number extension mount -a mount all filesystems found in /etc/fstab mount -l list all mounted volumes and their type mount -t iso9660 -o loop -vv test.iso /mnt/g/ mount iso file test.iso at /mnt/g/ mount -o loop file.img /mnt/somewhere mount img file file.img at /mnt/somewhere mount -o loop -t udf UDF_Volume /mnt/r1 mount udf image at /mnt/r1 mount -t ntfs /dev/sda1 /mnt/ntfs mount ntfs partition at /mnt/ntfs mount /dev/sda1 /mnt/usb1 mount usb hard drive mount /dev/sda1 /mnt/usb1 -o umask=0000 mount usb hard drive so users can read and write files (this is only needed for non-linux filesystems) mount /dev/sdb1 /mnt/usb2 mount 2nd usb device mount /mnt/floppy mount disk in 1st floppy drive /dev/fd0 mount /dev/sdf1 /mnt/usb2 mount flash drive (note that there is always a number at the end of the device name, e.g. /dev/sdb1, /dev/sdf1 etc) netstat -pan show all network activity newaliases rebuild /etc/aliases.db (needed after editing /etc/aliases ) nohup fics run fics so that it's immune to hangups od -x file show file in hexadecimal od -v -An -txC file.bin > file.txt dump binary file to text representation of hexadecimal passwd user set up password for user passwd -l user lock account for user paste one.txt two.txt output columns from both files combined together patch file file.patch patch a file php -v display php version php -m display modules perl -MCPAN -e shell start up CPAN perl Makefile.PL execute a perl makefile ping -c 5 test.org wait for 5 reply pings from test.org ping -V display version of ping pkill -KILL -u user kill all the processes of a user pmap -d pid display information about memory mappings for pid (process id) pr lem-rotate.c | lp pipe output from pr to lp printf '%d\n' 0x1e print decimal value of 0x1e printtool configure printer ps -efw | grep defunct look for zombie processes ps -efw --cols 200 run ps with screen width 200 ps -efw | cat run ps with no truncation at all ps -u nobody show processes run by usr nobody pstree show a tree of processes python -V display version of python python test.py run a python program pydoc -g display documentation for python modules qsopcast qt frontend for sopcast quota user display disk usage and limits for user redhat-config-date configure date and time redhat-config-keyboard configure keyboard for redhat/fedora redhat-config-kickstart configure kickstart files redhat-config-mouse configure mouse for redhat/fedora redhat-config-network configure network redhat-config-packages configure packages for redhat from cdrom redhat-config-packages --isodir=/mnt/g/ Same but iso's are at /mnt/g/ redhat-config-printer configure printer redhat-config-proc kernel tuning for redhat-fedora redhat-config-rootpassword configure root password redhat-config-security-level configure firewall redhat-config-services configure services redhat-config-soundcard configure sound card redhat-config-users configure users redhat-config-xfree86 configure display settings redhat-logviewer view redhat logs rename .jpeg .jpg *.jpeg reset reset terminal settings rm -r directory remove directory and all contents rm file remove file (or link) rm -- -file remove a file with a dash in it rm -i *.txt remove files with confirmation rm -f -r ". ." * remove all files plus strange file ". ." /sbin/rmmod usb-storage remove module usb-storage /sbin/insmod usb-storage load module usb-storage (had to reload when I added the hub) /sbin/insmod -f usbide force load of module usbide (needed this to get BF-2001 to work) /sbin/insmod soundcore load module soundcore (had to reload when trying to update oss drivers) /sbin/insmod es1371 load module es1371 (had to reload to get ensoniq card to work) /sbin/insmod parport_pc io=0x378 irq=7 load module parport_pc and use irq 7 /sbin/modinfo bttv display info about a module /sbin/modinfo -l bttv display license for a module /sbin/modprobe -c show current configuration /sbin/modprobe ehci-hcd necessary to get usb 2.0 card to work /sbin/modprobe i2c-proc necessary to read sensors (check sensors.txt) /sbin/modprobe plip necessary to use plip (Parallel Line Internet Protocol) /sbin/route show or change the ip routing table /sbin/route del 192.168.0.100 plip0 remove a route to plip0 /sbin/runlevel display runlevel rpm -e tux-2.2.7-3 remove tux rpm -qa List which packages are installed rpm -qa | grep tux see if tux is installed rpm -qf /bin/ls show which package contains /bin/ls rpm -qlif /usr/bin/nsupdate show which package contains /usr/bin/nsupdate with more information rpm -e --nodeps mysql remove mysql without checking dependancies rpm -U package upgrade package rpm -i --force coreutils force reinstall of coreutils rpm2cpio package.rpm | cpio -idv extract files from rpm without installing cd /var/lib/rpm Fix stale locks when rpm gets stuck rm -f /var/lib/rpm/__db* rpm -rebuilddb Rebuild rpm database /sbin/runlevel show previous and current runlevel sed '15,329 w ggg' hhh > /dev/null write line range 15-329 from file hhh to ggg seq 1 10 output sequence from 1 to 10 seq -s\ 1 1000 output sequence from 1 to 1000 delimited by space /sbin/service --status-all show status of all services /sbin/service apcupsd stop stop apcupsd (must stop apcupsd to run apctest) /sbin/service crond stop stop crond daemon /sbin/service cups restart restart cups (common unix printer system) /sbin/service gpm restart restart gpm (general purpose mouse server) /sbin/service httpd restart restart web server /sbin/service lircd restart restart LIRC daemon /sbin/service mysqld restart restart the mysql server /sbin/service network restart restart network /sbin/service smb status check status of smbd and nmbd /sbin/service sshd stop stop sshd /sbin/service syslog status show status of system logger (must be root) /sbin/service syslog restart restart syslogd and klogd /sbin/service vsftpd restart restart vsftpd (very secure ftp daemon) /sbin/service xinetd restart restart the super server shopt -s cdspell turn on cdspell, will correct misspellings with cd command shopt -s extglob turn on extended pattern matching facilities /sbin/shutdown -r -t 0 now shutdown and reboot system immediately /sbin/shutdown -h -t 0 now shutdown and halt immediately sleep 5 ; beep sleep 5 seconds then beep smbclient \\\\192.168.0.10\\CA open a link to my windows box e.g. cd "Program files\winboard" get cubebox cubebox smbpasswd -a cubeman add smb user cubeman stat -c %a file display numeric permissions for file strace command > strace.txt 2>&1 trace system calls and signals and save to strace.txt stty -F /dev/cua0 get settings for serial port 1 stty -a show terminal settings stty -F /dev/ttyS0 115200 set 1st serial port to 115200 su -m switch to super user but retain environment /sbin/swapon /mnt/g/SWAP enable files or devices for swapping tail -f /var/log/secure check secure in real time tail -c 10000 /var/mail/cubeman show last 10000 characters of mail tracepath host.com traces path to a network host discovering MTU along this path /usr/sbin/tcpdump -i eth1 show traffic on eth1 /usr/sbin/tcpdump port 80 show traffic for port 80 /usr/sbin/tcpdump host 69.36.243.188 -X -s 128 watch traffic from fics showing packets in hex and ascii showing up to 128 bytes /usr/sbin/tcpdump --version show version time ./size222 times execution of a program { time ls; } 2> time.output direct output of time to file time.output top shows dynamic info about cpu and memory top --version display version touch file Update the access and modification times of file trap "echo 'exiting'; exit " 2 break out of script on ctrl-c type -a command return how command would be interpreted ulimit -c 100000000 turn on core dumps ulimit -v 50000 limit virtual memory to 50 megabytes ulimit -v unlimited set no virtual memory limit ulimit -a show all limits uname -a displays operating system info uniq names.txt > unique.txt Place unique lines only in unique.txt units converts units units --version display version of units uptime shows time since last reboot uptime -V display version of uptime vi /proc/2678/status check status of pid 2678 vi -r list recoverable files vsftpd very secure ftp daemon '/usr/sbin/vsftpd &' edit /etc/vsftpd.conf for settings whatis png search the whatis database for png whatis word search the whatis database for word X -version prints out version of X xev print contents of X events xinetd eXtended internet services daemon '/etc/init.d/xinetd restart' x11perf -all X11 server performance test program, run all tests xfontsel select an X11 font xlsfonts list fonts available for X xset b off turn off beeps xset s blank set screensaver to blank xset m set mouse speed to default settings xvinfo display X-Video extension adaptor information xvidcap --cap_geometry 400x240 prepare to capture a window of size 400x240 xvidcap --cap_geometry 1024x768 --fps .5 capture screen every 2 seconds bash shell ---------- . file execute file in current shell rather than a subshell $? variable returns exit status of last command edit .bash_profile add 'export TMOUT= 600' for 10 minute autologout export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" adjust where the pkg-config directory is export LD_ASSUME_KERNEL=2.2.5 hack for older software export PATH=$PATH:/home/cubeman/bin add to the path set -o noclobber set shell so files aren't overwritten, e.g. echo X > test.txt will not overwrite file test.txt set +o noclobber turn clobber back on setterm -dump 1 dump screen of tty1 ctrl-a move to beginning of line ctrl-c terminate command ctrl-e move to end of line ctrl-l clear screen ctrl-r searches history ctrl-u cut line ctrl-x delete entire line, bs = backspace ctrl-z suspends current task alt-. display last argument for last command alt-l make word lowercase alt-u make word uppercase fc 1 10 fix commands 1 through 10 bg jobspec puts task in the background fg jobspec puts task in the foreground alias show current aliases alias abc='echo abc' set up alias for abc unalias abc remove alias for abc bash --version display bash version cd - return to previous directory #time prefacing commands with # turns them into comments !79:p print out command 79 but don't execute bind '"\e[24~": history-search-backward' bind the history-search-backward command to function key f12 echo $- display state of bourne shell flags echo x{1,2,3} example of brace expansion, outputs x1 x2 x3 reset PS1 to default PS1="[\u@\h \W]\$ " STR="hello"; echo $STR set a variable unset STR unset a variable STR=$(locate tclock.c) similar to backticks zshell ------ ls test<8-23> list filenames test8 through test23 inclusive rm ./*(D.L0) delete all empty files X shortcuts ----------- shift-numlock toggle mouse emulation with keypad (see also kde shortcuts) kde shortcuts ------------- ctrl-esc look at processes ctrl-alt-esc kill the window you click on next ctrl-alt-f1 go to text screen 1 ctrl-alt-f7 go to graphics screen 7 ctrl-alt-backspace kill session ctrl-alt-delete logout/shutdown ctrl-alt-plus change to next video mode ctrl-alt-minus change to previous video mode ctrl-alt-l lock session ctrl-atl-n open new konsole ctrl-alt-pause Secure Attention Key or SAK (needs to be enabled) ctrl-tab walk through desktops alt-f1 display kde menu alt-f2 display run dialog (type logout here to logout) alt-f3 display windows operation menu alt-f4 close window alt-f12 toggle mouse emulation with keypad use keypad arrow keys (not numpad) to move mouse pointer use keypad enter key for left-click press del followed by ins for right-click (kde 3.4.2 this was changed to ctrl-shift-numlock) alt-backspace delete line alt-tab walk through windows ctrl-alt-D toggle minimize all ctrl-alt-V show klipper menu ctrl-alt-R manually invoke action on current clipboard ctrl-print desktop screenshot shift-left cycle through konsole sessions shift-backspace delete entire line in konsole keys within mplayer ------------------- > next song SPACE toggle pause v toggle subtitles / and * adjust volume 1 and 2 adjust contrast. 3 and 4 adjust brightness. 5 and 6 adjust hue. 7 and 8 adjust saturation h and k change channel (k = increment, h = decrement) I shows filename keys within lynx ---------------- ESC help menu ^N scroll down files ----- $HOME/.bashrc called by .bash_profile $HOME/.bash_history bash history file $HOME/.bash_profile start up file for bash (executed for ssh login) $HOME/.dircolors configuration file for dircolors (also called .dir_colors) $HOME/.gconfd/saved_state had to delete this file one time due to a gnome error $HOME/.mail_aliases mutt address book $HOME/.muttrc mutt configuration file $HOME/.vimrc start up options for vim $HOME/.wine directory for wine files $HOME/.Xauthority store credentials used by xauth for authentication of X sessions $HOME/.Xdefaults defaults file for X (filename must be set by XENVIRONMENT) $HOME/.kdetest/share/apps/kaffeine/playlists kaffeine playlists are stored here (or .kde) e.g. Techno.kaffeine which is an xml file $HOME/.kde/share/config/khotkeysrc configuration file for khotkeys $HOME/.kdetest/share/config/kmixctrlrc start up file for kmixctrl $HOME/.kde/share/config/KWeatherServicerc configuration file for kweather $HOME/.kde/share/config/weather_panelappletrc additional configuration file for kweather $HOME/.kde/share/wallpapers downloaded wallpapers go here $HOME/.kde/share/apps/kradio/stations.krp configuration file for kradio $KDEDIR/lib/pkgconfig directory for pkgconfig $KDEDIR/share/autostart kde directory for applications to autostart $KDEDIR/share/config/klipperrc configuration file for klipper $KDEDIR/share/wallpapers directory for kde wallpaper /boot kernels stored here /boot/grub/grub.conf configuration file for grub /etc/aliases alias file for sendmail /etc/crontab tables for driving cron /etc/cron.hourly directory for scripts to run hourly /etc/cron.daily directory for scripts to run daily /etc/cron.weekly directory for scripts to run weekly /etc/fstab static information about filesystems /etc/group groups are set up here /etc/hosts static table lookup for host names /etc/hotplug/blacklist Listing a module here prevents the hotplug scripts from loading it /etc/inittab describes processes that are started at bootup /etc/inputrc describes shell commands /etc/ld.so.conf describes where the libraries are for linker /etc/logrotate.conf configure logrotate /etc/lxdvdrip.conf configuration file for lxdvdrip /etc/modules.conf configuration file for loading kernel modules /etc/modprobe.conf configuration file for modprobe /etc/mtab informaton about mounted filesystems /etc/ntp.conf configuration file for ntp /etc/resolv.conf resolver configuration file /etc/securetty lists ttys from which root can log in /etc/services network services file /etc/sudoers configuration file for sudoers /etc/sysctl.conf preload/configuration file /etc/apcupsd/apcupsd.conf configuration file for apc ups daemon /etc/cups/printers.conf printer configuration file for cups /etc/httpd/conf/httpd.conf configure apache /etc/init.d directory containing bash scripts for controlling services /etc/init.d/hplip restart restart hplip (Hewlett-Packard Linux Imaging and Printing project) /etc/init.d/cups restart restart cups /etc/mail/genericstable reverse-map local users for out-bound mail /etc/mail/virtuserstable maps virtual addresses into real addresses /etc/mail/local-host-names all aliases or virtual domains should be here /etc/mplayer/mplayer.conf system wide configuration file for mplayer /etc/profile.d/java.sh java setup file /etc/rc.d firewall scripts here /etc/rc.d/rc.local startup script for local /etc/rc.d/init.d/httpd startup script for apache /etc/ssh/sshd_config configure sshd /etc/rc.local local system initialization /etc/rc.sysinit more system initialization /etc/sysconfig/network set hostname here /etc/sysconfig/network-scripts/ifcfg-eth0 network setup /etc/vsftpd/vsftpd.conf configure vsftpd /etc/xinetd.d/daytime configure daytime service /etc/X11/XF86Config configure X Server (including mouse) /lib/modules/2.4.22-1.2199.nptlsmp/build/drivers/usb source code for usb drivers, e.g. scanner.c /usr/local/etc directory for configuration files (standard configure) /usr/local/games directory for games /usr/local/include directory for include files /usr/local/lib directory for libraries /usr/local/lib/pkgconfig directory for package config /usr/libexec/geomview directory for geomview modules /usr/share/backgrounds directory for backgrounds /usr/share/pixmaps directory for program icons /usr/share/terminfo directory for compiled terminfo entries /var/cache/yum/updates-released/packages yum caches packages here /var/ftp/pub directory for ftp server /var/log/cups/access_log log file for cups /var/log/prelink.org log file for prelink /var/spool/mail received mail is stored here /var/spool/clientmqueue /var/www/cgi-bin cgi-bin scripts echo 1 > /proc/sys/net/ipv4/ip_forward turn on ip forwarding echo 0 > /proc/sys/net/ipv4/ip_forward turn off ip forwarding variables --------- $DISPLAY shows :0 $XAUTHORITY sets which file is for .Xauthority $XENVIRONMENT sets which file sets the defaults for X within browser -------------- http://localhost:901/ run swat to configure samba http://localhost:631/admin configure cups http://127.0.0.1:4080 configure mldonkey ctrl-backspace delete line in URL window about:plugins about:config konqueror specific ------------------ for konqueror, remember to add arguments for xboard _manually_ otherwise it won't work! e.g. xboard -ncp -lgf %s fish://user@domain.com browse files remotely within konqueror media:/ show mounted devices man:/mke2fs show man page for mke2fs file.iso in konqueror right-click on iso file activates k3b automatically