Professional Documents
Culture Documents
[ General Edition ]
Helpful Links #1:
http://www.snc.edu/compsci/linux/basic.html | http://mindprod.com/linux.html | http://www.linuxnovice.org/documents/bootcamp.txt # mke2fs /dev/fd0 # mformat /dev/fd0 # eject # kdiskfree Drive space # df # du -s /mydir # fdisk -l # fsck /mnt/remote # e2fsck Format with ext2 Format with FAT Eject CD-ROM tray GUI mount utility Shows disk space usage Space used by directory Disk/partition information Check file system Check ext2 file system
Samba
(www.samba.org)
Redhat location
Shows output of running job (exit with Ctrl-C) # tail -f opfilename # jobs # kill -9 pid # kill -9 %job# List current jobs Kill by process ID Kill by job number
Start a process at a higher then normal priority # nice -1 <appname> # renice 1 <pid> Lower a processes priority
Configuration
# # # # sax sax2 mouseconfig kbdconfig Configure XFree86 v3 Configure XFree86 v4 Mouse setup Keyboard setup
Files
# ls -l # ls -la # ls -l /usr List files in currect directory List hidden files List files in directory /usr Create link dir1->dir2 Copy a file Delete myfile Move myfile Rename 'src' to 'dest' Find file, start at / Ignore case Compare two files Copy disk image Backup file system Restore a dump backup Flush disk buffers Change file timestamp
System
# dmesg # dmesg -c # uname -a # sysreport # uptime Shows all kernel messages Clears kernel messages Display basic system info Create System report Time since reboot
# find / -name file # find / -iname file # diff file1 file2 # dd # dump # restore # sync # touch <file>
Viewing Files
# # # # # # cat myfile more myfile less myfile head myfile tail myfile wc -l myfile Displays file 1 screen at a time Displays using vi Displays file head Displays file tail Line count of file
View reboot log entries in the file /var/log/wtmp # last reboot # reboot Reboot system # halt Halt system # shutdown -h now Turn off system Change Run Level # telinit x x = 1 Single user x = 3 Multi user x = 5 Multi user (graphical login)
Printing
# # # # # lpr lpq lpc printtool cp file /dev/lp0 Add file to print queue Display print queue Line printer control Graphical printer setup Send file to printer
File Permissions
Change file permissions: # chmod 777 myfile Owner/Group/Others rwx rwx rwx
Compressed Files
To uncompress 'mylib.tar.gz' # gunzip -d mylib.tar.gz Which creates 'mylib.tar', and then # tar xpvf mylib.tar If tared & bzip2ed, unpack using: # bzcat file.tar.bz2 | tar xv Or use: # tar xjfv file.tar.bz2 If tared & gziped, unpack using: # tar xvzf file.tar.gz # tar xvzf file.tgz Also # tar xvf filename.tar # tar tvf filename.tar # tar cvf new.tar dirname Zip and rar files: # zip file.zip # unzip file.zip # rar file.rar # unrar file.rar
Text Search
# # # # # # # grep abc myfile grep -I abc myfile grep I am myfile grep $ myfile grep $USER: myfile grep -r abc *.txt fgrep Search for word abc Case insensitive search Search for phrase I am Search Search Recursive search Search
Directories
# mkdir dir1 # rmdir dir1 # pwd Change directory # cd /dir1/dir2 # cd ../dir1 # cd ~ Create directory dir1 Remove directory dir1 Present working directory using Absolute path using Relative path to Home directory
Text Editors
# # # # # # pico myfile.txt kate myfile.txt gedit myfile.txt kedit myfile.txt emacs vi Simple editor Programmers file editor Gnome text editor KDE text editor
Zip a file Unzip a file Create a rar archive Unpack a rar archive
RPM
# # # # rpm rpm rpm rpm -i -q -V -e file.rpm -a | less file.rpm package_name Install an RPM List of packages Package integrity Uninstall package
Help
# # # # # man [command] info [command] command --help whatis [command] apropos keyword Show man pages View info pages Commands own help Brief command info Search whatis DB for string
Processes
# ps -A # pstree # top Shows all processes Displays process trees Process resource usage
Drives
# hdparm Get/Set hard disk parameters Mount floppy drive Unmount floppy drive Low level format floppy
File Conversion
# file filename # ps2png file.ps file.png Finds file type Convert ps to png
Version 0.2.2 Official download site http://www.rebootsoft.com Copyright 2003 Dominic Curran This document is published under the GNU Free Documentation Licence. Visit the GNU web site (http://www.gnu.org) for more information. Linux is a registered trademark of Linus Torvalds. Tux logo is Copyright 1997 Andreas Dilger & Larry Ewing.
Page 2
Console
# clear # ad<tab><tab> # exit [alt]+F1 - F7 Clear screen Auto complete command Close console Swtch to console 1-7
File Viewers
# gv file.ps # xdvi file.dvi # kuickshow Run GhostView Run DVI viewer
Network Utilities
# # # # # # # # # # # # ifconfig ifup -o debug eth0 route hostname -i cat /proc/net/arp dig nslookup netstat tcpdump traceroute ping ypwhich Shows network interface Run interface script Shows routing table Shows IP address View ARP cache DNS lookup utility Name server lookup Network connections Dump network packets Print packet route Ping utility Print name of NIS server
Serial Comms
/dev/ttyS0 /dev/ttyS1 # minicom # mseyon Equivalent of COM1 Equivalent of COM2 Console Comms app XWindows Comms app
# # # # # # # # #
Gnome Desktop
/usr/bin
(www.gnome.org)
Gnome apps directory
Dialers / Modem Management: # rp3 Redhat dialer # wvdial Console dialer # gnomeppp Gnome dialer # kppp KDE dialer # kpppload KDE PPP load monitor # xisp X Windows dialer
Install Gnome theme's from gtk.themes.org # # # # # # # gtksamba gnomba grpm gfde gpasswd ghex gnusniff Configure Samba Samba browser Redhat RPM manager File manager Password manager Hex editor Network packet sniffer
Cron System
# kcron # crontab -e # crontab -l KDE Task Scheduler Edit personal crontab file List content of crontab file
Hardware
Information on reported interrupts: # cat /proc/interrupts # cat /proc/stat # # # # # # # cat /proc/pci cat /proc/ioports cat /proc/cpuinfo cat /proc/devices lsusb lspci kudzu Info from PCI probe Info on IO ports Capabilities of CPU Device numbers List USB devices List PCI devices RH hardware manager
User Basics
# # # # set alias export chsh Change environment variables Create a command alias Change Change current shell Displays the date & time Lookup user info
Edit / list crontab file for another user: # crontab -u [username] -e # crontab -u [username] -l # at # atq # atrm Queue job for execution Examine job queue Remove job from queue
# date # finger
Login
# # # # # # # login logout passwd whoami su su john exit Sign in and switch user Sign out current user Change password Show current user logged in Change to root Change to user john Change back to previous user
X Windows
(www.xfree86.org)
X apps directory X11 config file (Redhat)
# passwd -l <username> # passwd -u <username> # # # # # # groups groupadd groupdel kuser last who
Memory Usage
# free # vmstat # cat /proc/meminfo Shows RAM usage Shows virtual memory Shows memory usage
Start X Windows Primitive X configuration Console mode X configuration X configuration (runs in X) Xserver information Locks X Windows Switches to virtual terminal 1
[ctrl]+[alt]+F1
LDAP
# # # # # ldapwhoami ldapadd ldapdelete gq directory_administrator Add a LDAP entry Delete a LDAP entry Management GUI Admin GUI
Services
Configuring services: # ntsysv Redhat's service manager List all services Add a service Status of all services Start a service Stop a service Restart a service
OpenSSH
Open a secure shell on a remote machine # ssh user@machine Open a secure shell as current user # ssh machine Run a batch of commands on a remote machine # ssh machine 'cd ~; pwd;' Copy 'myfile.txt' to a remote machine # scp myfile.txt machine: Perform copy as a different user # scp myfile.txt user@machine: # sftp Secure File Transfer
Or at the command line (RedHat): # chkconfig --list # chkconfig add <name> # # # # service service service service status-all <name> start <name> stop <name> restart
Power Management
# apmsleep # apm -v # xapm Put machine to sleep/standby state Query APM BIOS Control APM
KDE Desktop
/opt/kde
(www.kde.org)
KDE directory
Version 0.2.2 Official download site http://www.rebootsoft.com Copyright 2003 Dominic Curran This document is published under the GNU Free Documentation Licence. Visit the GNU web site (http://www.gnu.org) for more information. Linux is a registered trademark of Linus Torvalds. Tux logo is Copyright 1997 Andreas Dilger & Larry Ewing.