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

CMD List [5]

阅读更多

1.1         rmdir

 

Deletes (removes) a directory.

 

Syntax             rmdir directory

 

Option or argument

Function

Directory

Specifies the directory you want to delete. (The directory must be empty already.)

 

To delete a directory and all the files in it, you can use the rm –ir command (see rm, earlier in this section). You cannot delete the current working directory, so move to its parent (by typing cd..) before deleting a directory.

 

1.2         sleep

Syntax        sleep Seconds

 

1.3         sort

Option or argument

Function

-b

Ignore leading blanks.

-c

Check if sorted. A nonzero value is returned if the input file is not correctly sorted.

-d

Sorts using dictionary order (ignore special characters).

-f

Ignore the case (change lowercase into uppercase).

-k

Sort key. Two method:

-k KeyDefinition

FSkip.CSkip (obsolescent version).

 

-k [ FStart [ .CStart ] ] [ Modifier ] [ , [ FEnd [ .CEnd ] ][ Modifier ] ]

[+[FSkip1] [.CSkip1] [Modifier] ] [-[FSkip2] [.CSkip2] [Modifier]]

 

-k[start field].[start column][option],[end field].[end column][option]

+[skip fields].[skip columns] [-option] -[skip fields to the end].[skip columns to the end] [-option]

 

e.g.

sort -t: -k2,2 n -k1,1 r vegetables

or

sort -t: +1 -2 -n +0 -1 -r vegetables

 

-k 3.2b,3r

or

+2.1b -3r

 

Note: The maximum number of fields on a line is 10.

-m

Merges multiple input files; the input are assumed to be already sorted.

-n

Sort in numeric order rather than alphabetic order.

-o

Output to outfile.

-r

Reverse order.

-tCharacter

Specifies single field separator character.

-u

Remove duplicate lines (deduplicate).

 

1.4         su

su [-] [ username  [ arg...]]

 

su become another user without logging off. The default user name is root (superuser). If (-) add can prevent the exception of $PATH. ( it is forbidden in some system as it can log in with root account)

e.g.

su - user2

 

1.5         sub

replace string.

sub (regexp,replacement_string,in_string), success return 1, not found return 0.

 

1.6         tail

show the last part of files. v.s. head.

 

Option or argument

Function

-f

Dynamic tail file. Be used to monitor the growth of a file.

 

e.g. tail -100 xxx           - cut the last 100 lines of xxx

 

1.7         touch

 

1. Changes the date and time of a file without changing the file’s contents; 2. Create files.

 

Syntax             touch [-a] [-c] [-m] [-t date]  filenames

 

Option or argument

Function

-a

Changes only the date and time the file was last accessed.

-c

Doesn’t create files if they don’t already exist. If you use touch without this option on a nonexistent filename, it creates an empty file.

-m

Changes only the date and time the file was last modified.

-t date

Specifies the date and time to give to the file(s). The date and time must be in the format mmddhhnn, where mm is the month number, dd is the day number, hh is the hour(using a 24-hour clock), and nn is the minute.

Filenames

Specifies the file(s) whose date(s) and time(s) you want changed.

 

If you leave out the date, touch changes the files’ date and time to today, right now.

 

1.8         unalias

Removes alias definitions. v.s. alias.

 

1.9         unencode

change binary files into ascII files.

 

1.10     uniq

Remove duplicate entries ONLY if they are adjacent.

Option or argument

Function

-c

Add a count of how many times each line occurred.

-d

Display only the repeated lines. (duplicate)

-u

List only lines that are not repeated (non-duplicate)

e.g.

who | awk '{print $1}' | sort | uniq -c

 

1.11     w

To see who is logged on and what they’re doing.

 

1.12     wc

Counting words or lines.

Option or argument

Function

-w

Count by word.

-l

Count by line.

-c

Count by character.

e.g. wc –l xxx; tail -1 test.sh |wc

 

1.13     whereis

locate files in the system. Refer find.

Syntax             whereis [-bmsu] [-BMS folder_name -f] file_name

 

1.14     which

Locates a program file, including aliases and paths. e.g. > which pwd (response: > /usr/bin/pwd)

 

1.15     who

 

Tells you who else is using this computer.

 

Syntax             who [-q] [ami]

 

Option or argument

Function

-q

Displays only usernames, not terminal IDs or other information.

-m, am i

Displays your username, in case you have forgotten, or displays the username on any terminal that someone left logged in.

-u,i

Activity and PID of shell

 

Similar

w, users

 

1.16     whoami

1.17     xargs

Constructs parameter lists and runs commands.

e.g.

find /hsbc/rlse_bcn/objects -type f | xargs rm

分享到:
评论

相关推荐

    CMDCMD命令CMD命令

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

    隐藏CMD黑窗(脚本)

    隐藏 CMD 黑窗口的脚本通常用于在运行批处理文件或其他命令行程序时,避免显示命令提示符窗口,这样可以让用户在后台执行脚本而不会干扰到其他任务。 该文件需配合BAT脚本使用,在.vbs中将路径指向BAT脚本并运行该...

    cmd管道技术向cmd发送字符

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

    java javascript 调用命令行 cmd

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

    sqlcmd 参数详解

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

    CMD网络命令大全123

    ##### 5. **`net view`** - **查看本地局域网共享**: ```cmd net view ``` 显示本地局域网内的共享资源列表。 - **查看远程计算机的共享**: ```cmd net view IP ``` 显示指定远程计算机上的共享资源。...

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

    在压缩包内的`Test-cmd`和`build-Test-cmd-Desktop_Qt_5_9_3_MSVC2015_64bit-Debug`文件夹中,`Test-cmd`很可能是源代码目录,包含Qt项目的主文件和相关源码,而`build-...`目录是使用CMake构建生成的临时目录,包含...

    qt调用cmd命令和dll例子

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

    cmd中的重定向输出,管道

    ### CMD中的重定向输出与管道操作详解 在日常的编程工作中,特别是在Windows环境下进行开发时,熟练掌握CMD命令行工具的使用技巧对于提高工作效率是非常有帮助的。本文将重点介绍CMD中的重定向输出(`>`、`>>`)...

    linux 离线安装perl-IPC-Cmd

    5. `perl-Locale-Maketext-1.23-3.el7.noarch.rpm`: 为Perl提供国际化(i18n)和本地化(l10n)支持,使得程序可以适应不同地区的语言环境。 6. `perl-Module-CoreList-2.76.02-299.el7_9.noarch.rpm`: 显示Perl...

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

    2. **事件选择**: `trace-cmd list`可以列出所有可用的内核事件,用户可以根据需求选择要追踪的事件。 3. **查看日志**: `trace-cmd report`命令将追踪数据转化为可读的报告,帮助分析系统行为。 4. **保存/加载**...

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

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

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

    ### 遍历CheckBoxList,获得选中项的值动态绑定CheckBoxList #### 知识点一:CheckBoxList概述及应用场景 **CheckBoxList** 是ASP.NET Web Forms中一个非常有用的控件,它允许用户选择一个或多个选项。CheckBoxList...

    常用的一些cmd命令

    #### 5. **进程与通信管理** - `net pause`:暂停一个服务。 - `netsend`:发送消息到另一台计算机。 - `netstat`:查看网络连接状态和统计信息。 - `nbtstat`:显示基于TCP/IP的NetBIOS的统计数据和连接信息。 ...

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

    在Java编程中,有时我们需要执行一些系统级别的操作...5. 安全编码实践 在实际项目中,如果频繁进行此类操作,建议使用Java的I/O和NIO库,或者第三方库如Apache Commons IO,它们提供了更为高级和安全的文件操作接口。

    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快速操作

    - `tlist -t`:列出系统进程(需额外安装工具)。 - `kill -F`:强制结束进程(同样需要额外安装工具)。 掌握这些CMD命令,可以帮助用户高效地进行系统管理和网络操作,尤其是在没有图形用户界面的情况下。了解...

    CMD命令(自己的收藏啊)

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

Global site tag (gtag.js) - Google Analytics