Sunday, October 5, 2008

Linux Cheat Sheet

AS PROMISED...



COMMANDS

command1 | command2 - Pipes the output of command1 into the input of command2

command1 && command 2 - Does command2 after command1 is finished

alias - Defines shortcut for a long command

apropos - searches manpages for keywords

history - Display recent commands

locate - finds files

whereis - finds executable files for a command

which - shows full pathname for a command

man - displays help file

printenv - Displays the environment variables

cd filepathhere - change current terminal directory

cat - Copies a file to the standard output

chmod - changes file permissions

chown - changes file ownerships

cp - copies files

diff - compares two text files

file - displays type of data in a file

find - locates files based on specified criteria

grep - searches for text in a file

ln - links a filename to a link name

ls - displays contents of current terminal directory

mkdir - make a directory

mount - mounts a file systen

mv - mova a file

pwd - displays current terminal directory

rm - deletes file

rmdir - deletes directories

umount - unmount filesystem

sudo - Super User DO (allows access to all system files USE AT OWN RISK!)

su - same as above but for multiple commands


FILESYSTEM


/ -root directory (base of system)

/bin - executable programs

/boot - linux kernel and boot files

/dev - special device files

/etc - system configuration files

/home - home directoies of all users

/lib - library files for programs

/media - mount points for cd-rom, floppy etc.

/root - home directory of the root user

/sbin - system administration commands

/tmp - temporary directory

/usr - many important programs

/var - various system files such as logs

No comments: