Basic Linux Template v1.1 by Adrian Mikeliunas http://go.to/Linux1 mail:
[email protected] • • • • • • •
Linux (linn-ucks) is a free Unix like Operating System originally created by Linus Torvalds with the assistance of developers around the world. Linux Is Not UniX. (www.kernel.org) Developed under the GNU General Public License, the source code for Linux is freely available to everyone. (www.gnu.org) There is more than one command to do the same action If not familiar with a command, check the help file first Commands use many parameters Words in brackets [ ] are replaced by your entry. Upgrade your computer: Install Linux Today!
LOGIN & LOGOUT Since Linux is a multi-tasking and multi-user Operating System, you need to provide a userid (account name) at the login prompt and a password in order to gain access to your default login shell (bash by default.) During Linux installation, you were asked to enter a password for the superuser account: root. Use only this account when installing new software from trusted sources or performing system maintenance or administration. (Once logged in, depending on your security settings, you can also run as another user with the "su" command.)
whoami displays current active user su [account] run commands as specified account exit or logout terminate the current session passwd changes the current user’s password As an administrator (root), you can do additional tasks: useradd –m [account] creates a new user account and home directory usermod [account] modify a user account userdel [account] deletes a user account groupadd [group] creates a new group of users groupmod [group] modify a group groupdel [group] deletes a group HELP man [command] displays help about the command, press Q to quit info [command] displays help about the command, press Q to quit [command] –help displays built-in help summary or syntax, if any To list all the Linux commands starting with a letter, type: [a..z] Tab Tab The default bash shell is so smart that if you press Tab it will type the rest of the file name or directory for you. It also remembers the commands you typed. Use the Up or Down keys to review your command history.
LINUX FILE SYSTEM From the only root of the Linux system you will find several directories: bin binaries, program files boot system boot files: LILO, kernel and module map dev system devices: all your hardware definitions etc most of the text configuration files home user directories, also FTP and Apache directories lib system libraries lost+found where recovered files go mnt suggested mount point for external drives and directories opt optional software proc virtual file system, shows kernel status root super user personal directory sbin system programs tmp temporary files only usr user programs, documentation (/usr/doc) var variable data, system logs, print jobs You can navigate and modify files and directories with these commands: pwd print working directory, shows you where you are ls –l [directory] directory list of files, also dir, vdir cd [directory] - change working directory mkdir [directory] create a new directory rmdir [directory] removes a directory chattr +-= [ASacdisu] [filename] changes file or directory attributes Ex. chattr +u myfile makes file undeletable chmod [a/u/g/o] +-= [rwx] [filename] sets file permissions (modes) who: all user group owner, modes: read write executable Ex. chmod u+x myfile adds user execute chown [account] [filename] changes ownership of a file. chgrp [group] [filename] change group cp [source] [dest] copy files mv [source] [dest] move or rename files more or less [filename] display a file one page at a time, Q quits cat [filenames] concatenates a list of files vi, emacs, pico, joe [filename] edit filename INSTALLING SOFTWARE cpio --extract [filename.cpio] decompress an archive gunzip -d [filename.gz] decompresses an archive rpm –install [filename.rpm] install a Red Hat Package tar -xvf [filename.tar] untar an archive tar -xzvf [filename.tar.gz] untar a compressed archive
PROCESS MANAGEMENT free displays the amount of free memory kill [pid] kill a process id lsof [–i +M] lists open files ps [-axwuf] displays list of running processes top displays an interactive list of running processes w displays system uptime and list of logged in users init [level] change system run level to: 0 = halt, 1 = single user, 2 = multiuser 3 = networked, 5 = X display manager, 6 = reboot runlevel displays current runlevel shutdown --h(halt) or --r(reboot) now reboots or halts your system
PRINTING lpr [filename] [-Pprinter] sends file to printer queue lpq [-Pprinter] list jobs at specified printer queue lprm [-Pprinter] [job#] remove job# from specified printer queue X WINDOWS startx starts your X server and client Ctrl-Alt-Backspace quits Xwindows (if hung) Ctrl-Alt-F2 to F6 switch among Virtual Terminals USEFUL WEB SITES
dmesg displays kernel bootup messages cat /var/log/messages displays system console messages SPECIAL CHARACTERS & PIPES ; separates two commands & runs a program in the background > send to < receive from | send output of one process to another. Ex. ls –l | more DISK DRIVES df displays amount of free disk space in all mounted devices fdformat /dev/fd0H1440 (use with caution) formats a diskette mkfs [–t type] [device] creates a file system in the specified device mount [-t type] [/dev/devicename] [/mnt/directory] mounts a removeable or network drive. Ex. mount –t iso9660 /dev/hdc /mnt/cdrom Ex. mount --t ext2 /dev/fd0 /mnt/floppy umount [/dev/devicename] or [/mnt/directory] dismounts the drive NETWORK COMMANDS hostname [yourhostname] displays or sets your system hostname ifconfig eth[n] [ip-address] [netmask 255.255.255.x] alias sets IP address ping [host] sends packets to hosts to test if host is up nfsstat -a displays all network connections netstat -a displays all network connections nslokup [host] displays name server information about host route displays or sets kernel routing table traceroute [host] displays the route packets take to network host
Information www.kernel.org www.linux.org www.gnu.org www.linuxdoc.org www.justlinux.com
Software, Search Engines www.google.com/linux www.linuxberg.com www.tux.org freshmeat.net sourceforge.net
Linux Distributions www.caldera.com www.debian.org www.redhat.com www.suse.com www.linux-mandrake.com www.turbolinux.com
Open Source Projects www.apache.org www.gnome.org www.kde.org www.openoffice.org www.qmail.org www.sendmail.org
Security and Network Tools www.insecure.org
Rescue Toolkit www.toms.net/rb
Magazines www.linuxjournal.com www.linuxmagazine.com www.maximumlinux.com www.linuxformat.co.uk www.linuxgazette.com
E-Stores http://www.linuxmall.com/ http://www.elinux.com/
All Rights Reserved (c) 2001 - Adrian Mikeliunas