(Courriels de diversion: <divergez@fangeux-correctionnel.com> <frotteurs@redoubleront-reluiraient.com> <accouplerons@punissable-merlan.com> <ambitionnes@sursauterons-fonctionne.com> <sous-secretaire@eclatons-erigeant.com> <synchronise@assoyez-encartees.com> <enregimentant@decouleraient-essaimeras.com> <reactualiserions@deplaisions-concertez.com> <verrouilleraient@empaquettera-surregenerateur.com> <invertebre@vacants-copieurs.com> )
On Mon, 26 Oct 1998, zulian wrote: > 1)Pouriez vous m'envoyer les principalles commandes de Linux par e-mail? J'ai fait cette liste un jour, peut être ça peut t'intéresser ? + des bouts de doc empruntés ici ou là... à + ) Patrice Bridoux Le Monde Mobile ----------------------------------------------------------------------- BASH Do not forget 'tab' expansion while typing bash (command line) commands !!!! C-a Beginning of line C-e End of line C-u Delete char from cursor to the beginning of line C-d Delete char -------------------------------------------------------------------- VARIOUS Just type the commands presented below (left part of lines) at the prompt and hit the return key... You'll learn a lot about your machine ! # date print date & time on the standard output (your screen) # cal calendar # who am i almost self explaining # whoami slightly different # id user id & group id # alias alias for this login # env environment variables for this login # clear clear screen # reset reset the display (font) # exit to logout # locate file search a 'locate' database for file # updatedb update the 'locate' database # find / -name xxx.* search recursively from / files named xxx.* # man find is worth reading # man command man page for the command # whatis keYword search a the 'whatis' database for complete word # apropos keYword search a the 'whatis' database for string # makewhatis update the 'whatis' database # info program to browse info files # type coMmand give info for the command coMmand # file fiLe give info for the file fiLe # cat fiLe print the fiLe to the standard output # less fiLe to browse fiLe # tail -10 fiLe print the 10 last lines of fiLe # cp file otherfile copy file to otherfile # mv file otherfile move (rename) file to otherfile # mkdir dir create dir # rmdir delete dir # rm -rf dir remove dir & files recursively ! no undel ! # chmod 755 file (or directory) change permission # chown user file (or directory) change owner # chgrp group file (or directory) change group ---------------------------------------------------------------------- ADMIN # hostname print the server name # cat /etc/HOSTNAME same # uname -a same # cat /proc/version same # arch cpu name # cat /proc/interrupts for hardware lovers :-) # domainname print the server domain # cat /proc/net/dev network devices # ifconfig network devices config # netstat -r routing information # lsmod current in-kernel-loaded modules # free Memory usage # top Autorefresh screen (C-c to stop) # ps -axf Show all running process # kill pid kill the job 'pid' (pid from ps) # users List users logged on the system # who same as above + # last -10 show the 10 last logins # adduser userName to _add_ a user named userName (*) # cd /var/spool/mail to _remove_ a user... # rm userName remove his mailbox (*) # cd /home # rm -rf userName remove his home dir recursively(!) (*) # jed /etc/passwd to remove the line userName (*) hint -> (Jed help: C-x C-w to save, C-x C-c to quit, C-x u is Undo) # find / -user userName to see if there are other files (*) # find / -uid uid_de_userName owned by userName, remove them (*) # rm file_owned_by_userName (*) # passwd userName change the userName password (*) # passwd change your current login password # shutdown -h now to shutdown the system (*) # shutdown -r now to reboot the system (*) Ctl-Alt-Del does the same, is faster and you don't need to be root # mount will show the current mounted filesystems, # df partition usage, # du and path-relative disk usage # mount -t iso9660 /dev/hdc /mnt/cdrom To be able to access a CD-Rom (*) # ls /mnt/cdrom will show you files in the CD root # umount /mnt/cdrom To be able to eject the CD from drive (*) # mount -t msdos /dev/fd0 /mnt/floppy for a diskette (*) # ls /mnt/floppy files in the diskette root # umount /mnt/floppy -- important ! -- before to eject the diskette (*) ---------------------------------------------------------------- FILE SYSTEM ATTENTION: the system is _case sensitive_ when writing dir and file names ! / The root filesystem is specific for each machine (it is generally stored on a local disk, although it could possibly be downloaded to a ramdisk during bootup) and contains the files that are necessary for booting the system up, and to bring it up to such a state that the other filesystems may be mounted. The contents of the root filesystem will therefore be sufficient for the single user state. It will also contain tools for fixing a broken system, and for recovering lost files from backups. ........................................................................ USR The /usr filesystem contains all commands, libraries, manual pages, and other unchanging files needed during normal operation. No files in /usr should be specific for any given machine, nor should they be modified during normal use. This allows the files to be shared over the network, which can be cost-effective since it saves disk space (there can easily be hundreds of megabytes in /usr), and can make administration easier (only the master /usr needs to be changed when updating an application, not each machine separately). Even if the filesystem is on a local disk, it could be mounted read-only, to lessen the chance of filesystem corruption during a crash. /usr/X11R6 The X Window System, all files. To simplify the development and installation of X, the X files have not been integrated into the rest of the system. There is a directory tree below /usr/X11R6 similar to that below /usr itself. /usr/bin Almost all user commands. Some commands are in /bin or in /usr/local/bin. /usr/sbin System administration commands that are not needed on the root filesystem, e.g., most server programs. /usr/man, /usr/info, /usr/doc Manual pages, GNU Info documents, and miscellaneous other documentation files, respectively. /usr/include Header files for the C programming language. This should actually be below /usr/lib for consistency, but the tradition is overwhelmingly in support for this name. /usr/lib Unchanging data files for programs and subsystems, including some site-wide configuration files. The name lib comes from library; originally libraries of programming subroutines were stored in /usr/lib. /usr/local The place for locally installed software and other files. ....................................................................... HOME The /home filesystem contains the users' home directories, i.e., all the real data on the system. Separating home directories to their own directory tree or filesystem makes backups easier; the other parts often do not have to be backed up, or at least not as often (they seldom change). A big /home might have to be broken on several filesystems, which requires adding an extra naming level below /home, e.g., /home/students and /home/staff. ~ is the home directory for a particular user ~ ( = /home/pjb/ ) when logged as pjb ~ ( = /root/ ) when logged as root ..................................................................... OTHERS /bin/ Commands needed during bootup that might be used by normal users (probably after bootup). /sbin/ Like /bin, but the commands are not intended for normal users although they may use them if necessary and allowed. /etc/ Configuration files specific to the machine. /root/ The home directory for user root. /lib/ Shared libraries needed by the programs on the root filesystem. /lib/modules/ Loadable kernel modules, especially those that are needed to boot the system when recovering from disasters (e.g., network and filesystem drivers). /dev/ Device files. /tmp/ Temporary files. Programs running after bootup should use /var/tmp, not /tmp, since the former is probably on a disk with more space. /boot/ Files used by the bootstrap loader, e.g., LILO. Kernel images are often kept here instead of in the root directory. If there are many kernel images, the directory can easily grow rather big, and it might be better to keep it in a separate filesystem. Another reason would be to make sure the kernel images are within the first 1024 cylinders of an IDE disk. /mnt/ Mount point for temporary mounts by the system administrator. Programs aren't supposed to mount on /mnt automatically. /mnt might be divided into subdirectories (e.g., /mnt/dosa might be the floppy drive using an MS-DOS filesystem, and /mnt/exta might be the same with an ext2 filesystem). /full/path/filename is a fully qualified file name /vmlinuz is the Kernel ........................................................................ ETC The directory /etc contains config files for various part of the system. /etc/DIR_COLORS system color definitions for color_ls /etc/crontab system crontab (automatic jobs) table /etc/termcap terminal capability database, describes by what '\escape sequences' various terminals can be controlled /etc/printcap same as termcap but for printer /etc/passwd user database username:passwd:uig:gid:real name:home:login_script /etc/group group database /etc/profile file executed at every login /etc/bashrc system bash config file (private is ~/.bashrc) /etc/inittab config file for init (run level...) /etc/fstab filesystems mounted automatically at startup also contains information about swap areas /etc/mtab list of currently mounted filesystem /etc/conf_modules config file for kerneld daemon (loadable modules) /etc/issue login prompt /etc/HOSTNAME hostname (fully qualified) /etc/sysconfig/network-scripts/ifup-eth script starting network (ethernet) /etc/sysconfig/network-scripts/ifcfg-eth0 network (ethernet) config file used at startup /etc/host.conf search order for ip from name /etc/resolv.conf domain & nameserver ip address /etc/networks network ip address /etc/hosts list of ip/name known machine /etc/inetd.conf config file for inetd daemon /etc/securetty Identifies secure terminals /etc/ftpaccess config file for the ftp daemon /etc/ftphosts allow/deny hosts for ftp access /etc/ftpusers users that CAN NOT use ftp ........................................................................ VAR The /var filesystem contains files that change, such as spool directories (for mail, news, printers, etc), log files, formatted manual pages, and temporary files. Traditionally everything in /var has been somewhere below /usr, but that made it impossible to mount /usr read-only. /var/lock Lock files. Many programs follow a convention to create a lock file in /var/lock to indicate that they are using a particular device or file. Other programs will notice the lock file and won't attempt to use the device or file. /var/log Log files from various programs, especially login (/var/log/wtmp, which logs all logins ans logouts into the system) and syslog (/var/log/messages, where all kernel and system program message are usually stored). File in /var/log can often grow indefinitely, and may require cleaning at regular intervals. /var/log/cron crontab daemon /var/log/maillog sendmail daemon /var/log/messages system events /var/log/secure refused access from network /var/log/lastlog history for logins (use 'last' command to see this file content) /var/log/httpd/ apache daemon log files /var/run Files that contain information about the system that is valid until the system is next booted. For example, /var/run/utmp contains information about people currently logged in. /var/spool Directories for mail, news, printer queues, and other queued work. Each different spool has its own subdirectory below /var/spool, e.g., the mailboxes of the users are in /var/spool/mail. /var/tmp Temporary files that are large or that need to exist for a longer time than what is allowed for /tmp. (Although the system administrator might not allow very old files in /var/tmp either.) ----------------------------------------------------------------------- HTTP /etc/httpd/conf/* config files for the httpd server /var/log/httpd/* log files /home/httpd/html/ Web pages (http://localhost) /home/nam/public_html/ user 'nam' Web pages (http://localhost/~nam/) /home/httpd/cgi-bin/ contains CGI scripts -------------------------------------------------------------- BOOT SEQUENCE Description of System V init by Red Hat /etc/fstab disks & file system structure /etc/inittab run level /etc/rc.d/rc.sysinit swap on, netconfig & various check /etc/rc.d/rcX.d/* rc1.d is for runlevel 1, rc3.d runlevel 3 (the default :multiuser). Each file there is a link to another one in /etc/rc.d/init.d/ .If you do not want a service for the particular run level 3: use the 'ntsysv' command. /etc/rc.d/rc.local last sript to run for local stuffs # /etc/rc.d/rc3.d/S85httpd stop to stop the http daemon (*) # /etc/rc.d/rc3.d/S85httpd start to restart it (*) ----------------------------------------------------------------- Foot Notes (*) : you must be root to run that particular command - Le CULTe sur le ouebe > http://savage.iut-blagnac.fr/ La page de linux-31 > http://savage.iut-blagnac.fr/linux-31/