操作系统上机题目一、题目实验1:LINUX/UNIX Shell部分(一)系统基本命令1.登陆系统,输入whoami 和pwd ,确定自己的登录名和当前目录;登录名yuanye ,当前目录/home/yuanye2.显示自己的注册目录?命令在哪里?a.键入echo $HOME,确认自己的主目录;主目录为/home/yuanyeb.键入echo $PA TH,记下自己看到的目录表;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/gamesc.键入which abcd,看看得到的错误信息;再键入which ls 和which vi,对比刚刚得到的结果的目录是否在a.、b.两题看到的目录表中;/bin/ls /usr/bin/vi3.ls 和cd 的使用:a.键入ls,ls -l ,ls -a ,ls -al 四条命令,观察输出,说明四种不同使用方式的区别。
1. examples.desktop 公共的模板视频图片文档音乐桌面; 总计322.-rw-r--r-- 1 yuanye yuanye 357 2011-03-22 22:15 examples.desktopdrwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 公共的drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 模板drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 视频drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 图片drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 文档drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 音乐drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 桌面3. . .fontconfig .local .Xauthority.. .gconf .mozilla .xsession-errors.bash_logout .gconfd .nautilus 公共的.bashrc .gksu.lock .profile 模板.cache .gnome2 .pulse 视频.chewing .gnome2_private .pulse-cookie 图片.config .gnupg .recently-used.xbel 文档.dbus .gstreamer-0.10 .scim 音乐.dmrc .gtk-bookmarks .sudo_as_admin_successful 桌面.esd_auth .gvfs .update-manager-coreexamples.desktop .ICEauthority .update-notifier4. 总计156drwxr-xr-x 28 yuanye yuanye 4096 2011-03-24 16:55 .drwxr-xr-x 3 root root 4096 2011-03-22 22:15 ..-rw-r--r-- 1 yuanye yuanye 220 2011-03-22 22:15 .bash_logout-rw-r--r-- 1 yuanye yuanye 3115 2011-03-22 22:15 .bashrcdrwxr-xr-x 3 yuanye yuanye 4096 2011-03-22 23:30 .cachedrwx------ 2 yuanye yuanye 4096 2011-03-22 23:24 .chewingdrwxr-xr-x 4 yuanye yuanye 4096 2011-03-22 23:30 .configdrwx------ 3 yuanye yuanye 4096 2011-03-22 22:31 .dbus-rw------- 1 yuanye yuanye 49 2011-03-24 16:54 .dmrc-rw------- 1 yuanye yuanye 16 2011-03-22 22:31 .esd_auth-rw-r--r-- 1 yuanye yuanye 357 2011-03-22 22:15 examples.desktopdrwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:15 .fontconfigdrwx------ 4 yuanye yuanye 4096 2011-03-24 16:54 .gconfdrwx------ 2 yuanye yuanye 4096 2011-03-24 16:56 .gconfd-rw-r----- 1 yuanye yuanye 0 2011-03-22 23:19 .gksu.lockdrwx------ 6 yuanye yuanye 4096 2011-03-22 23:20 .gnome2drwx------ 2 yuanye yuanye 4096 2011-03-22 22:32 .gnome2_privatedrwx------ 2 yuanye yuanye 4096 2011-03-22 22:31 .gnupgdrwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 22:32 .gstreamer-0.10-rw-r--r-- 1 yuanye yuanye 156 2011-03-24 16:55 .gtk-bookmarksdr-x------ 2 yuanye yuanye 0 2011-03-24 16:54 .gvfs-rw------- 1 yuanye yuanye 479 2011-03-24 16:54 .ICEauthoritydrwx------ 3 yuanye yuanye 4096 2011-03-22 23:30 .localdrwx------ 4 yuanye yuanye 4096 2011-03-22 23:29 .mozilladrwxr-xr-x 3 yuanye yuanye 4096 2011-03-22 22:32 .nautilus-rw-r--r-- 1 yuanye yuanye 675 2011-03-22 22:15 .profiledrwx------ 2 yuanye yuanye 4096 2011-03-24 16:54 .pulse-rw------- 1 yuanye yuanye 256 2011-03-22 22:31 .pulse-cookie-rw------- 1 yuanye yuanye 861 2011-03-22 23:30 .recently-used.xbeldrwx------ 3 yuanye yuanye 4096 2011-03-22 23:24 .scim-rw-r--r-- 1 yuanye yuanye 0 2011-03-22 22:35 .sudo_as_admin_successful drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 22:33 .update-manager-core drwx------ 2 yuanye yuanye 4096 2011-03-22 22:32 .update-notifier-rw------- 1 yuanye yuanye 117 2011-03-24 16:54 .Xauthority-rw-r--r-- 1 yuanye yuanye 3385 2011-03-24 16:56 .xsession-errorsdrwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 公共的drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 模板drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 视频drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 图片drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 文档drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 音乐drwxr-xr-x 2 yuanye yuanye 4096 2011-03-22 23:25 桌面b.利用cd 转到/bin,/sbin ,/etc ,/dev,再利用ls 列出各个目录的内容,如果"迷路",可以利用pwd 确定位置,或键入cd ,cd ~ 观察效果.cd ,cd ~的区别: 1. bash dnsdomainname mountpoint sleepbunzip2 dumpkeys mt sttybzcat echo mt-gnu subzcmp ed mv syncbzdiff egrep nano tailfbzegrep false nc tarbzexe fgconsole nc.traditional tempfilebzfgrep fgrep netcat touchbzgrep fuser netstat truebzip2 fusermount ntfs-3g ulockmgr_serverbzip2recover grep ntfs-3g.probe umountbzless gunzip open unamebzmore gzexe openvt uncompresscat gzip pidof unicode_startchgrp hostname ping vdirchmod ip ping6 whichchown kbd_mode ps zcatchvt kill pwd zcmpcp ld_static rbash zdiffcpio ln readlink zegrepdash loadkeys rm zfgrepdate login rmdir zforcedbus-cleanup-sockets ls rnano zgrepdbus-daemon lsmod run-parts zlessdbus-uuidgen mkdir sed zmoredd mknod setfont znewdf mktemp setupcondir more shdmesg mount sh.distrib2. acpi_available getty mii-tool resize_reiserfsalsa grub-install mkdosfs rmmodalsactl halt mke2fs routeapm_available hdparm mkfs rtacctapparmor_parser hwclock mkfs.bfs rtmonbadblocks ifconfig mkfs.cramfs runlevelblkid ifdown mkfs.ext2 sfdisk blockdev ifup mkfs.ext3 shadowconfig brltty init mkfs.ext4 shutdownbrltty-setup initctl mkfs.ext4dev slattachcfdisk insmod mkfs.minix sscrda installkernel mkfs.msdos startctrlaltdel ip mkfs.reiserfs start-stop-daemon debugfs ip6tables mkfs.vfat status debugreiserfs ip6tables-restore mkreiserfs stopdepmod ip6tables-save mkswap sulogin dhclient ipmaddr modinfo swapoff dhclient3 iptables modprobe swapon dhclient-script iptables-restore mount.fuse sysctldmsetup iptables-save mount.ntfs syslogddosfsck iptunnel mount.ntfs-3g tcdosfslabel isosize mount.vmhgfs telinitdumpe2fs iwconfig nameif tune2fse2fsck iwevent on_ac_power udevadme2image iwgetid pam_tally udevde2label iwlist parted umount.hale2undo iwpriv partprobe unix_chkpwd fdisk iwspy pccardctl unix_update findfs kbdrate pivot_root update-grubfsck killall5 plipconfig usplashfsck.cramfs klogd poweroff usplash_down fsck.ext2 ldconfig rarp usplash_write fsck.ext3 ldconfig.real raw vol_idfsck.ext4 logd readahead-list vstpfsck.ext4dev logsave readahead-watch wpa_action fsck.minix losetup reboot wpa_clifsck.msdos lrm-manager regdbdump wpa_supplicant fsck.nfs lsmod reiserfsckfsck.reiserfs lspcmcia reiserfstunefsck.vfat MAKEDEV resize2fs3. acpi login.defsadduser.conf logrotate.confadjtime logrotate.dalsa lsb-basealternatives lsb-base-logging.shanacrontab lsb-releaseapm ltrace.conf apparmor magicapparmor.d magic.mimeapport mailcapapt mailcap.orderat.deny manpath.configavahi mime.typesbash.bashrc mke2fs.confbash_completion modprobe.dbash_completion.d modules bindresvport.blacklist monoblkid.tab motdblkid.tab.old motd.tailbluetooth mtabbogofilter.cf mtools.confbonobo-activation nanorcbrlapi.key netscsid.confbrltty networkbrltty.conf NetworkManagerca-certificates networksca-certificates.conf nsswitch.confcalendar obex-data-server chatscripts openoffice checkbox.d optcompizconfig pam.conf ConsoleKit pam.dconsole-setup pangoconsole-tools papersizecron.d passwdcron.daily passwd-cron.hourly pcmciacron.monthly perlcrontab pmcron.weekly pnm2ppa.confcups PolicyKitdbus-1 popularity-contest.conf debconf.conf powerdebian_version pppdefault profiledefoma profile.ddeluser.conf protocolsdepmod.d pulse dhcp3 purple dictionaries-common pythondm python2.6 doc-base rc0.ddpkg rc1.de2fsck.conf rc2.d emacs rc3.d environment rc4.d esound rc5.d event.d rc6.d firefox-3.0 rc.localfonts rcS.d foomatic readahead fstab resolvconf fuse.conf resolv.conf gai.conf rmtgamin rpcgconf samba gdm sane.d gimp scim gnome screenrc gnome-app-install scsi_id.config gnome-system-tools securetty gnome-vfs-2.0 security gnome-vfs-mime-magic sensors.conf gre.d services groff sgmlgroup shadow group- shadow- grub.d shells gshadow skel gshadow- soundgtk-2.0 sshhal ssl hdparm.conf sudoers hesiod.conf sysctl.conf host.conf sysctl.d hostname syslog.conf hosts terminfo hosts.allow timezonehosts.deny tpvmlp.confhp ts.confifplugd ucf.confinit.d udevinitramfs-tools ufwinputrc updatedb.confiproute2 updatedb.conf.BeforeVMwareToolsInstallissue update-manager update-motd.dkbd update-notifierkernel usplash.confkernel-img.conf vimlaptop-mode vmware-toolsldap w3mld.so.cache wgetrcld.so.conf wodim.confld.so.conf.d wpa_supplicantlftp.conf X11libpaper.d xdglocale.alias xmllocaltime xulrunner-1.9logcheck zsh_command_not_foun4. adsp loop7 ram7 tty15 tty43 usbdev1.1_ep00agpgart lp0 ram8 tty16 tty44 usbdev1.1_ep81audio mapper ram9 tty17 tty45 usbdev2.1_ep00block mem random tty18 tty46 usbdev2.1_ep81bus midi rtc tty19 tty47 usbmon0cdrom1 mixer rtc0 tty2 tty48 usbmon1char net scd0 tty20 tty49 usbmon2console network_latency sda tty21 tty5 vcscore network_throughput sda1 tty22 tty50 vcs1cpu_dma_latency null sda2 tty23 tty51 vcs2disk oldmem sda5 tty24 tty52 vcs3dmmidi parport0 sequencer tty25 tty53 vcs4dsp pktcdvd sequencer2 tty26 tty54 vcs5ecryptfs port sg0 tty27 tty55 vcs6fd ppp sg1 tty28 tty56 vcs7fd0 psaux shm tty29 tty57 vcs8full ptmx snapshot tty3 tty58 vcsafuse pts snd tty30 tty59 vcsa1hpet ram0 sndstat tty31 tty6 vcsa2initctl ram1 sr0 tty32 tty60 vcsa3input ram10 stderr tty33 tty61 vcsa4kmem ram11 stdin tty34 tty62 vcsa5kmsg ram12 stdout tty35 tty63 vcsa6log ram13 tty tty36 tty7 vcsa7loop0 ram14 tty0 tty37 tty8 vcsa8loop1 ram15 tty1 tty38 tty9 vmciloop2 ram2 tty10 tty39 ttyS0 vsockloop3 ram3 tty11 tty4 ttyS1 xconsoleloop4 ram4 tty12 tty40 ttyS2 zeroloop5 ram5 tty13 tty41 ttyS3loop6 ram6 tty14 tty42 urandom区别:(二)基本操作1.用cp 将/usr/share 目录下的exercise 子目录连同目录下的文件拷贝到自己的主目录下,然后进入自己的exercise 目录:cp -r /usr/share ./.2.输入/输出重定向和cat,more 等显示命令的配合使用:a.输入cat 命令列出目录下longtext 文件中的内容;b.输入cat 命令列出目录下longtext 文件中的内容,是否发现一屏显示不完?c.使用more 命令列出longtext 的内容;d.输入cat hello.txt> hello2.txt,再输入cat hello.txt>>hello2.txt,再检查hello2.txt的内容有何变化;说明>与>>的区别。