Sunday, June 1, 2008

Linux important Commands

Startx :

The startx command is an easy way to start an X session if you're working on a single computer or boot Linux to runlevel 3 mode (X11, multiuser and networking enabled)

[The startx command redirects X server and X client error messages to the file specified by the user's XERRORS environment variable. This process is useful for debugging and gives the X server a clean startup and shutdown appearance on a workstation.]

Xterm :

In computing, xterm is the standard terminal emulator for the X Window System. A user can have many different invocations of xterm running at once on the same display, each of which provides independent input/output for the process running in it (normally the process is a Unix shell).

xhost - server access control program for X

The xhost program is used to add and delete host names or user names to the list allowed to make connections to the X server. In the case of hosts, this provides a rudimentary form of privacy control and security. It is only sufficient for a workstation (single user) environment, although it does limit the worst abuses. Environments which require more sophisticated measures should implement the user-based mechanism or use the hooks in the protocol for passing other authentication data to the server.

[+]name

The given name (the plus sign is optional) is added to the list allowed to connect to the X server. The name can be a host name or a user name.

-name

The given name is removed from the list of allowed to connect to the server. The name can be a host name or a user name. Existing connections are not broken, but new connection attempts will be denied. Note that the current machine is allowed to be removed; however, further connections (including attempts to add it back) will not be permitted. Resetting the server (thereby breaking all connections) is the only way to allow local connections again.

+

Access is granted to everyone, even if they aren't on the list (i.e., access control is turned off).

-

Access is restricted to only those on the list (i.e., access control is turned on).

TWM

Twm is a window manager for the X Window System. It provides titlebars, shaped windows, several forms of icon management, user-defined macro functions, click-to-type and pointer-driven keyboard focus, and user-specified key and pointer button bindings.

xinit - X Window System initialize

The xinit program is used to start the X Window System server and a first client program on systems that cannot start X directly from /etc/init or in environments that use multiple window systems. When this first client exits, xinit will kill the X server and then terminate.

Synopsis

xinit [ [ client ] options ] [ -- [ server ] [ display ] options ]

Examples

Below are several examples of how command line arguments in xinit are used.

xinit

This will start up a server named X and run the user's .xinitrc, if it exists, or else start an xterm.

xinit -- /usr/X11R6/bin/Xqdss :1

This is how one could start a specific type of server on an alternate display.

xinit -geometry =80x65+10+10 -fn 8x13 -j -fg white -bg navy

This will start up a server named X, and will append the given arguments to the default xterm command. It will ignore .xinitrc.

xinit -e widgets -- ./Xsun -l -c

This will use the command ./Xsun -l -c to start the server and will append the arguments -e widgets to the default xterm command.

xinit /usr/ucb/rsh fasthost cpupig -display ws:1 -- :1 -a 2 -t 5

This will start a server named X on display 1 with the arguments -a 2 -t 5. It will then start a remote shell on the machine fasthost in which it will run the command cpupig, telling it to display back on the local workstation.

Xserver - X Window System display server

X is the generic name for the X Window System display server. It is frequently a link or a copy of the appropriate server binary for driving the most frequently used server on a given machine.

arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination

-f : quit on first reply

-q : be quiet

-b : keep broadcasting, don't go unicast

-D : duplicate address detection mode

-U : Unsolicited ARP mode, update your neighbours

-A : ARP answer mode, update your neighbours

-V : print version and exit

-c count : how many packets to send

-w timeout : how long to wait for a reply

-I device : which ethernet device to use (eth0)

-s source : source ip address

destination : ask for what ip address

# Marks a command.

alias Displays alias.

Syntax

alias [name=['command']]

bg Resumes job in the background.

break Resumes execution after the loop.

breaksw Breaks from a switch command; resumes after the endsw command.

case Defines a label in a switch command.

cd Changes directory.

chdir Changes directory, same as cd.

continue Continues a loop.

default Specifies the default case in a switch.

dirs Displays the directory stack.

echo Writes arguments to the standard output of the shell.

eval Evaluates a command.

exec Executes the command in the current shell.

exit Exits the shell.

fg Brings a job in the foreground.

foreach Specifies a looping control statement and execute a sequence of commands until reaching an end command.

glob Writes arguments to the standard output of the shell, like the echo command, but without the new line.

goto Continues execution after the specified label.

hashstat Displays hash table statistics.

history Displays the history list.

if Executes a command if condition met.

jobs Lists active jobs.

kill Sends a signal to a process. term (terminate) is the default signal.

limit

Sets or list system resource limits.

login Logs on.

logout Logs out.

nice Changes the priority of commands run in the shell.

nohup Ignores the hangup signal.

notify

Notifies the user about changes in job status.

onintr Tells the shell what to do on interrupt.

popd Pops the top directory off the directory stack and changes to the new top directory. pushd Exchanges the top two elements of the directory stack.

rehash Re-computes the hash table of the contents of the directories in the path shell variable.

repeat

Repeats the execution of a command.

set Displays or set the value of a shell variable.

setenv Sets environment variables.

shift Shifts shell arguments.

source Reads commands from a script.

stop

Stops a background job.

suspend Stops the current shell.

switch Starts a switch.

time Displays the time used to execute commands.

umask Shows or set file permissions.

unalias

Removes command alias.

unhash Disables the internal hash table.

unlimit Removes limitations on system Resource.

unset Deletes shell variables.

unsetenv Deletes environment variables.

wait Waits for background jobs to complete.

while …end

Executes the commands between the while and matching end statements repeatedly.

@ Displays or set the values of all the shell variables.



  • chmod - modify file access rights
  • su - temporarily become the superuser
  • chown - change file ownership
  • chgrp - change a file's group ownership

There are several commands that can be used to control processes. They are:

  • ps - list the processes running on the system
  • kill - send a signal to one or more processes (usually to "kill" a process)
  • jobs - an alternate way of listing your own processes
  • bg - put a process in the background
  • fg - put a process in the forground


No comments: