linux getopts命令,处理shell脚本参数
#!/bin/bash
while getopts "ab:cd:" Option
# b and d take arguments
#
do
case $Option in
a) echo -e "a = $OPTIND";;
b) echo -e "b = $OPTIND $OPTARG";;
c) echo -e "c = $OPTIND";;
d) echo -e "d = $OPTIND $OPTARG";;
esac
done
shift $(($OPTIND - 1))
相关文档:
今天fedora挂了,为了备份数据用ubuntu的livecd来进行数据备份,从网上看到了一篇帖子,
http://www.linux-sxs.org/storage/fedora2ubuntu.html
解决了问题
内容如下:
Boot Ubuntu.
Install lvm2:
$ sudo apt-get install lvm2
Load the necessary module(s):
$ sudo modprobe dm-mod
Scan your system for LVM v ......
Linux系统在使用光盘、软盘或U盘时,必须先执行挂载(mount)命令。挂载命令会将这些存储介质指定成系统中的某个目录,以后直接访问相应目录即可读写存储介质上的数据。
1.挂载光盘
挂载光盘的命令如下:
# mount -t is09660 /dev/cdrom /mnt/cdrom
该命令将光盘挂载到/ ......
ls
ls 命令可以说是linux下最常用的命令之一。它有众多的选项,其中有很多是很有用的,你是否熟悉呢?下面列出了 ls 命令的绝大多数选项。
-a 列出目录下的所有文件,包括以 . 开头的隐含文件。
-b 把文件名中不可输出的字符用反斜杠加字符编号(就象在C语言里一样)的形式列出。
-c 输出文件的 i 节 ......
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <stdio.h>
#include <string>
#include <iostream>
#include <cstring>
using namespace std;
void peek_interfaces(int ......