LinuxC .1 作业

来源:互联网 发布:tinyumbrella官网 mac 编辑:程序博客网 时间:2024/05/28 03:01

1.student用户登陆系统图形界面

开机后出现一个登陆界面,选择student用户,输入密码登陆。

2.打开一个bash

1)方法一:Applications->Favorites->Terminal

   方法二:单击右键

   方法三:快捷方式:System Tools ->setting ->Custom Shortcuts ->

              Name:      open_a_terminal

              Command:   gnome-terminal

3.修改student的密码,把密码更新成”westos”

 passwd student

4.显示当前系统时间

 date

5.显示当前系统时间,显示格式为:"小时:分钟:秒 AM/PM"(AM/PM为上下午标识)

 date +%r

6.显示“/usr/bin/clean-binary-files”的文件类型

 file /usr/bin/clean-binary-files

7.统计“/usr/bin/clean-binary-files”的文件大小

 ls -s /usr/bin/clean-binary-files

8.用快捷方式在shell中调用已经执行过的第4条命令

 !4

9.用快捷方式执行最近一条含有"date"关键字的命令

 Ctrl r date

10.用命令和正则表达式按照要求建立文件

*)用一条命令建立12个文件WESTOS_classX_linuxY(X的数值范围为1-2,Y的数值范围为1-6)

*)这些文件都包含在root用户桌面的study目录中

   

   mkdir  /root/Desktop/study

   cd  /root/Desktop/study

   touch WESTOS_class{1,2}_linux{1..6}

 

*)用一条命令建立8个文件redhat_versionX(x的范围为1-8)

*)redhat_virsionX这些文件都包含在/mnt目录中的VERSION中

 

   mkdir /mnt/VERSION

   touch  /mnt/VERSION/redhat_version{1..8}

11.管理刚才信建立的文件要求如下

*)用一条命令把redhat_versionX中的带有奇数的文件复制到桌面的SINGLE中

 

  mkdir /root/Desktop/SINGLE;cp /mnt/VERSION/*[1357]* /root/Desktop/SINGLE

 

*)用一条命令把redhat_versionX中的带偶数数的文件复制到/DOUBLE中

 

  mkdir /DOUBLE;cp /mnt/VERSION/redhat_version[2468] /DOUBLE

 

*)用一条命令把WESTOS_classX_linuxY中class1的文件移动到当前用户桌面的CLASS1中

 

mkdir /root/Desktop/CLASS1;mv /root/Desktop/study/*class1* /root/Desktop/CLASS1

 

*)用一条命令把WESTOS_classX_linuxY中class2的文件移动到当前用户桌面的CLASS2中

 

mkdir /root/Desktop/CLASS2;mv /root/Desktop/study/*class2* /root/Desktop/CLASS2

 

12.备份/etc目录中名字带有数字并且以.conf结尾的文件到桌面上的confdir中;

mkdir /root/Desktop/confdir

cp  /etc/*[[:digit:]]*.conf  /root/Desktop/confdir

0 0
原创粉丝点击