>>> sort myfile.txt | uniq
'Linux & Ubuntu/Linux tips'에 해당되는 글 15건
- 2009.06.11 sort and Remove duplicate lines
- 2008.12.11 find linux command
- 2008.10.30 gunzip
- 2008.07.07 grep
- 2008.07.04 How to know the version of ubuntu you're running
- 2008.05.07 linux command related with process
- 2008.02.27 iconv
- 2008.01.16 Linux Remote Desktop for controlling Windows XP/ Vista / Server 2003 ( rdesktop )
- 2007.12.27 Archiving with Tar
- 2007.12.26 how to check folder size
>>> sort myfile.txt | uniq
apropos what ?
#apropos translate
...
1 可执行程序或shell命令
2 系统调用
3 库调用
8 系统管理员命令(通常仅root可用)
$> grep -w '( 完 )' train.UCUP.utf8
Ubuntu 8.04.1 \n\l
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
ex :
iconv -f gb2312 -t utf-8 train.CityU.gb > train.CityU.utf8
Linux Remote Desktop for controlling Windows XP/ Vista / Server 2003 ( rdesktop )
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
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.tartar -xzvf mystuff.tgz
testing/viewing:
tar -tvf mystuff.tartar -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
$ du -hs /path/to/directory