Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2009. 6. 11. 09:31

sort and Remove duplicate lines


>>> sort myfile.txt | uniq
Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2008. 12. 11. 15:50

find linux command

#apropos
apropos what ?

#apropos translate
...

1   可执行程序或shell命令

2   系统调用

3 库调用

8 系统管理员命令(通常仅root可用)



Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2008. 10. 30. 15:19

gunzip

gunzip -c svm_light.tar.gz | tar xvf -
Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2008. 7. 7. 10:06

grep

print out all lines contain ( 完 ):

$> grep -w '( 完 )' train.UCUP.utf8


Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2008. 7. 4. 16:27

How to know the version of ubuntu you're running

cate \etc\issue

Ubuntu 8.04.1 \n\l
Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2008. 5. 7. 16:24

linux command related with process

$ps
    to see currently running process
$kill 1012    #kill {PID}
    to stop any process by PID i.e. to kill process
$killall http    #killall {Process-name}
    to stop processes by name i.e. to kill process
$ps -ag
    to get information about all running process
$kill 0
    to stop all process except your shell
$ls | wc -l &    #linux-command &
    for background processing
$ps aux
    to disply the owner of the processes along with the processes
$ps ax | grep http   #ps ax | grep process-U-want-to see
    to see if a particular process is runing or not. For this purpose you have to use
    ps command in combination with the grep command
$top
    to see currently running processes and other information like memory and
    CPU usage with real time updates.
$pstree
    to display a tree of processes
   
   
Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2008. 2. 27. 13:53

iconv

iconv -f gb2312 -t utf-8 original_file_name > target_file_name

ex :
iconv -f gb2312 -t utf-8 train.CityU.gb > train.CityU.utf8
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