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

 

<think>好的,用户的问题是在CMD中运行“ollama list命令没有显示输出,需要解决这个问题。首先,我需要根据提供的引用资料来分析可能的原因和解决方案。 首先,引用[1]提到安装完成后在cmd输入“ollama”命令会显示相关信息,这说明安装成功的基础验证步骤。但用户现在的问题是“ollama list”没有输出,可能安装有问题或者路径配置不正确。需要确认ollama是否正确安装,可以运行“ollama”命令看是否有帮助信息,如果没有,可能需要重新安装。 接下来,引用[2]提到cmd中找不到mysql命令的问题,这通常是因为环境变量没有配置正确。类似地,如果ollama的可执行文件路径没有添加到系统PATH中,cmd可能无法找到ollama命令。因此,检查环境变量设置是一个关键点。 引用[3]指出在默认路径运行ollama可能导致问题,比如回答不正常,建议更换路径或使用其他方法调用。这可能意味着ollama在特定路径下才能正常工作。用户可能需要切换当前工作目录到ollama的安装路径或模型存储路径,再运行命令。例如,使用“cd”命令切换到F盘的ollama目录,再执行“ollama list”。 引用[4]提到模型文件可能未正确安装到指定位置,比如模型文件被下载到C盘而不是预期的F盘,导致命令无法列出模型。因此,需要检查模型存储路径是否正确,并确保模型已正确下载。用户可能需要重新下载模型到正确的路径,或者在正确的路径下运行命令。 综合以上信息,可能的解决方案步骤包括:1. 验证ollama是否正确安装;2. 检查环境变量配置;3. 切换cmd的工作目录到ollama的安装或模型路径;4. 确保模型已正确下载;5. 重启系统或服务。需要逐步排除这些可能性,并指导用户操作。</think>针对CMD中运行`ollama list`命令无输出的问题,以下是分步解决方案: ### 第一步:验证Ollama安装状态 1. 在CMD输入`ollama`命令 - 若显示版本信息和使用说明(如示例图),则基础安装正常[^1] - 若提示`"ollama" 不是内部或外部命令`,说明需要配置环境变量 ### 第二步:检查环境变量配置 1. 右键点击【此电脑】→【属性】→【高级系统设置】→【环境变量】 2. 在系统变量中确认`Path`是否包含Ollama安装路径(默认路径为`C:\Program Files\Ollama`) 3. 若路径缺失,手动添加后重启CMD[^2] ### 第三步:切换工作目录(关键步骤) 1. 输入`cd /d F:\ollama`(假设模型存储路径为F盘) 2. 执行`ollama list` *此操作可规避默认路径下的异常行为[^3]* ### 第四步:检查模型下载状态 1. 在目标路径下执行`ollama run deepseek-r1:8b` - 若开始下载模型,说明之前未正确安装模型 - 下载完成后再次执行`ollama list`即可显示模型[^4] ### 第五步:系统级重启 1. 以管理员身份运行CMD 2. 依次执行: ```shell ollama stop ollama serve ``` 3. 新开CMD窗口再次尝试
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值