Quote
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes
2、DF命令直接查看下本地驱动器
$ df
Filesystem 1k-blocks Used Available Use% Mounted on
c: 5106676 1240312 3866364 25% /cygdrive/c
d: 10239408 6560328 3679080 65% /cygdrive/d
e: 10231384 4844432 5386952 48% /cygdrive/e
在后面的/cygdrive/c便是C盘了
3、CD命令改变当前路径
进D盘
$ cd /cygdrive/d
4、Cygwin下运行Windows程序
$ cmd.exe
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
e:\cygwin\home\Taynni-417>d:
D:\>cd hacker
D:\HACKER>cd tools
D:\HACKER\Tools>cd pstools
D:\HACKER\Tools\Pstools>exit
直接输入CMD.EXE便可以得到一个本机CMDSHELL,这样运行什么程序都可以
退出到Cygwin的Bash shell需要使用exit命令
5、--help 帮助命令
--help获取帮助
$ md5sum --help
Usage: md5sum [OPTION] [FILE]...
or: md5sum [OPTION] --check [FILE]
Print or check MD5 (128-bit) checksums.
With no FILE, or when FILE is -, read standard input.
-b, --binary read files in binary mode (default on DOS/Windows)
-c, --check check MD5 sums against given list
-t, --text read files in text mode (default)
The following two options are useful only when verifying checksums:
--status don‘t output anything, status code shows success
-w, --warn warn about improperly formated checksum lines
--help display this help and exit
--version output version information and exit
The sums are computed as described in RFC 1321. When checking, the input
should be a former output of this program. The default mode is to print
a line with checksum, a character indicating type (`*‘ for binary, ` ‘ for
text), and name for each FILE.
6、pwd 显示当前的路径
cd 改变当前路径,无参数时进入对应用户的home目录
ls 列出当前目录下的文件。此命令有N多参数,比如ls -al
ps 列出当前系统进程
kill 杀死某个进程
mkdir 建立目录
rmdir 删除目录
rm 删除文件
mv 文件改名或目录改名
man 联机帮助
less 显示文件的最末几行
由于linux下面的命令大多都有很多参数,可以组合使用。所以,每当你不会或者记不清楚该用哪个参数,哪个开关的时候,可以用man来查找
比如,查找ls怎么使用,可以键入
$ man ls
系统回显信息如下:
LS(1) FSF LS(1)
7、编译helloworld
# cd
进入了/home/administrator目录,我当前的登陆帐号是administrator
# mkdir source
建立一个叫做source的子目录
# cd source
进入 /home/administrator/source
# vim hello.c
我们编辑hello.c文件,输入:
#include
int main(void) {
printf( "Hello World!");
}
然后,输入wq命令退到命令行。
输入编译指令:
# gcc hello.c -o hello
编译成功后可以看一下
# ls
看到hello.exe了吧
C++的Hello world
# vim world.cpp
输入:
#include
using namespace std;
void main() {
cout << "Hello World!";
}
编译C++程序要用g++
# g++ world.cpp -o world
运行一下
# ./world
好了,关于如何编写makefile文件,,如何用gdb下次再说了。
Linux开发一路过来 cygwin->make->gcc
Cygwin下编译的程序不使用Cygwin.dll即可运行的命令 及常用命令简介