`
textboy
  • 浏览: 20352 次
  • 性别: Icon_minigender_1
  • 来自: 广州
最近访客 更多访客>>
社区版块
存档分类
最新评论

CMD List [1]

阅读更多

cmd.xls

 

1.1         alias

 

Create an alias for a command or shows which aliases exist. v.s. unalias.

 

Syntax             alias [name = [“command”]]

 

Option or argument

Function

Name

Specifies the alias name.

Command

Specifies the command the name should be an alias for.

 

Sample:

 

Type alias d=’ls –l’, you have just created a new command, d, which is the same as ls –l. To see which aliases you have defined, just type alias.

alias dir='ls -tFg |more'

 

 

1.2         aclget

show access control (AIX), similar with getfacl in solaris. (ls –l just show base information)

 

1.3         basename

Syntax: basename pathname [suffix].

Return filename only.

e.g.

basename /u/dee/desktop/cns.boo cns.boo result: cns.boo

basename /u/dee/desktop/cns.boo .boo result: cns

sh_name=`basename $0 | cut -f1 -d'.'`

 

1.4         bc

Precition.

Option or argument

Function

-l

Set the scale variable to 20.

 

Sample:

echo "9/2" | bc

4

echo "9.5/2" | bc

4

echo "9/2" | bc -l

4.50000000000000000000

echo "9.5/2" | bc -l

4.75000000000000000000

 

1.5         cat

 

Displays a file on-screen. stop at the bottom of file. Relate: more.

 

Syntax             cat filename

 

Option or argument

Function

-n

Add line number.

 

Sample:

 

Type >cat bonus.plan

 

You can also use the cat command (which stands for catenate) to combine two or more files, like this:

 

cat file1 file2 file3 > one.big.file

cat test.sh test.sh test.sh | wc

 

1.6         cd

 

Changes the current working directory to the directory you indicate.

 

To move back to your home directory, type cd without any arguments.

 

To move to a directory that is not a subdirectory of the current working directory, you can use a full pathname – one that begins with a slash. For example, to look around in the /home directory (where all home directories are stored on some systems), type >cd /home

 

If you want to move to the last directory you were in, type >cd -.

 

Syntax             cd [directory]

 

Option or argument

Function

directory

Specifies the directory you want to move to. This directory becomes your current working directory. If you don’t use this option, you move to your home directory.

 

Sample:

You log in and do some work in your home directory. Next you want to move into your budget directory to see which files are there. Type cd budget.

 

Type cd .. to move back up to the parent directory of budget. Sometime you might want to go up to more than one level of the parent directory, type “cd ../..”, you can go back up two levels of parent directory.

 

Type cd to move back default path (check default path via echo $HOME).

 

1.7         chgrp

Changes the group ownership of a file or directory.

chgrp [parameter] Group {File | Directory}

 

1.8         chmod

 

Changes the permissions for a file/directory. You have to own the file or directory to use this command.

 

If you leave the who letter out of the permission, chmod assigns the permission to everyone.

 

Refer to any detail, see Section 2.3.2 of this document.

Syntax             chmod [-Rcfv] [-recursive] [-changes] [-silent] [-quiet] [verbose]

 

permission - drwxrwxrwx

d       - directory

x       - can use the file name as an argument in a command

first rwx    - for owner

second rwx      - for group

third rwx   - for other (except the group)

 

r = 4, w = 2, x = 1.

e.g.

chmod 744 /hsbc/bcn/load/cmb_ocpr_pl_mh_conv1.id   = -rwxr--r—

 

ls -l | awk '{if($1=="-rw-r-----") print $9}' | xargs chmod 644

Change mode in a batch.

 

1.9         chown

Changes the owner or group associated with a file.

Chown [parameter] Owner [:Group] {File | Directory }

 

1.10     clear

 

Clears the screen. This command does not affect files or jobs – it just clears the clutter from your screen.

 

Syntax             clear

 

1.11     cmp

compare 2 binary files. Refer diff.

1.12     cp

 

Copies files/directory. Unlike in DOS, if you want to copy a file to current directory, you have to use a period (.) at the end of the command like, such as “cp file101”.

 

Syntax             cp [-i] oldfiles newfiles

         cp [-i] [-R] oldfiles directory[/newfiles]

 

Option or argument

Function

-i

Asks before you replace an existing file with a copied file.

-r

Copies file hierarchies under the file or directory specified by the SourceFile or SourceDirectory parameter (recursive copy).

-R

When you copy a directory, also copies its subdirectories and creates new subdirectories as necessary.

-f

Specifies removal of the target file if it cannot be opened for write operations.

-h

Forces the cp command to copy symbolic links.

-p

Duplicates characteristics like time, permission, user /group ID.

oldfiles

Specifies the name of the file you want to copy.

newfiles

Specifies the name to give to the new copy.

directory

Specifies the name of the directory in which you want to store a copy.

 

Sample:

 

Type cp /home/harold/margys.feb.expenses february.expenses

 

By including both a path and a filename to copy to, you tell cp to copy the file from the /home/harold/ directory and to name the new copy february.expenses.

 

cp -Rph /hsbc/bsg/databak/. /hsbc/bsg/data

 

1.13     ctmfw

ctmfw FILE(absolute path)

      < mode (CREATE|DELETE)>  Default: CREATE

      < minimum detected size <number>

        [' '|Bytes(B)|Kilo(K)|Mega(M)|Giga(G)] >Default:0

      < interval between file search (seconds) > Default: 60sec

      < interval between filesize comparison iterations (seconds) > Default: 10sec

      < number of iterations while the size is static >  Default: 3 iterations

      < time limit for the process (minutes).>  Default: 0 (no time limit)

        Effective while the file does not exists or,

        the file size is static and the minimum size

        was not reached >

      <  monitor file size , minimal and maximal age, when wildcard is used > Default: N

      < starting  time for detecting files (HHMM or YYYYMMDDHHMM > Default: NOW

      < absolute stop time (HHMM or YYYYMMDDHHMM > Default: +0000 ( No stop time )

      < minimal age of file (modified time)

        format:xxxxYxxxxMxxxxDxxxxHxxxxMin  > Default: NO_MIN_AGE 

      < maximal age of file ( timestamp monitoring )

        format:xxxxYxxxxMxxxxDxxxxHxxxxMin  > Default: NO_MAX_AGE

 

e.g. ctmfw /hsbc/wsd/indata/qwin/pdb2/tbbstxdh.ok CREATE 0 300 10 30 60)

1.14     cut

Option or argument

Function

-d Character

specify delimiter. Default tab. E.g. cut -f1 -d'.'

-f List

e.g. -f 1,7  writes out only the first and seventh fields of each line. If a line contains no field delimiters, passes them.

 

1.15     date

%H   Displays the hour (24-hour clock) as a decimal number (00-23).

%M  Displays the minutes as a decimal number (00-59).

%Y   Displays the four-digit year as a decimal number.

e.g. date +%H%M

 

分享到:
评论

相关推荐

    CMDCMD命令CMD命令

    14. `tlist` 和 `kill`:这两个命令是用于查看和结束进程的,通常在系统调试和故障排除中使用。 15. `del` 和 `move`:文件管理命令,`del`用于删除文件,`/S /Q`选项可以递归删除目录及其内容而不提示,`move`用于...

    cmd管道技术向cmd发送字符

    如`dir /b | sort &gt; list.txt` 会排序目录中的文件并保存到`list.txt`,然后可以使用`fc /l list.txt list_sorted.txt` 比较排序前后的差异。 3. **统计分析**:`find`命令可以计数特定字符或字符串。如`type file....

    sqlcmd 参数详解

    * -L [ c ] list servers [ clean output ]:列出服务器。 * -p [ 1 ] print statistics [ colon format ]:打印统计信息。 * -X [ 1 ]:禁用命令、启动脚本和环境变量。 * -? show syntax summary:显示语法摘要。 ...

    java javascript 调用命令行 cmd

    List&lt;String&gt; commands = Arrays.asList("cmd", "/c", "dir"); ProcessBuilder pb = new ProcessBuilder(commands); Process process = pb.start(); ``` **JavaScript调用命令行** 在JavaScript中,由于安全...

    CMD网络命令大全123

    ##### 1. **`net use`** - **建立 IPC 空链接**: ```cmd net use ip\ipc$ user ``` 这条命令用于建立一个IPC空链接,通常用于远程访问或进行一些基本的操作。 - **建立 IPC 非空链接**: ```cmd ...

    Qt调用CMD启动外部程序Demo.zip

    process-&gt;start("cmd.exe", QStringList() ); ``` 这里,`"/c"`参数告诉CMD执行完`notepad.exe`后关闭,`notepad.exe`则是我们要启动的外部程序。 接下来,我们关注如何处理子进程的输出。QProcess提供了`...

    qt调用cmd命令和dll例子

    process.start("cmd.exe", QStringList() ); process.waitForFinished(); ``` 这里的`start`方法启动了CMD进程,并通过`/c`参数传递了执行"dir"命令的指令。`waitForFinished`确保我们等待命令执行完成后再继续执行...

    cmd中的重定向输出,管道

    在CMD中,标准输出通常使用数字`1`表示,而标准错误输出则使用数字`2`表示。通过使用`2&gt;&1`,我们可以将标准错误输出重定向到标准输出,从而将两者合并为一个输出流。例如: ```cmd mycommand &gt; mylog.txt 2&gt;&1 ```...

    linux 离线安装perl-IPC-Cmd

    1. `perl-devel-5.16.3-299.el7_9.x86_64.rpm`: 这是Perl开发包,包含头文件和开发工具,用于编译和创建Perl模块。 2. `perl-Test-Harness-3.28-3.el7.noarch.rpm`: 提供了测试框架,用于编写和运行Perl模块的测试...

    静态编译的trace-cmd,x86版本,v3.1.4

    1. **启动/停止追踪**: 使用`trace-cmd record`命令可以启动追踪,记录内核事件,而`trace-cmd stop`则可以停止记录。 2. **事件选择**: `trace-cmd list`可以列出所有可用的内核事件,用户可以根据需求选择要追踪...

    C# 传入自定义列表List 到Oracle存储过程

    cmd.Parameters.Add(new OracleParameter("p_list", oraArray)); cmd.ExecuteNonQuery(); ``` 5. **关闭连接**: 执行完存储过程后,别忘了关闭数据库连接。 通过这种方式,C#中的自定义列表(List)可以高效地...

    遍历CheckBoxList,获得选中项的值动态绑定CheckBoxList代码

    protected void Button1_Click(object sender, EventArgs e) { foreach (ListItem li in this.chklistA.Items) { if (li.Selected == true) { Response.Write(li.Text + " "); } } } ``` 在这段代码中,...

    java调用cmd创建目录和复制文件

    在Java编程中,有时我们需要执行一些系统级别的操作,如创建目录、复制文件等,这些操作在Windows系统中可以通过命令行接口(CMD)来完成。Java提供了Runtime类和ProcessBuilder类来实现这样的功能,允许我们调用...

    常用的一些cmd命令

    #### 1. **网络资源连接与断开** - `net use`:此命令用于建立或断开本地计算机与远程共享资源之间的连接。 - `net use $ "\\ip\ipc$" /user:""IPC`:通过IPC管道匿名访问远程计算机。 - `net use h: "\\ip\c$" /...

    cmd应用大全,经典不容错过

    1. **网络连接管理**: - `net use` 命令用于创建、删除或显示网络连接。例如,`net use \\ip\ipc$ "password" /user:"username"` 可以建立到远程计算机的IPC连接。 - `...

    Linux系统firewall-cmd 命令详解.docx

    * firewall-cmd --zone=dmz --list-ports 这将显示 dmz zone 中所有打开的端口。 firewall-cmd 命令还可以用于添加端口到 zone,例如: * firewall-cmd --zone=dmz --add-port=8080/tcp 这将添加 8080 端口到 ...

    CMD快速操作

    1. **网络操作**: - `net use`:用于连接或断开网络共享资源。例如,`net use ipipc$ "password" /user:"username"` 创建了一个IPC连接。 - `net start` 和 `net stop`:启动或停止系统服务,如`...

    CMD命令(自己的收藏啊)

    16. `tlist -t`和`kill -F`: 分别用于列出和结束进程,通常在Support Tools中。 17. `del`和`rmdir`: 用于删除文件和目录,`-F`选项可删除只读文件,`/S`和`/Q`分别用于删除目录及其内容,且不提示确认。 18. `...

    CMD命令大全 尤其网络设置

    - **`[Quidway] portmirror int_list observing-port int_type int_num`**:指定镜像源端口和目标端口。 ##### 5. 其他高级配置 - **`[Quidway] description string`**:指定VLAN的描述字符。 - **`[Quidway] ...

Global site tag (gtag.js) - Google Analytics