Vous êtes sur la page 1sur 2

Basic Linux Template v1.

1 by Adrian Mikeliunas
LINUX FILE SYSTEM
http://go.to/Linux1 mail:linux1@usa.com From the only root of the Linux system you will find several directories:

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

Vous aimerez peut-être aussi