Linux has rdesktop utility.
It is a client for remote desktop protocol (RDP), used in a number of Microsoft products including Windows NT Terminal Server, Windows 2000 Server, Windows XP and Windows 2003 Server.
You do not need to install VNC server.
All you need is rdesktop client on Linux or BSD workstation.

Install rdesktop
$ apt-get install rdesktop

Then,
connect to Windows server called vista.postech.ac.kr, type :

$ rdesktop vista.postech.ac.kr
 
Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2007. 12. 27. 22:02

Archiving with Tar

Archiving with Tar

Tar files place several files or the contents of a directory or directories in one file. This is a good way to create backups and archives. Usually, tar files end with the .tar extension.

To create a tar file, type:

tar -cvf filename.tar files/directories

In this example, filename.tar represents the file you are creating and files/directories represents the files or directories you want to put in the new file.

To extract the contents of a tar file, type:
tar -xvf foo.tar

This command does not remove the .tar file, but it places copies of the .tar contents in the current working directory.

The tar command does not compress files automatically. You can compress tar files with:

tar -czvf foo.tar

Compressed tar files are conventionally given the extension .tgz and are compressed with gzip.

To expand a compressed tar file type:

create:

tar -cvf mystuff.tar mystuff/
tar -czvf mystuff.tgz mystuff/

extracting:

tar -xvf mystuff.tar
tar -xzvf mystuff.tgz

testing/viewing:

tar -tvf mystuff.tar
tar -tzvf mystuff.tgz

Note that .tgz is the same thing as .tar.gz
Tar "tars up" a bunch of files into one "tar-file"
gzip is compression, but only works on one file, so the entire "tarfile" is compressed.

tar xvf **.tar.tar

Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2007. 12. 26. 11:26

how to check folder size

$ du -hs /path/to/directory
Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2007. 12. 11. 20:48

vi: search and replace

Vi: Search and Replace

Change to normal mode with <ESC>.

Search (Wraped around at end of file):

  Search STRING forward :   / STRING.
  Search STRING backward:   ? STRING.

  Repeat search:   n
  Repeat search in opposite direction:  N  (SHIFT-n)

Replace: Same as with sed, Replace OLD with NEW:
 
 First occurrence on current line:      :s/OLD/NEW
  
 Globally (all) on current line:        :s/OLD/NEW/g 

 Between two lines #,#:                 :#,#s/OLD/NEW/g
  
 Every occurrence in file:              :%s/OLD/NEW/g 
Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2007. 12. 11. 09:34

[linux]check and kill all process of certain user

check all process of certain user :


$ top -u johndoe
OR
$ top -u 500
OR
$ top -U johndoe








kill all process of certain user:
kill -9 `ps -u <username> -o "pid="`

Linux & Ubuntu/ubuntu | Posted by 알 수 없는 사용자 2007. 12. 11. 07:19

update VMWARE in Ubuntu 7.10

After update the ubuntu to version 7.10,
get some trouble to continue to run VMWARE.

Steps to solve :
1. sudo vmware-config.pl
.....
ERROR :
location of the directory of C header files

METHOD to solve :
sudo apt-get install linux-headers-$(uname -r)

2. Next ERROR :

make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.12-9-amd64-generic'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/vmmon-only'
Unable to build the vmmon module.

For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.ht ml" and
"http://www.vmware.com/support/reference/linux/pre built_modules_linux.html".

Execution aborted.


METHOD to solve :
from web :
What version you are installing? With 5.0 you need to apply the any-any-update94 patch and at 5.5 you should have no problems.

what I try :
download vmware-any-any-update115.tar.gz
and install it

after install it, run vmware-config.pl
this time, it succeed!


Linux & Ubuntu/ubuntu | Posted by 알 수 없는 사용자 2007. 11. 19. 10:29

Install Adobe Reader for Ubuntu Feisty and Gutsy

Medibuntu has Adobe Acrobat Reader 7 in the repositories. 

First we must get the gpg key from Medibuntu.
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update

Next we need to add the sources.list for your distribution.  Choose only ONE.

Ubuntu Feisty 7.04

sudo wget http://www.medibuntu.org/sources.list.d/feisty.list -O /etc/apt/sources.list.d/medibuntu.list

Ubuntu Gutsy 7.10
sudo wget http://www.medibuntu.org/sources.list.d/gutsy.list -O /etc/apt/sources.list.d/medibuntu.list

Update Synaptic Package Manager
sudo apt-get update

Install Adobe Acrobat Reader
sudo apt-get install acroread acroread-escript acroread-plugins mozilla-acroread

If you wish to only have Acrobat Reader then omit the last three from the apt-get install statement above.
Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2007. 11. 1. 15:58

ps & kill

Linux / Unix Command: ps / kill
Command Library

Even on Linux it sometimes happens that processes wear out their welcome and stick around longer than you would like them to. They simply ignore your request to close up and go away. Fortunately you have a powerful gun at your disposal that will clean out anything that doesn't get a hint: The Arnold Schwarzenegger equivalent among the Linux commands is the kill command.

The kill command works together with the ps command

  • With the ps command (ps stands for "process status") you find out the identity of the program you want to get rid of.
  • Then kill will finish it off.

    Here's how you do it:

The ps Command

It is used to display the currently running processes on Unix/Linux systems. If you know the 'Task-Manager" which pops up under Windows NT/2000/XP when you press CTRL+ALT+DEL then you will quickly grasp what ps does on Linux. It can show you the processes on your system in various formats. Here is a typical example:

To display all processes owned by the current user type ps ux and hit return:

$ ps ux

This will show a listing of processes similar to:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
jhaas 3064 0.1 3.6 18324 9088 ? S 17:55 0:00 /usr/bin/gnome-session
jhaas 3107 0.0 0.3 3128 968 ? S 17:55 0:00 /usr/bin/ssh-agent /etc/X11/xinit/Xclients
jhaas 3112 0.1 2.9 11208 7376 ? S 17:55 0:00 /usr/libexec/gconfd-2 11
jhaas 3130 0.0 0.6 3584 1696 ? S 17:55 0:00 xscreensaver -nosplash
jhaas 3133 0.8 5.3 21744 13216 ? S 17:55 0:03 gnome-panel --sm-client-id default2
jhaas 3137 0.0 2.4 16296 6172 ? S 17:55 0:00 magicdev --sm-client-id default4
jhaas 3141 0.0 2.8 16676 6936 ? S 17:55 0:00 eggcups --sm-client-id default6
jhaas 3143 0.0 1.7 11652 4308 ? S 17:55 0:00 pam-panel-icon --sm-client-id default0
jhaas 3145 0.2 5.4 24280 13564 ? S 17:55 0:01 /usr/bin/python /usr/bin/rhn-applet-gui --sm-client-id default5
jhaas 3154 0.3 4.1 23856 10172 ? S 17:55 0:01 evolution
jhaas 3157 0.0 0.9 5636 2228 ? S 17:55 0:00 oafd --ac-activate --ior-output-fd=10
jhaas 3216 0.2 3.1 12788 7844 ? S 17:56 0:00 emacs
jhaas 3218 1.3 4.0 20248 9904 ? R 17:56 0:04 gnome-terminal
jhaas 3219 0.0 0.2 1852 572 ? S 17:56 0:00 [gnome-pty-helpe]
jhaas 3220 0.0 0.5 4316 1388 pts/0 S 17:56 0:00 bash
jhaas 3268 0.0 0.2 2636 684 pts/0 R 18:01 0:00 ps ux

The kill Command

Now, if you want to terminate for example the emacs process you would look up the process identifier (PID) in the above table (3216), and say:

$ kill -9 3216

The -9 will ensure "execution".

A convenient short cut is the Alt-Ctrl-Esc key combination, which allows you to simply click on the application you want to kill.

Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2007. 11. 1. 15:56

df - Linux command line tool to display disk space usage

df - Linux command line tool to display disk space usage


-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)

-H, --si
likewise, but use powers of 1000 not 1024

-i, --inodes
list inode information instead of block usage

-k like --block-size=1K

-l, --local
limit listing to local file systems

--no-sync
do not invoke sync before getting usage info (default)

-P, --portability
use the POSIX output format

--sync invoke sync before getting usage info

-t, --type=TYPE
limit listing to file systems of type TYPE

-T, --print-type
print file system type

-x, --exclude-type=TYPE
limit listing to file systems not of type TYPE

-v (ignored)

--help display this help and exit

--version
output version information and exit

Examples

If you use df with no options it will display all the available filesystems' info

$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 151225248 16280980 127262392 12% /
tmpfs 517924 0 517924 0% /lib/init/rw
udev 10240 60 10180 1% /dev
tmpfs 517924 0 517924 0% /dev/shm
/dev/sdb1 76896316 54820876 18169240 76% /media/discob
sshfs#ggarron@alketech.com:/home/ggarron/
7999999992 0 7999999992 0% /mnt/remote

To better understand what is in the screen can be used the -h (human readable)

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 145G 16G 122G 12% /
tmpfs 506M 0 506M 0% /lib/init/rw
udev 10M 60K 10M 1% /dev
tmpfs 506M 0 506M 0% /dev/shm
/dev/sdb1 74G 53G 18G 76% /media/discob
sshfs#ggarron@alketech.com:/home/ggarron/
7.5T 0 7.5T 0% /mnt/remote

To display only local mounted systemfilesystems use the -l (local) options, you will see the sshfs remote filesystem is not shown anymore.

$ df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 145G 16G 122G 12% /
tmpfs 506M 0 506M 0% /lib/init/rw
udev 10M 60K 10M 1% /dev
tmpfs 506M 0 506M 0% /dev/shm
/dev/sdb1 74G 53G 18G 76% /media/discob

You can use it pointed to the device path or to the path where the filesystem is mounted

$ df -h /dev/sdb1
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 74G 53G 18G 76% /media/discob

$ df -h /media/discob/
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 74G 53G 18G 76% /media/discob


Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2007. 11. 1. 15:45

Linux Command

An A-Z Index of the Linux BASH command line

alias    Create an alias
apropos Search Help manual pages (man -k)
awk Find and Replace text, database sort/validate/index
break Exit from a loop
builtin Run a shell builtin
bzip2 Compress or decompress named file(s)

cal Display a calendar
case Conditionally perform a command
cat Display the contents of a file
cd Change Directory
cfdisk Partition table manipulator for Linux
chgrp Change group ownership
chmod Change access permissions
chown Change file owner and group
chroot Run a command with a different root directory
cksum Print CRC checksum and byte counts
clear Clear terminal screen
cmp Compare two files
comm Compare two sorted files line by line
command Run a command - ignoring shell functions
continue Resume the next iteration of a loop
cp Copy one or more files to another location
cron Daemon to execute scheduled commands
crontab Schedule a command to run at a later time
csplit Split a file into context-determined pieces
cut Divide a file into several parts

date Display or change the date & time
dc Desk Calculator
dd Data Dump - Convert and copy a file
declare Declare variables and give them attributes
df Display free disk space
diff Display the differences between two files
diff3 Show differences among three files
dig DNS lookup
dir Briefly list directory contents
dircolors Colour setup for `ls'
dirname Convert a full pathname to just a path
dirs Display list of remembered directories
du Estimate file space usage

echo Display message on screen
egrep Search file(s) for lines that match an extended expression
eject Eject removable media
enable Enable and disable builtin shell commands
env Environment variables
ethtool Ethernet card settings
eval Evaluate several commands/arguments
exec Execute a command
exit Exit the shell
expand Convert tabs to spaces
export Set an environment variable
expr Evaluate expressions

false Do nothing, unsuccessfully
fdformat Low-level format a floppy disk
fdisk Partition table manipulator for Linux
fgrep Search file(s) for lines that match a fixed string
file Determine file type
find Search for files that meet a desired criteria
fmt Reformat paragraph text
fold Wrap text to fit a specified width.
for Expand words, and execute commands
format Format disks or tapes
free Display memory usage
fsck File system consistency check and repair
ftp File Transfer Protocol
function Define Function Macros

gawk Find and Replace text within file(s)
getopts Parse positional parameters
grep Search file(s) for lines that match a given pattern
groups Print group names a user is in
gzip Compress or decompress named file(s)

hash Remember the full pathname of a name argument
head Output the first part of file(s)
history Command History
hostname Print or set system name

id Print user and group id's
if Conditionally perform a command
ifconfig Configure a network interface
import Capture an X server screen and save the image to file
install Copy files and set attributes

join Join lines on a common field

kill Stop a process from running

less Display output one screen at a time
let Perform arithmetic on shell variables
ln Make links between files
local Create variables
locate Find files
logname Print current login name
logout Exit a login shell
look Display lines beginning with a given string
lpc Line printer control program
lpr Off line print
lprint Print a file
lprintd Abort a print job
lprintq List the print queue
lprm Remove jobs from the print queue
ls List information about file(s)
lsof List open files

make Recompile a group of programs
man Help manual
mkdir Create new folder(s)
mkfifo Make FIFOs (named pipes)
mkisofs Create an hybrid ISO9660/JOLIET/HFS filesystem
mknod Make block or character special files
more Display output one screen at a time
mount Mount a file system
mtools Manipulate MS-DOS files
mv Move or rename files or directories

netstat Networking information
nice Set the priority of a command or job
nl Number lines and write files
nohup Run a command immune to hangups
nslookup Query Internet name servers interactively

passwd Modify a user password
paste Merge lines of files
pathchk Check file name portability
ping Test a network connection
popd Restore the previous value of the current directory
pr Prepare files for printing
printcap Printer capability database
printenv Print environment variables
printf Format and print data
ps Process status
pushd Save and then change the current directory
pwd Print Working Directory

quota Display disk usage and limits
quotacheck Scan a file system for disk usage
quotactl Set disk quotas

ram ram disk device
rcp Copy files between two machines.
read read a line from standard input
readonly Mark variables/functions as readonly
remsync Synchronize remote files via email
return Exit a shell function
rm Remove files
rmdir Remove folder(s)
rsync Remote file copy (Synchronize file trees)

screen Terminal window manager
scp Secure copy (remote file copy)
sdiff Merge two files interactively
sed Stream Editor
select Accept keyboard input
seq Print numeric sequences
set Manipulate shell variables and functions
sftp Secure File Transfer Program
shift Shift positional parameters
shopt Shell Options
shutdown Shutdown or restart linux
sleep Delay for a specified time
sort Sort text files
source Run commands from a file `.'
split Split a file into fixed-size pieces
ssh Secure Shell client (remote login program)
strace Trace system calls and signals
su Substitute user identity
sum Print a checksum for a file
symlink Make a new name for a file
sync Synchronize data on disk with memory

tail Output the last part of files
tar Tape ARchiver
tee Redirect output to multiple files
test Evaluate a conditional expression
time Measure Program running time
times User and system times
touch Change file timestamps
top List processes running on the system
traceroute Trace Route to Host
trap Run a command when a signal is set(bourne)
tr Translate, squeeze, and/or delete characters
true Do nothing, successfully
tsort Topological sort
tty Print filename of terminal on stdin
type Describe a command

ulimit Limit user resources
umask Users file creation mask
umount Unmount a device
unalias Remove an alias
uname Print system information
unexpand Convert spaces to tabs
uniq Uniquify files
units Convert units from one scale to another
unset Remove variable or function names
unshar Unpack shell archive scripts
until Execute commands (until error)
useradd Create new user account
usermod Modify user account
users List users currently logged in
uuencode Encode a binary file
uudecode Decode a file created by uuencode

v Verbosely list directory contents (`ls -l -b')
vdir Verbosely list directory contents (`ls -l -b')
vi Text Editor

watch Execute/display a program periodically
wc Print byte, word, and line counts
whereis Report all known instances of a command
which Locate a program file in the user's path.
while Execute commands
who Print all usernames currently logged in
whoami Print the current user id and name (`id -un')
Wget Retrieve web pages or files via HTTP, HTTPS or FTP

xargs Execute utility, passing constructed argument list(s)
yes Print a string until interrupted

.period Run commands from a file
### Comment / Remark