QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1544|回复: 4

linux下的命令解析是如何处理的???

[复制链接]
发表于 2005-3-29 16:34:36 | 显示全部楼层 |阅读模式
比如,ls这个命令,LINUX下SH是怎么运行起来的,
还有,哪里有地方下在bsh,csh,sh 的源代码
发表于 2005-3-30 09:30:33 | 显示全部楼层
到这些项目的主页上下,如果你用debian,gentoo你应该知道怎么得到了,如果你想知道这些项目的主页那就打开浏览器google
回复

使用道具 举报

 楼主| 发表于 2005-4-4 09:13:38 | 显示全部楼层
能不能说清楚些??????????????????
回复

使用道具 举报

发表于 2005-4-5 09:17:18 | 显示全部楼层
[mingz@whoami x]$ strace x
strace: x: command not found
[mingz@whoami x]$ strace ls
execve("/bin/ls", ["ls"], [/* 38 vars */]) = 0
uname({sys="Linux", node="whoami.localdomain", ...}) = 0
brk(0)                                  = 0x9b54000
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=64898, ...}) = 0
old_mmap(NULL, 64898, PROT_READ, MAP_PRIVATE, 3, 0) = 0xf6ff0000
close(3)                                = 0
open("/lib/tls/librt.so.1", O_RDONLY)   = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300P\260"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=50940, ...}) = 0
old_mmap(0xb03000, 81880, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb03000
old_mmap(0xb0b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x7000) = 0xb0b000
old_mmap(0xb0d000, 40920, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb0d000
close(3)                                = 0
open("/lib/libacl.so.1", O_RDONLY)      = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360R1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=23752, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6fef000
old_mmap(0x314000, 25224, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x314000
old_mmap(0x31a000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x5000) = 0x31a000
close(3)                                = 0
open("/lib/libselinux.so.1", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@A\240\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=56424, ...}) = 0
old_mmap(0xa02000, 56172, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xa02000
old_mmap(0xa0f000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xd000) = 0xa0f000
close(3)                                = 0
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300+\300"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1459344, ...}) = 0
old_mmap(0xbee000, 1162188, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xbee000
old_mmap(0xd04000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x116000) = 0xd04000
old_mmap(0xd08000, 7116, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xd08000
close(3)                                = 0
open("/lib/tls/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\367\34"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=106284, ...}) = 0
old_mmap(0x1cb000, 70128, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x1cb000
old_mmap(0x1d9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xd000) = 0x1d9000
old_mmap(0x1db000, 4592, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x1db000
close(3)                                = 0
open("/lib/libattr.so.1", O_RDONLY)     = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p{2\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=12164, ...}) = 0
old_mmap(0x327000, 13660, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x327000
old_mmap(0x32a000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x32a000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6fee000
mprotect(0xb0b000, 4096, PROT_READ)     = 0
mprotect(0xd04000, 4096, PROT_READ)     = 0
mprotect(0x1d9000, 4096, PROT_READ)     = 0
mprotect(0xbea000, 4096, PROT_READ)     = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xf6fee6a0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0xf6ff0000, 6489               = 0
set_tid_address(0xf6fee6e             = 3834
rt_sigaction(SIGRTMIN, {0x1cf6d0, [], SA_RESTORER|SA_SIGINFO, 0x1d6680}, NULL, = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN], NULL, = 0
getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0
_sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xfee56008, 31, (nil), 0}) = 0
access("/etc/selinux/", F_OK)           = -1 ENOENT (No such file or directory)
brk(0)                                  = 0x9b54000
brk(0x9b75000)                          = 0x9b75000
open("/proc/mounts", O_RDONLY)          = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6fff000
read(3, "rootfs / rootfs rw 0 0\n/dev/root"..., 1024) = 419
read(3, "", 1024)                       = 0
close(3)                                = 0
munmap(0xf6fff000, 4096)                = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=40261792, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xf6dee000
close(3)                                = 0
open("/proc/filesystems", O_RDONLY)     = 3
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tb"..., 4095) = 273
close(3)                                = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=41, ws_col=125, ws_xpixel=0, ws_ypixel=0}) = 0
open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 2 entries */, 4096)    = 48
getdents64(3, /* 0 entries */, 4096)    = 0
close(3)                                = 0
exit_group(0)                           = ?
回复

使用道具 举报

发表于 2005-4-5 09:18:00 | 显示全部楼层
http://distro.ibiblio.org/pub/linux/distributions/fedora/linux/core/3/SRPMS/bash-3.0-17.src.rpm
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-16 11:54 , Processed in 0.064845 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表