如何在windows批处理cmd和Linux文件中指定特定文件的两个级别父目录?
例如:
C:\Oracle\Middleware\Oracle_Home\my\this.bat in window
linux中的\opt\home\this\my\this.sh
当运行上面的批处理文件时,我希望得到C:\Oracle\中间件\(这个批处理文件的父目录的父目录)
我将在窗口中查看下面的内容,但只能获得第一个父文件夹:
set CURRENT_DIR=%cd%
cd %~dp0\..
set PARENT_DIR=%cd%
echo %PARENT_DIR%
我正在尝试创建一个别名,以便在工作中访问我们的共享服务器。要查找使用手动终端输入的服务器,请键入以下单独的输入:
cd ..
cd ..
cd Volumes
cd Production
我希望所有这些都是我的.bash_profile中的一个别名
我尝试了以下几种不起作用的方法:
alias work="cd ~ cd .. cd .. cd Volumes cd Production"
假设我在同一台linux机器上的两个不同工作空间中有以下两个类似的文件。
/user1/ws1/ip/src/ip_main.c
/user1/ws2/ip/src/ip_main.c
现在我做到了,
cd user1/ws1/
vim ip/src/ip_main.c
然后按ESC,然后执行
:cd ../ws2
它显示我的pwd为"user1/ws2“,现在我想在pwd中打开ip/src/ip_main.c,即使用ESC打开"user1/ws2”
:vertical diffsplit "some logic to get to ws2/ip/src/ip_
我是Linux新手,我想了解这个简单的Linux命令:
cd /boot/../dev
cd =更改目录
第一个/ =转到根目录
boot =是目录的名称
第二个/ =.?他不能说去根目录,因为在那之后我们有..,这意味着转到实际目录的父目录,根目录没有一个
.. =表示转到父目录
dev =是目录的名称
我只是安装了,并按照以下说明操作:
Installation
Most CD-HIT programs were written in C++. Installing CD-HIT package is very simple:
download current CD-HIT at http://bioinformatics.org/cd-hit, for example cd-hit-2006-0215.tar.gz
unpack the file with ” tar xvf cd-hit-2006-0215.tar.gz --gunzip”
change dir by “cd cd-h
我正试图通过udacity的教程来学习脊梁。安装此应用程序有两个链接。
在FEF-UdaciMeals-Backbone下,指令告诉我要这样做:
Set up the project
clone this repo
cd into the newly cloned project
install Bower dependencies via bower install
Set up the server
clone the backend server
launch the binary for your platform
don't forget the --www flag
我创建了一个shell脚本,无论它在哪里都可以转到目录中。例如,如果shell在下载中,我希望它转到桌面,在那里创建一个文件夹,转到该文件夹和许多其他东西,但是CD命令不工作。
#!/bin/bash
cd Desktop
它这样说:
setup.sh: 2: cd: can't cd to Desktop
我有办法用它,请帮帮忙。
例如,假设我有一个makefile:
front:
cd front && (sudo make -f Makefile.linux ) -- require sudo
back:
cd back && (make -f Makefile.linux )
clean:
cd front && (make -f Makefile.linux clean)
cd back && (make -f Makefile.linux clean)
有可能做到吗?如果是,正确的做法是什么?谢谢
LJ
我试图为windows命令行编写一个批处理文件,将值转换为0到1。我可以轻松地更改数字,但是正在为批处理文件过程而挣扎。我想要批处理文件搜索3度文件夹,以找到图像处理。到目前为止我..。更新:问题似乎已经解决了。但是作为参考,批处理文件似乎不起作用,没有错误消息,只是没有输出。
for %%y in (D:\Data\imageA\20*) do (
cd %%y
for %%m in (\%%y\*) do (
cd %%m
for %%d in (\%%m\*) do (
cd %%d
for
Ubuntu版本: 19.10
代码编写器版本: CCS10.1.0.00010_linux-x64
我正试图在Linux上安装。但是在README的Composer文件中,请这样说。
Code Composer Studio for Linux README
-----------------------------------------
Please note that use of anti-virus software or a firewall may cause issues
during installation. McAfee software in pa
众所周知,Bash/终端中的cd /将您带到根目录,而不管您以前在哪里:
brian@brian-linux:~/redis-3.0.3$ cd /
brian@brian-linux:/$ pwd
/
brian@brian-linux:/$ ls
bin dev initrd.img.old libx32 opt sbin usr
boot etc lib lost+found proc srv var
cdrom home lib32 media r
我在Ubuntu14.04上创建了一个tarball,并使用:
cd /tmp
tar -cfvz archive.tar.gz /folder
现在,我想将tarball ( tarball内位于/tmp中)中的特定文件夹解压缩到特定的文件夹中:
cd /tmp
tar -xfvz archive.tar.gz folder/in/archive -C /tmp/archive
结果应该是/tmp中的一个名为archive的新文件夹。这是正确的吗?特别是要提取的文件夹缺少的斜杠(相对路径)和要创建的文件夹的绝对路径。
案文如下:
We will now present the Linux ls command
... here description of ls
We will now present the Linux cd command
... here description of cd
... more description
Done
下面的sed替换正则表达式应用于文本。
sed 's/.*Linux \(.*\) .*/\1:/' ex2.txt
,它提供以下输出
ls:
... here description of ls
cd:
...
我对Ubuntu或linux的任何发行版都是完全陌生的。在使用终端时,当我在/home/username目录中时,ls命令显示桌面和下载目录,但命令cd /Desktop不能工作。上面写着bash: cd: /Desktop: No such file or directory。
我手动创建的另一个目录打开了ok。它也做了许多其他文件夹,我做错了什么。
我尝试使用Kali Linux重置我的Windows 7密码,这是与Windows 7双引导的。
我读了几页,并遵循了以下步骤:
cd /media/448AF1848AF172B2
cd /Windows/System32/config/
chntpw SAM
在我尝试cd /Windows/System32/config/部分之后,我得到了错误:
bash: cd: /Windows/System32/config: No such file or directory
下面是一个分区列表:
Device Boot Start End Blocks
在Mac上工作时,我的桌面上有单独的.py文件,在终端中输入以下内容时,这些文件会打开并运行良好:
cd desktop
python3 filename.py
现在,我在桌面上创建了一个名为Python的文件夹,以更好地存储这些文件,但无论我尝试了什么,我似乎都无法访问它。我试过以下几种方法
cd desktop/Python (file or directory doesn't exist)
cd desktop/Python python3 filename.py (file or directory doesn't exist)
有什么想法吗?
这是我的docker文件
# This is a comment
FROM chapmanb/bcbio-nextgen-devel
MAINTAINER Sabarish Subramanian
RUN mkdir /root/software && cd /root/software && wget http://bio.math.berkeley.edu /eXpress /downloads/express-1.5.1/express-1.5.1-linux_x86_64.tgz
RUN cd /root && mkdir src