如何搜索在Linux操作系统Ubuntu机器上的文件或目录 [英] How to search for a file or directory in Linux Ubuntu machine

查看:194
本文介绍了如何搜索在Linux操作系统Ubuntu机器上的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个EC2实例(Ubuntu的64位),并通过公开的快照实例连接的卷。我成功地安装在卷。我应该能够使用以下步骤从这个附加卷运行一个脚本,在教程中解释说:

I created an EC2 instance (Ubuntu 64 bit) and attached a volume from a publicly available snapshot to the instance. I successfully mounted the volume. I am supposed to be able to run a script from this attached volume using the following steps as explained in the tutorial:

Log in to your virtual machine. 
mkdir /space 
mount /dev/sdf1 /space 
cd /space 
./setup-script

问题是,当我尝试:./setup-script我得到了以下信息: -bash:./setup-script:没有这样的文件或目录

The problem is that, when I try: ./setup-script I got the following message: -bash: ./setup-script: No such file or directory

这是什么问题?我怎么可以搜索整个机器的./setup-script?我不是很熟悉的Linux系统。请帮助。

What is the problem ? How can I search for the ./setup-script in the whole machine ? I'm not very familiar with linux system. Please, help.

有关问题的更多详细信息:看我的previous职位: 错误时安装驱动

For more details about the issue: Look at my previous post: Error when mounting drive

推荐答案

这可能是你已经安装了错误的设备。我刚刚回忆起了一招,你可以用它来找到Linux的EBS卷的设备名称,因为它是从报告的AWS控制台的设备名称往往不同。首先卸载该设备在Linux中,然后使用AWS控制台的实例中分离,所以我们回到原来的状态。现在,在Linux中运行以下命令:

It is possible that you have mounted the wrong device. I've just recalled a trick you can use to find the device name of an EBS volume in Linux, since it is often different from the device name reported in the AWS console. First unmount the device in Linux, then detach it from the instance using the AWS console, so we go back to the original state. Now run this command in Linux:

cat /proc/partitions

该命令将显示当前连接的卷。下一步骤是附加使用AWS控制台卷到实例,然后再次运行在Linux同一命令。您应该看到一个附加行出现。这条线会告诉你该设备安装的名称。例如,我在我的Ubuntu的情况下的输出:

The command will show the volumes currently attached. The next step is to attach the volume to the instance using the AWS console, and then to run that same command again in Linux. You should see an additional line appear. This line will tell you the name of the device to mount. For example, I get this output in my Ubuntu instance:

major minor  #blocks  name

 202        1    8388608 xvda1
 202       80    8388608 xvdf

第一行已经在那里之前,我重视的体积,所以我知道这是我的根卷。第二行是一个出现了,所以在这种情况下,设备安装将的/ dev / xvdf

这篇关于如何搜索在Linux操作系统Ubuntu机器上的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆