随笔分类 - Linux
摘要:chmod: chmod 777 filechmod abc file其中a,b,c各为一个数字,分别表示User、Group、及Other的rwx权限。cd /usr/bin 跳转目录lsattr file:显示文件属性。pwd :执行pwd指令可立刻得知目前所在的工作目录的绝对路径名称。vi:vi filename :打开或新建文件,并将光标置于第一行首:w :保存当前文件:e filename:打开文件filename进行编辑:x:保存当前文件并退出:q:退出vi:q!:不保存文件并退出vitar:tar -xvf filename.tartar -zxvf filename.tar.g
阅读全文
摘要:我们知道函数名就是一个内存地址,这个地址指向函数的入口。调用函数就是压入参数,保存返回地址,然后跳转到函数名指向的代码。问题是,如果函数在共享库中,共享库加载的地址本身就不确定,函数地址也就不确定了,那如何调用共享库中的函数呢?这就是本文要回答的。我们先来看一小段代码(test.c):#include <stdio.h>void hello_world(void){ printf("Hello world!\n"); return;}int main(int argc, char* argv[]){ hello_world(); return 0;}编译并反汇编
阅读全文
摘要:directory permission(目录权限) same bits, but different semantics from those of files r: can list directory contents w: can add or remove files from a directory x: can enter a directory especially, when the "w" bit is set, anyone can remove anyone's files, how can we prevent this? the &quo
阅读全文
摘要:when a file is newly created, what's this file's default permission? depend on the environment variable "umask" what does it mean? where is it located? (check the file: /etc/profile) check your umask, run $ umask on my system, this will print: 022 what does it mean? what's the
阅读全文
摘要:在Linux系统中每个普通用户都可以更改自己的密码,这是合理的设置。问题是:用户的信息保存在文件/etc/passwd中,用户的密码保存在文件/etc/shadow中,也就是说用户更改自己密码时是修改了/etc/shadow文件中的加密密码,但是,LOOK——-rw-r--r-- 1 root root 1787 Oct 27 2009 /etc/passwd-r-------- 1 root root 1187 Oct 27 2009 /etc/shadow/etc/passwd文件每个用户都有读权限但是只有root有写权限,/etc/shadow文件只有超级用户root有读写权限,也就是说
阅读全文


浙公网安备 33010602011771号