数据库
创建vlan命令?
一、创建vlan命令?
Switch>en
Switch#conft
Switch(config)#vlan10创建vlan10
Switch(config-vlan)#exit
Switch(config)#interf0/1
Switch(config-if)#switchportaccessvlan10把接口f0/1加入到vlan10中
补充:
直接在接口下:
Switch(config-if)#switchportaccessvlan10
这样交换机会自动创建vlan10
补充:
这不叫赖皮,是技巧,要么人家老师怎么会这样问呢.
二、MySQL创建数据库的命令、创建表的命令、插入语句的命令?
1.创建数据库
CREATEDATABASEIFNOTEXISTSRUNOOBDEFAULTCHARSETutf8COLLATEutf8_general_ci;
#如果数据库不存在则创建,存在则不创建
#创建RUNOOB数据库,设定编码为utf8
2.删除数据库
dropdatabaseRUNOOB;
3.选择数据库
useRUNOOB;
#使用数据库RUNOOB
4.数据类型
5.创建数据表
CREATETABLEtable_name(column_namecolumn_type,column_name2column_type2);
<etc>
CREATETABLEIFNOTEXISTS`runoob_tbl`(
`runoob_id`INTUNSIGNEDAUTO_INCREMENT,
`runoob_title`VARCHAR(100)NOTNULL,
`runoob_author`VARCHAR(40)NOTNULL,
`submission_date`DATE,
PRIMARYKEY(`runoob_id`)#主键
)ENGINE=InnoDBDEFAULTCHARSET=utf8;
来自<http://www.runoob.com/mysql/mysql-create-tables.html>
</etc>
#表明、字段名字外面的符号是反引号,为了区分mysql关键字和普通字符
6.删数据表
DROPTABLEtable_name;
#删除表内数据
deletefrom表明whererunoob_title=“exam”;
#清除表内数据,保留表结构
truncatetable表名;
#删除后立刻释放磁盘空间
optimizetable表名;
7.增插入数据到表
INSERTINTOtable_name(field1,field2,…)VALUES(value1,value2,"value"…);
#字符类型,value需要使用单/双引号。
三、Linux 创建文件命令如何使用?
在 Linux 系统中,有多个命令可以用于创建文件。以下是其中的几个常见的命令和使用方法:
- touch
touch
命令可以创建一个空文件,或者修改一个已经存在的文件的时间戳。touch filename
这会在当前目录下创建一个名为filename
的空文件。 - cat
cat
命令可以用于创建一个文件,并且向其中添加文本内容。cat > filename
这会创建一个名为filename
的文件,并进入输入模式。你可以输入你想要添加到文件中的文本,按下Ctrl+D
结束输入。 - echo
echo
命令可以将文本输出到终端或者文件中。echo
"text" > filename
这会创建一个名为filename
的文件,并将文本"text"
写入其中。 - vi/vim
vi
或vim
是一个文本编辑器,可以创建、打开、编辑和保存文件。vi filename
这会打开一个名为filename
的文件。你可以使用i
进入插入模式,输入你想要添加到文件中的文本。完成后,按下Esc
键退出插入模式,然后输入:wq
保存并退出编辑器。
除了以上这些命令,还有其他一些命令也可以用于创建文件,如 nano
、emacs
、gedit
等。
四、oracle创建用户的命令?
这是常用的创建用户的一个例子: CREATE USER XXXXX IDENTIFIED BY xxxxx PROFILE DEFAULT DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMPTS01 ACCOUNT UNLOCK; 请注意,你首先要确认你的数据库里是否有这二个表空间:USERS和TEMPTS01。如果没有,你先要创建表空间USERS及TEMPTS01,然后再创建用户。
当你创建用户时,应该定义它的表空间(default tablespace)。否则,它会使用系统表空间(system tablespace)。这是应该避免的。
五、创建脚本的命令是?
一般都是右键打开Linux的终端,然后是输入创建脚本命令:【nano 脚本名.sh】。
2.
然后第一行,输入:【#!/bin/sh】,这个说明使用bash shell。
3.
然后第二行,则可以输入你要的命令,输入完了,【Ctrl+o】回车保存脚本。
六、创建视图的命令是?
modify view 命令 请参阅 显示视图设计器,从中可以修改已存在的 SQL 视图。 语法 MODIFY VIEW ViewName [REMOTE] 参数 ViewName 指定要修改的视图名称。
REMOTE 指定该视图是一个使用远程表的远程视图。如果省略 REMOTE 子句,可以修改一个基于本地表的视图。 说明 使用 CREATE SQL VIEW 命令创建 SQL 视图。 包含 SQL 视图的数据库必须以独占方式打开。要以独占方式打开数据库,在 OPEN DATABASE 命令中包含 EXCLUSIVE 子句。
七、cad 表格创建命令?
快捷键命令:TABLE
启动浩辰CAD,新建一张图纸,使用快捷键【TAB】调出【插入表格】 对话框,根据实际需求设置表格样式、插入方式、行列、单元样式,并可在左侧的预览框中进行预览。
CAD表格创建教程
创建表格后,单击单元格,即可弹出【表格编辑】工具栏,对表格进行插入、合并、拆分等各项操作。
CAD表格创建教程
双击单元格,则会弹出【多行文字】编辑器,可对表格内容进行编辑。
CAD表格创建教程
直接复制粘贴EXCEL表格
快捷键命令:CTRL+C、CTRL+V
打开需要复制的EXCEL表格,选中后,【CTRL+C】复制。
八、Linux中cp命令创建链接与ln命令创建链接的区别?
cp -l & ln 硬链接(单个文件)我实验了下,好像没区别,都无法跨越FS。cp -s & ln -scp -s 目录 无法使用ln -s 目录,文件均可其它结果,自己试试吧。
九、access创建的数据库文件有哪些?
access数据库可创建7种数据库对象,它们分别是 "表"、"查询"、"窗体"、"报表"、"页"、"宏"和"模块"。
十、Linux 创建文件命令是如何实现的?
Linux 创建文件命令,也就是touch命令呗~
此命令系统自带,官方提供源文件,请下载官方utilities,查看其源代码,如下:
Coreutils - GNU core utilities源代码可以分为以下几个主要步骤:
- 初始化和解析命令行参数:
使用getopt_long函数解析命令行参数,识别各种选项(如-a,-c,-d,-h,-m,-r,-t等)并设置相应的变量。
- 遍历文件列表并更新时间戳:
对于命令行参数中指定的每个文件,执行以下操作:
a. 尝试打开文件,如果需要创建文件(没有指定-c选项),则创建一个空文件。
b. 根据前面的设置,更新文件的访问和修改时间戳。如果指定了-h选项并且文件是符号链接,那么会更新符号链接本身的时间戳。
c. 关闭文件并记录操作结果。
- 基于所有文件的操作结果返回退出状态:
如果所有文件的时间戳都已成功更新,则返回成功退出状态(EXIT_SUCCESS);否则,返回错误退出状态(EXIT_FAILURE)。
C实现如下:
#include <config.h>
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
#include <assert.h>
#include "system.h"
#include "argmatch.h"
#include "error.h"
#include "fd-reopen.h"
#include "parse-datetime.h"
#include "posixtm.h"
#include "posixver.h"
#include "quote.h"
#include "stat-time.h"
#include "utimens.h"
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "touch"
#define AUTHORS \
proper_name ("Paul Rubin"), \
proper_name ("Arnold Robbins"), \
proper_name ("Jim Kingdon"), \
proper_name ("David MacKenzie"), \
proper_name ("Randy Smith")
/* Bitmasks for `change_times'. */
#define CH_ATIME 1
#define CH_MTIME 2
/* Which timestamps to change. */
static int change_times;
/* (-c) If true, don't create if not already there. */
static bool no_create;
/* (-r) If true, use times from a reference file. */
static bool use_ref;
/* (-h) If true, change the times of an existing symlink, if possible. */
static bool no_dereference;
/* If true, the only thing we have to do is change both the
modification and access time to the current time, so we don't
have to own the file, just be able to read and write it.
On some systems, we can do this if we own the file, even though
we have neither read nor write access to it. */
static bool amtime_now;
/* New access and modification times to use when setting time. */
static struct timespec newtime[2];
/* File to use for -r. */
static char *ref_file;
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
{
TIME_OPTION = CHAR_MAX + 1
};
static struct option const longopts[] =
{
{"time", required_argument, NULL, TIME_OPTION},
{"no-create", no_argument, NULL, 'c'},
{"date", required_argument, NULL, 'd'},
{"reference", required_argument, NULL, 'r'},
{"no-dereference", no_argument, NULL, 'h'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
};
/* Valid arguments to the `--time' option. */
static char const* const time_args[] =
{
"atime", "access", "use", "mtime", "modify", NULL
};
/* The bits in `change_times' that those arguments set. */
static int const time_masks[] =
{
CH_ATIME, CH_ATIME, CH_ATIME, CH_MTIME, CH_MTIME
};
/* Store into *RESULT the result of interpreting FLEX_DATE as a date,
relative to NOW. If NOW is null, use the current time. */
static void
get_reldate (struct timespec *result,
char const *flex_date, struct timespec const *now)
{
if (! parse_datetime (result, flex_date, now))
error (EXIT_FAILURE, 0, _("invalid date format %s"), quote (flex_date));
}
/* Update the time of file FILE according to the options given.
Return true if successful. */
static bool
touch (const char *file)
{
bool ok;
int fd = -1;
int open_errno = 0;
struct timespec const *t = newtime;
if (STREQ (file, "-"))
fd = STDOUT_FILENO;
else if (! (no_create || no_dereference))
{
/* Try to open FILE, creating it if necessary. */
int default_permissions =
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
fd = fd_reopen (STDIN_FILENO, file,
O_WRONLY | O_CREAT | O_NONBLOCK | O_NOCTTY,
default_permissions);
/* Don't save a copy of errno if it's EISDIR, since that would lead
touch to give a bogus diagnostic for e.g., `touch /' (assuming
we don't own / or have write access to it). On Solaris 5.6,
and probably other systems, it is EINVAL. On SunOS4, it's EPERM. */
if (fd == -1 && errno != EISDIR && errno != EINVAL && errno != EPERM)
open_errno = errno;
}
if (change_times != (CH_ATIME | CH_MTIME))
{
/* We're setting only one of the time values. */
if (change_times == CH_MTIME)
newtime[0].tv_nsec = UTIME_OMIT;
else
{
assert (change_times == CH_ATIME);
newtime[1].tv_nsec = UTIME_OMIT;
}
}
if (amtime_now)
{
/* Pass NULL to futimens so it will not fail if we have
write access to the file, but don't own it. */
t = NULL;
}
ok = (fdutimensat (fd, AT_FDCWD, (fd == STDOUT_FILENO ? NULL : file), t,
(no_dereference && fd == -1) ? AT_SYMLINK_NOFOLLOW : 0)
== 0);
if (fd == STDIN_FILENO)
{
if (close (STDIN_FILENO) != 0)
{
error (0, errno, _("closing %s"), quote (file));
return false;
}
}
else if (fd == STDOUT_FILENO)
{
/* Do not diagnose "touch -c - >&-". */
if (!ok && errno == EBADF && no_create)
return true;
}
if (!ok)
{
if (open_errno)
{
/* The wording of this diagnostic should cover at least two cases:
- the file does not exist, but the parent directory is unwritable
- the file exists, but it isn't writable
I think it's not worth trying to distinguish them. */
error (0, open_errno, _("cannot touch %s"), quote (file));
}
else
{
if (no_create && errno == ENOENT)
return true;
error (0, errno, _("setting times of %s"), quote (file));
}
return false;
}
return true;
}
void
usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
printf (_("Usage: %s [OPTION]... FILE...\n"), program_name);
fputs (_("\
Update the access and modification times of each FILE to the current time.\n\
\n\
A FILE argument that does not exist is created empty, unless -c or -h\n\
is supplied.\n\
\n\
A FILE argument string of - is handled specially and causes touch to\n\
change the times of the file associated with standard output.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-a change only the access time\n\
-c, --no-create do not create any files\n\
-d, --date=STRING parse STRING and use it instead of current time\n\
-f (ignored)\n\
"), stdout);
fputs (_("\
-h, --no-dereference affect each symbolic link instead of any referenced\n\
file (useful only on systems that can change the\n\
timestamps of a symlink)\n\
-m change only the modification time\n\
"), stdout);
fputs (_("\
-r, --reference=FILE use this file's times instead of current time\n\
-t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time\n\
--time=WORD change the specified time:\n\
WORD is access, atime, or use: equivalent to -a\n\
WORD is modify or mtime: equivalent to -m\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
fputs (_("\
\n\
Note that the -d and -t options accept different time-date formats.\n\
"), stdout);
emit_ancillary_info ();
}
exit (status);
}
int
main (int argc, char **argv)
{
int c;
bool date_set = false;
bool ok = true;
char const *flex_date = NULL;
initialize_main (&argc, &argv);
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
atexit (close_stdout);
change_times = 0;
no_create = use_ref = false;
while ((c = getopt_long (argc, argv, "acd:fhmr:t:", longopts, NULL)) != -1)
{
switch (c)
{
case 'a':
change_times |= CH_ATIME;
break;
case 'c':
no_create = true;
break;
case 'd':
flex_date = optarg;
break;
case 'f':
break;
case 'h':
no_dereference = true;
break;
case 'm':
change_times |= CH_MTIME;
break;
case 'r':
use_ref = true;
ref_file = optarg;
break;
case 't':
if (! posixtime (&newtime[0].tv_sec, optarg,
PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS))
error (EXIT_FAILURE, 0, _("invalid date format %s"),
quote (optarg));
newtime[0].tv_nsec = 0;
newtime[1] = newtime[0];
date_set = true;
break;
case TIME_OPTION: /* --time */
change_times |= XARGMATCH ("--time", optarg,
time_args, time_masks);
break;
case_GETOPT_HELP_CHAR;
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
usage (EXIT_FAILURE);
}
}
if (change_times == 0)
change_times = CH_ATIME | CH_MTIME;
if (date_set && (use_ref || flex_date))
{
error (0, 0, _("cannot specify times from more than one source"));
usage (EXIT_FAILURE);
}
if (use_ref)
{
struct stat ref_stats;
/* Don't use (no_dereference?lstat:stat) (args), since stat
might be an object-like macro. */
if (no_dereference ? lstat (ref_file, &ref_stats)
: stat (ref_file, &ref_stats))
error (EXIT_FAILURE, errno,
_("failed to get attributes of %s"), quote (ref_file));
newtime[0] = get_stat_atime (&ref_stats);
newtime[1] = get_stat_mtime (&ref_stats);
date_set = true;
if (flex_date)
{
if (change_times & CH_ATIME)
get_reldate (&newtime[0], flex_date, &newtime[0]);
if (change_times & CH_MTIME)
get_reldate (&newtime[1], flex_date, &newtime[1]);
}
}
else
{
if (flex_date)
{
struct timespec now;
gettime (&now);
get_reldate (&newtime[0], flex_date, &now);
newtime[1] = newtime[0];
date_set = true;
/* If neither -a nor -m is specified, treat "-d now" as if
it were absent; this lets "touch" succeed more often in
the presence of restrictive permissions. */
if (change_times == (CH_ATIME | CH_MTIME)
&& newtime[0].tv_sec == now.tv_sec
&& newtime[0].tv_nsec == now.tv_nsec)
{
/* Check that it really was "-d now", and not a time
stamp that just happens to be the current time. */
struct timespec notnow, notnow1;
notnow.tv_sec = now.tv_sec ^ 1;
notnow.tv_nsec = now.tv_nsec;
get_reldate (¬now1, flex_date, ¬now);
if (notnow1.tv_sec == notnow.tv_sec
&& notnow1.tv_nsec == notnow.tv_nsec)
date_set = false;
}
}
}
/* The obsolete `MMDDhhmm[YY]' form is valid IFF there are
two or more non-option arguments. */
if (!date_set && 2 <= argc - optind && posix2_version () < 200112
&& posixtime (&newtime[0].tv_sec, argv[optind],
PDS_TRAILING_YEAR | PDS_PRE_2000))
{
newtime[0].tv_nsec = 0;
newtime[1] = newtime[0];
date_set = true;
if (! getenv ("POSIXLY_CORRECT"))
{
struct tm const *tm = localtime (&newtime[0].tv_sec);
error (0, 0,
_("warning: `touch %s' is obsolete; use "
"`touch -t %04ld%02d%02d%02d%02d.%02d'"),
argv[optind],
tm->tm_year + 1900L, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
}
optind++;
}
if (!date_set)
{
if (change_times == (CH_ATIME | CH_MTIME))
amtime_now = true;
else
newtime[1].tv_nsec = newtime[0].tv_nsec = UTIME_NOW;
}
if (optind == argc)
{
error (0, 0, _("missing file operand"));
usage (EXIT_FAILURE);
}
for (; optind < argc; ++optind)
ok &= touch (argv[optind]);
exit (ok ? EXIT_SUCCESS : EXIT_FAILURE);
}
热点信息
-
在Python中,要查看函数的用法,可以使用以下方法: 1. 使用内置函数help():在Python交互式环境中,可以直接输入help(函数名)来获取函数的帮助文档。例如,...
-
一、java 连接数据库 在当今信息时代,Java 是一种广泛应用的编程语言,尤其在与数据库进行交互的过程中发挥着重要作用。无论是在企业级应用开发还是...
-
一、idea连接mysql数据库 php connect_error) { die("连接失败: " . $conn->connect_error);}echo "成功连接到MySQL数据库!";// 关闭连接$conn->close();?> 二、idea连接mysql数据库连...
-
要在Python中安装modbus-tk库,您可以按照以下步骤进行操作: 1. 确保您已经安装了Python解释器。您可以从Python官方网站(https://www.python.org)下载和安装最新版本...