论坛» 嵌入式开发» 软件与操作系统

菜鸟
2013-06-20 17:44 31楼

使用哪个组合键可以结束当前终端正在运行的前台进程?


ctrl + c

菜鸟
2013-06-20 17:47 32楼

ctrl-c, ctrl-z分别代表什么意思


ctrl-c:结束一个前台进程

ctrl-z: 挂起一个前台进程



菜鸟
2013-06-20 17:50 33楼

修改密码可以使用哪个指令?


passwd

会先提示输入旧密码,然后输入两遍新密码。

菜鸟
2013-06-20 19:52 34楼

使用crontab指令设置服务器周1-周5每天晚上11:00关机(注:关机指令为poweroff)。如何实现?


0 23 * * 1-5 poweroff
格式为 分 小时 天 月 星期 任务

菜鸟
2013-06-20 20:10 35楼

Linux系统的7种运行级别在哪个文件中有描述?常用的运行级别是哪两个?


0:关机

1:单用户模式,

2:多用户模式

3:字符界面的多用户模式

4:未定义

5:图形界面的多用户模式

6:重启


可用runlevel 指令查看运行模式。常用的话是字符界面与图形界面模式吧。

linux mint下的运行级别还多了一个S运行级别。在/etc/rc/目录下的文件中有描述。

菜鸟
2013-06-20 20:23 36楼

、在vi全屏幕文本编辑器中,在指令模式下键入哪条命令将实现文件的不保存强制退出效果。()
A. :qB. :q!C. :x D. ZZ

2. 2、当使用vi编辑一个文件时,在指令模式下,下面哪条命令能复制当前行的内容到剪贴板中。()
A. cc B. ddC. yyD. Ctrl+c

3. 3、下面哪条命令可把./dir1目录(包括它的所有子目录)内容复制到./dir2中?()
A. cp -i ./dir1/* ./dir2
B. cp -P ./dir1/* ./dir2
C. cp -d ./dir1/* ./dir2
D. cp -r ./dir1/* ./dir2

4. 4、在VIM中,快速跳转到第191行,应该使用的命令是()
A. GG B.1GC.191GD.191g

5. 5、在VIM中,在当前光标之前插入,应该使用的指令是(A);在当前光标之后插入,应该使用的指令是(B);在当前行之下插入应该使用的指令是(C)
A. i B.a C.o D.q

6. 6、下面哪一个是VIM的用户级别的配置文件()
A. /etc/vimrc B.~/vimrcC.~/.vimrcD.~/.vimcr

7. 7、权限将文件test.txt的权限修改为rw-r--r—应该使用的指令是()
A. chmod 644 test.txtB.chown 644 test.txt
C. chown 422 test.txt D.chgrp 644 test.txt

8. 8、修改目录dir及其目录下所有文件的属主和属组为sramedu,应该使用的指令是()
A. chgrp sramedu:sramedu dir B.chgrp –R sramedu:sramedu dir
C. chown sramedu:sramedu dirD.chown –R sramedu:sramedu dir

9. 9、/etc文件系统的标准应用是用于____?()
A. 安装附加的应用程序
B. 存放可执行程序、系统管理工具和库
C. 设置用户的主目录
D. 用于存放系统管理的配置文件

10. 10、有一个备份程序mybackup,需要在周一至周五下午1点和晚上8点各运行一次,下面哪条crontab的项可以完成这项工作?
A. 0 13,20 * * 1,5 mybackup
B. 0 13,20 * * 1,2,3,4,5 mybackup
C. * 1,8 * * 1,2,3,4,5 mybackup
D. 0 13,20 1,5 * * mybackup

11. 11、如何在文件中查找显示所有以"*"打头的行?
A. find \*file
B. wc -l*
C. grep –n *file

D. D grep \* file

12. 12、命令kill -9 1301的含义是():
A. 杀死pid为9和1301的进程
B. 强制杀死pid为1301的进程
C. 从1301开始,杀死9个进程
D. 重启1301进程

13. 13、对所有用户的变量设置,应当放在哪个文件下?
A. /etc/bashrc
B. /etc/profile
C. ~/.bash_profile
D. /etc/skel/.bashrc

14. 14、使用什么命令检测网络是否连通?
A. ping
B. route
C. netstat
D. ifconfig

15. 15、在bashshell环境下,当一命令正在执行时,按下control-z会:
A. 挂起前台任务
B. 给当前文件加上eof.
C. 将前台任务转入后台
D. 注销当前用户

菜鸟
2013-06-20 20:34 37楼

下面是man exports中的一段,尝试翻译:

Very often, it is not desirable that the root user on a clientmachine is also treated as root when accessing files on the NFS server. To this end, uid 0 is normally mapped to a different id: the so-called anonymous or nobody uid. This mode of operation(called ‘root squashing’) is the default, and can be turned off with no_root_squash.

By default, exportfs chooses a uid and gid of 65534 for squashed access. These values can also be overridden by the anonuid and anongid options. Finally, you can map all user requests to the anonymous uid by specifying the all_squash


通常,根用户进入NFS文件服务器操作文件时也被认为是根用户的话是不合适的。因此,用户名0通常被映射为不同的id:被称作为匿名或者无用户id。这种操作模式(也被叫做权限压缩)是默认操作模式,而且可以通过无权限压缩来关闭此模式。

默认的话,配置文件选择用户名和用户组名65534用于压缩权限访问。这个可以通过另外一个用户名和另外一个用户组名选项进行覆盖。最终,你可以通过指定压缩权限操作来映射所有的用户请求到匿名用户。

菜鸟
2013-07-14 22:42 38楼

开始第二阶段的学习,C语言的学习。第一课有10个练习题。自己试着编写了。


//求N的阶乘


#include


int main(void)
{
unsigned int n, i;
unsigned long result = 1;


printf("输入阶乘数N:");
scanf("%d", &n);


i = 1;
while(i <= n)
{
result *= i;
i++;
}
printf("%d的阶乘结果是:%ld", n, result);
}


菜鸟
2013-07-14 22:53 39楼

//输入10个整数,统计出整数之和,负数之和,奇数之和,偶数之和


#include


int main(void)
{
char i;
int a[10];
int pos_sum = 0, neg_sum = 0, odd_sum = 0, even_sum = 0;


printf("输入10个整数,空格键隔开:\n");
for(i=0;i<10;i++)
{
scanf("%d", &a[i]);
}

for(i=0; i<10 ;i++)
{
if(a[i] > 0)
pos_sum += a[i];
if(a[i] < 0)
neg_sum += a[i];
if(a[i] % 2)
odd_sum += a[i];
if(a[i] % 2 == 0)
even_sum += a[i];
}


printf("正数之和为:%d\n", pos_sum);
printf("负数之和为: %d\n", neg_sum);
printf("奇数之和为: %d\n", odd_sum);
printf("偶数之和为: %d\n", even_sum);
}

菜鸟
2013-07-14 22:54 40楼
//利用循环语句求1-1/3+1/5-1/7.。。+1/(2n-1)(100项的和)


#include


int main(void)
{
unsigned int i;
float result = 1;


for(i=1; i<=100; i++)
{
if (i % 2)
result -= 1.0/(2*i+1);
else
result += 1.0/(2*i+1);
}
printf("the result is %f", result);
}
共46条 4/5 |‹ 1 2 3 4 5 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册]