Saturday, December 23, 2006

Some Linux guddies....

uptime - Prints the system uptime.
w - Prints the current system users.
wall - Prints a message to each user except those who've disabled message reception. Type Ctrl-D to end the message.
============================================================
no root!
If /etc/securetty is world writeable then root will not be able to log in.
Permission of /etc/securetty is 600
If you change this to 606, root can not log in.
============================================================
how to make ur floppy bootable...???
fdformat /dev/fd0
mkfs /dev/fd0
mount /dev/fd0
cp ks.cfg /media/floppy

in the prompt type (without quotes) "linux ks=floppy"
============================================================
wants to automount the samba shares
Edit the /etc/auto.master file

vi /etc/auto.master

# $Id: auto.master,v 1.2 1997/10/06 21:52:03 hpa Exp $
# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(8).
/misc /etc/auto.misc --timeout=60

Then save this file

Now edit the /etc/auto.misc file
vi /etc/auto.misc

# $Id: auto.misc,v 1.2 1997/10/06 21:52:04 hpa Exp $
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage

cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

samba -fstype=smbfs,username=[username],passwo
rd=[password] ://server/share

# the following entries are samples to pique your imagination
#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0

Then restart the autofs service
============================================================

More koooolest ones.....

File system navigation / directories
* pwd [options] - to obtain/print the name of your current/working directory.
* cd [options] [directoryname | ~ | ./ | ../ | - ] - to change your working directory.
* ls [options] directoryname - to list the contents of directories.
* mkdir [options] directoryname - to create new directories.
* rmdir [options] directoryname - to remove/delete directories.
* cp [options] source destination - to copy files and directories.
* mv [options] source destination - to move files and directories.
* rm [options] filenamelist - to remove/delete files.
============================================================

Exiting from a shell prompt (to close a terminal window or to log out)
* exit
* or by pressing - the general end of text control character.

============================================================

Searching for files by name
* locate [options]
* find [options]
* slocate [options]

============================================================
Viewing text files

* cat [options] filename - to display the file contents without pause or break.
* less [options] filename - to display file contents page by page.
* more [options] filename - to display file contents page by page.
* tail [options] filename - to display the last few lines of a file.
* head [options] filename - to display the first few lines of a file.

============================================================
traceroute

Traces the existing network routing for a remote or local server
Most common use: traceroute hostname
(replace hostname with the name of your server such as harquch.com)
This is a very powerful network command that basically gives the exact route between your machine and a server. In some cases you can actually watch the network hops from country to country across an ocean, through data centers, etc.
This comes in handy when trying to fix a network problem, such as when someone on the network can not get access to your server while others can. This can help identify the break or error along the network line. One strong note to you is not to misuse this command! When you run the traceroute everyone of those systems you see listed also sees YOU doing the traceroute and therefore as a matter of etiquette and respect this command should be used when necessary not for entertainment purposes. A key characteristic of gainfully employed server administrators: knowing when to use commands and when not to use them!

Interesting!!!! koool things...

10 most often commands used at your linux box..
Run the following command to see which are the 10 most often commands you use at your linux box.
#history | cut -c 8- | cut -f1 -d" " | sort | uniq -c | sort -rn | head -n10

If you want to mount NTFS partition, can use this documentation:
http://stanton-finley.net/fedora_core_5_installation_notes.html#NTFS

If your partition is FAT32, you can mount using vfat adding the line below in /etc/fstab file:
/dev/hda?? /media/windows vfat rw,user,umas=000 auto 0 0

Changing /dev/hda?? by you partition.

=============================================================

Command line history, I/O redirection, and piping
* history [options] - to display the command line history.
* key - to complete a partially typed file/directory name or command.
* <↑> / <↓> keys - to navigate the command history buffer.
* ; - to separate multiple commands on a single line. Ffor example command1 ; command2.
* >,>> - to redirect the output of a command. For example ls -la directoryname > myfile.txt will write the output of the ls command to the file myfile.txt (and not to the screen!) while overwriting any previous contents of the file. If >> is used instead of > the original contents of the file myfile.txt will not be ereased but the output of ls will be appended to it.
* < - to use a specific file as an input to a command. For example cpio [options] < filenamelistfile.txt
* | - to pipe the output of one command to another command. Ffor example ls -al directoryname | less.

=============================================================
koolest cmds...
# ps [options] - to display active proccesses.
# kill [options] processID - to send a signal to a process ("kill" is a misnomer).
# top [options] - to display top CPU processes.
# free [options] - to display information about free and used memory on the system.
# df [options] file(system)name - to get information on filesystem disk space usage.
# du [options]filename - to estimate file space usage.
System statistics:
#mpstat
#vmstat
#iostat
#netstat
#cat /proc/loadavg

=============================================================

To run applications in the background..

# nohup commandname [arguments] - to run a command, with a non-tty output, that should continue running after exiting the prompt.
# nice [options] commandname [arguments] - to run a program with modified scheduling priority.
# renice priority [options] - to alter the priority of a running process.
# & - to put a job in the background (for example emacs mytext.txt &).
# bg [jobspec] - to resume the suspended job jobspec in the background as if it had been started with &.
# fg [jobspec] - to put the specified job in the foreground (to make it the current job).