Click here to register.
   

Linux Cheat Sheet

Linux Cheat Sheet

Since you can find many books on the art of the linux command line, we aren't going to try and list all that information here.   Instead, here are a few of the more important commands and their definitions, to get you started on your way to installing WebGUI.

Getting Around in the File System

pwd
    Path of working directory - tells you what directory you are in

ls
    List - Lists the files in the current directory

ls -l

    Lists the files and their attributes

cd <directory>

    change directory - Change to the directory specified

Dealing with Files

cp <filename> <new filename>

    copy - Make a copy of a file

cp -R <directory> <new directory>

    Make a copy of a directory

mv <filename> <new filename>

    move - Move or rename a file

rm <filename>

    remove - Delete a file

more <filename>

    Page through a file.

grep <keyword> <filename>

    Search a file for a keyword

vi <filename>

    Edit a file. (See Ruling WebGUI's vi Cheat sheet for details>

chmod <mode> <filename>

    change mode - Change the mode or permissions on a file.
    Mode = ogw or owner, group, world permissions.  example: 755
    0=nothing
    4=read
    5=read / execute
    6=read / write
    7=read / write / execute

chown <user> <filename>

    change owner - Change the owner of a file

Dealing with Environment Variables

export <variable name>=<value>

    Set and environment variable in teh current shell.

set

    Show all of the current envireonment variables that have been exported

unset <variable name>

    Delete an environment variable

Power Users

df -k

    Determine how full the partitions on the local hard disks are.

du -ks <directory>

    Determine the disk usage of a given directory and all sub directories

find <starting path> -name <filename>

    Locate a file on the file system.

ps -ef

    Get a look at the processes running on the machine

top

    Take a look at the memory and CPU usage as well as the top processes on the machine

man <command>

    Get help for a given command

diff <filename 1> <filename 2>

    Report the differences between two files.

gzip <filename>

    Compress a file.

gunzip <filename>

    Decompress a file.

tail <number of lines> <filename>

    Look at the end of a file.

tar cf ./<tar filename>*

    Tar all the files in this directory into a tar-ball in the lower directory

tar xvf <tar filename>

    De-tar the contents of a tar-ball

Perl Specific

perl -w <filename>

    Execute a Perl Script with warnings.

perl -c <filename>

    Get compilation errors for a Perl script

perldoc <module>::<function>

    Get help for a Perl function in a given module.

perldoc perlfunc

    Get help on basic Perl functions.

perldoc perlpod

    Get help on Perl (POD = Plain Old Documentation) documentation

Java Specific

java <filename>

    Run a compiled class

java -client <filename>

    Run a compiled class where the JVM is optimized as a client

java -server <filename>

    Run compiled class where the JVM is optimized as a server

javac <options> <source files>

    Compile a source file

javadoc [options] [packagenames] [sourcefiles] [classnames] [@files]

    Compile the JavaDoc from source files.