Notes on Linux Redhat 8.0 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 apps ---- /sbin/apcaccess status Show status of ups /sbin/arp -a Show arp cache 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 baby-gui-game-archive Loads a list of chess games in pgn format cam -s 0 -r 1 Retrieve 1st pic from Kodak DC215 darkstat shows network traffic eog Eye of Gnome, image viewer ethereal Packet Sniffer freewrl test.wrl run VRML files gcc -dumpversion show version of gcc gdb program run gnu debugger with program glxinfo display information about a glx extension and OpenGL renderer gnome-character-map shows all 255 characters gnome-dictionary Gnome dictionary gnome-system-monitor shows processes and system load gnome-terminal Gnome terminal emulation gqview gnu image viewer gqview -f -s display slideshow of files in current directory gtk-gnutella run file sharing import test.png -delay 10 wait 10 seconds then get current window kaddressbook KDE address book kate KDE advanced text editor kcalc KDE calculator kcontrol KDE control centre kdict KDE dictionary kedit KDE text editor kfloppy KDE floppy utility khexedit KDE hex editor kit KDE instant messager kmix KDE mini mixer kmidi KDE midi player knode KDE news reader konsole KDE terminal emulation kpaint KDE paint program kpm KDE process manager ksim KDE system monitor ksnapshot KDE screen capture program kspread KDE spreadsheet program ktimer KDE countdown timer, only accurate to 1 second kword KDE word processor (handles rtf files) locale get locale specific information lynx url run lynx on command line 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 montage -tile 1x3 -geometry 800x1000 file1.jpg file2.jpg file3.jpg fileall.jpg combine 3 pictures into 1 picture and tile vertically mencoder file.mpg -o file.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4 convert mpg to avi mplayer *.avi -loop 25 Loop a video 25 times mplayer checker.avi -vo x11 -loop 0 Use x11 window, loop continuously 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 -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 mms://media.exn.ca/exnmedia/exn20030903-cubeing.asf -dumpstream play a media file from exn.ca and save file newspost -i nntp file -n newsgroup -s subject -a -y post a file to usenet with pars using yenc encoding nroff -man manpage.1 using nroff to display a man page ntpdate -s ntp2.cmc.ec.gc.ca sets correct date and time (must be root) oocalc OpenOffice Calc for spreadsheets (*.xls) oodraw OpenOffice Draw for powerpoint (*.pps) oosetup OpenOffice setup 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 rar a -m5 jones.rar jones.mpg Create jones.rar with maximum compression rar a -v700000 jones.rar jones.mpg Create jones.rar in 700 meg chunks rar e file.rar Extract file rar e -kb file.rar Keep broken extracted files realplay Realplayer plays rm files 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 scid Chess database program scp -r cubeman@24.112.147.60:/home/cubeman/polymake/png/* . transfer files securely ssh cubeman@24.112.147.60 open secure shell tar -xpvf file.tar extract files from tar archive tar -cvf file.tar . make a tar archive file.tar including all files telnet freechess.org 5000 logging into fics using text mode Extract track 02 and creat file gav2_02.mpg (don't try to extract track 0) vcdgear16 -cue2mpg -track02 ga_v2s01.cue gav2_02 w shows who is logged on and what they are doing wget custom.lab.unb.br/pub/lbl/sphere.c Grab a file off the web wine wincube.exe run windows program wincube.exe wish Simple windowing shell xbasic Basic interpreter xbc Basic compiler (needs libtermcap.a) xclipboard Show clipboard xclock Analog clock xcalc scientific calculator for X XFree86 -version display version number X server, currently 4.2.1 xmessage send a windowed message xmtr Trace route xdosemu -home run dosemu in a window and use $HOME directory zip -r aug14_2003_mail.zip * archive everything in current directory commands -------- apachectl start start apache web server apt-get install x install package x e.g. apt-get install rpm-build apt-get install kernel-source bc -l run bc with standard math library bunzip2 file.bz2 uncompress bz2 file cal show calendar cat /proc/ioports show ioports cat /proc/meminfo show memory usage cat /proc/pci show pci devices cat /proc/swaps show swap partitions and files cat /proc/bus/usb/devices show usb devices cat /proc/sys/net/ipv4/neigh/eth0/gc_stale_time show arp cache time cat *.mpg > all.mpg concatenate all mpg files into one file chage -l user show password expiry information chmod 666 file change permissions of file to read/write/executable 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 half 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 df -h show drive space df -lh show drive space on local volumes only dmesg > file capture boot messages to file du -hs data reports on size of data expr 45 + 5 evaluate expression eject eject cdrom eject -t close cdrom factor 100 factor number into primes 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 free -s 1 Show free memory results every second fuser -vn tcp 80 show if there's anything on port 80 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 gzip -9 file.tar gzip a tar file with maximum compression, creates file.tar.gz hdparm -Tt /dev/hdc test hard drive speed hdparm -c1 -d1 /dev/hdc turn on dma and enable 32 bit support, put in /etc/rc.d/rc.local hostname display hostname ifconfig shows all ip addresses last shows last logins and logouts 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 killall mplayer kill all processes named mplayer 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 lp file Print out file lprm -a all flush all print jobs ipcs -a display info on process communication /usr/local/lib/ipsec verify Check install for freeswan (must be root) cp `locate file` . copy file to local directory cp /mnt/c/rrr ~/rrr -r copy directory and all subdirectories isodump shows contents of an iso file ls -author list files by author ls -i list files by inode ls -lh list files in long format but with human readable form 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 -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 -I file.png list all files not matching file.png /sbin/lsusb list all usb devices /sbin/lsmod list kernel modules currently loaded /sbin/lspci show motherboard and card info /usr/sbin/lsof -i list internet open files man ascii information about ASCII man intro an introduction to Linux commands man -a usleep Get all pages for usleep, not just first match mknod /dev/usb/scanner0 c 180 48 make character device for usb scanner mount -l list all mounted volumes and their type netstat -pan show all network activity od -x file show file in hexadecimal paste one.txt two.txt output columns from both files combined together perl -MCPAN -e shell start up CPAN pr lem-rotate.c | lp pipe output from pr to lp printtool configure printer ps -efw | grep defunct look for zombie processes redhat-config-packages configure packages for redhat from cdrom redhat-config-packages --isodir=/mnt/g/ Same but iso's are at /mnt/g/ redhat-logviewer view redhat logs rm -r directory remove directory and all contents rm file remove file (or link) rm -- -file remove a file with a dash in it route show or change the ip routing table 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 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 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 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 stty -F /dev/cua0 get settings for serial port 1 su -m switch to super user but retain environment tar -cvf files make a tar archive time ./size222 times execution of a program trap "echo 'exiting'; exit " 2 break out of script on ctrl-c top shows dynamic info about cpu and memory ulimit -c 100000000 turn on core dumps uname -a displays operating system info uniq names.txt > unique.txt Place unique lines only in unique.txt units converts units uptime shows time since last reboot vsftpd very secure ftp daemon '/usr/sbin/vsftpd &' edit /etc/vsftpd.conf for settings X -version prints out version of X xinetd eXtended internet services daemon '/etc/init.d/xinetd restart' xset s blank set screensaver to blank shell ----- $? variable returns exit status of last command edit .bash_profile add 'export TMOUT= 600' for 10 minute autologout 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 keys ---- 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-atl-plus change to next video mode alt-f2 display run dialog ctrl-alt-D toggle minimize all (gnome) files ----- $HOME/.vimrc start up options for vim /etc/rc.d firewall scripts here /etc/rc.d/rc.local startup script /etc/hosts static table lookup for host names /var/ftp/pub/upload directory for ftp server /var/spool/mail received mail is stored here within browser -------------- http://localhost:901/ run swat to configure samba about:plugins for konqueror, remember to add arguments for xboard _manually_ otherwise it won't work! e.g. xboard -ncp -lgf %s default PS1 is [\u@\h \W]\$