Bash это каталог ошибка

Sometimes when I make a typo in the terminal and accidentally tell Bash to interpret /, I get the output bash: /: Is a directory. Now I believe this output has to deal with the root directory or something of that sort.

But what I don’t understand is that when I enter increasing amounts of forward-slashes it continues to output the same thing…

Examples

//// —> bash: ////: Is a directory

//////// —> bash: ////////: Is a directory

Community's user avatar

asked Jan 6, 2018 at 5:28

NerdOfCode's user avatar

0

/ is the directory delimiter. Any string that ends in it is by definition a directory name:

example #This could be a file or directory
example/ #This is a directory in the current directory
/example/ #This is a directory in the root directory

Thus a series of /‘s would be interpreted an a series of {null} directories.

answered Jan 6, 2018 at 6:00

ravery's user avatar

raveryravery

6,8245 gold badges21 silver badges40 bronze badges

2

Not the answer you’re looking for? Browse other questions tagged

.

Этот вопрос уже имеет ответ здесь: что такое каталог с двойной косой чертой (//)? 1 ответ

Иногда, когда я делаю опечатку в терминале и случайно говорю Bash интерпретировать /, я получаю вывод bash: /: Is a directory. Теперь я считаю, что этот вывод должен иметь дело с корневым каталогом или чем-то подобным.

Но я не понимаю, что, когда я ввожу увеличивающиеся количества спреев, он продолжает выводить одно и то же …

Примеры

//// -> bash: ////: Is a directory

//////// -> bash: ////////: Is a directory

задан
6 January 2018 в 09:28

поделиться

3 ответа

/ является разделителем каталогов. Любая строка, которая заканчивается на нем, по определению является именем каталога:

example #This could be a file or directory
example/ #This is a directory in the current directory
/example/ #This is a directory in the root directory

Таким образом, серия из / s будет интерпретирована как серия {null} каталогов. [ ! d2]

ответ дан ravery
22 May 2018 в 15:43

поделиться

/ является разделителем каталогов. Любая строка, которая заканчивается на нем, по определению является именем каталога:

example #This could be a file or directory
example/ #This is a directory in the current directory
/example/ #This is a directory in the root directory

Таким образом, серия из / s будет интерпретирована как серия {null} каталогов. [ ! d2]

ответ дан ravery
17 July 2018 в 23:45

поделиться

/ является разделителем каталогов. Любая строка, которая заканчивается на нем, по определению является именем каталога:

example #This could be a file or directory
example/ #This is a directory in the current directory
/example/ #This is a directory in the root directory

Таким образом, серия из / s будет интерпретирована как серия {null} каталогов. [ ! d2]

ответ дан ravery
24 July 2018 в 17:06

поделиться

Другие вопросы по тегам:

Похожие вопросы:

In the example

~/fuse/example>

is a prompt, not part of the command. The command issued is:

./hello /tmp/fuse -d

Where hello is this code compiled. (Compile line at top of page).

Actually, due to the redirect, if you have hello compiled in the home directory of your user:

/home/memsql/

the file is overwritten (as empty) due to the > redirect from the command, which produces no output. Else, an empty file named hello is created.


Bash interprets you as trying to issue a directory as a command, as in:

$ /homeEnter
bash: /home: Is a directory

$ /proc/Enter
bash: /proc/: Is a directory

$ /home/ asdf asdf asdf blah blahEnter
bash: /home/: Is a directory

So in your example:

$ ls -F1 ~
bar
Documents/
fuse-2.9.3/example/
gaz

$ ~/fuse-2.9.3/example> ./hello /tmp/fuse -d
bash: /home/memsql/fuse-2.9.3/example: Is a directory

$ ls -F1 ~
bar
Documents/
fuse-2.9.3/example/
gaz
hello  <--- new empty file

When I follow the steps for starting a new Cordova PhoneGap project for Eclipse (following these directions: http://docs.phonegap.com/en/2.2.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android ), I drag Android’s /bin directory to the Terminal window first (which contains the create script), then type in:

./create /Users/Steve/Documents/PhoneGap_apps/PhoneGap_apps/appName2 com.companyname.appName2 appName2 

to create the project.

But what I get in return is:

-bash: /Users/Steve/Downloads/phonegap-phonegap-8a3aa47/lib/android/bin: is a directory 

The appName2 directory is not created.

Why do I get that «is a directory» notice, and how do I resolve it to create the directory?

Cœur's user avatar

Cœur

37.3k25 gold badges196 silver badges267 bronze badges

asked Dec 17, 2012 at 20:05

Steve's user avatar

3

Edit: Fixed path.

I think you’re missing a tilde (~) in your path.

Try this:

./create ~/Documents/PhoneGap_apps/PhoneGap_apps/appName2 com.companyname.appName2 appName2 

answered Dec 17, 2012 at 20:11

OakNinja's user avatar

OakNinjaOakNinja

2,32618 silver badges20 bronze badges

9

I successfully created the folder based on Marcus’ response by adding the «cd» first, then adding the entire script. Earlier, attempting his answer, I had first hit Return after dragging the /bin folder over, then adding the script. Doing all three components on a single line did the job.

answered Dec 17, 2012 at 22:07

Steve's user avatar

SteveSteve

1,22919 silver badges41 bronze badges

So I encounter this «bash: Is a directory» error while trying to run the following command on my Arch Linux VirtualBox. GNU bash version 4.3.30(1).

/home/minix git clone git://git.minix3.org/minix src

I have checked if I have git installed. And it is in /usr/bin/git.

I am completely lost, so any help would be much appreciated.

asked Oct 25, 2015 at 14:11

Highlights Factory's user avatar

The error is shown because you’re trying to run /home/minix as a command (with git clone ... as its parameters).

Why is that directory name there? Did you add it for a specific reason? Did it get copypasted off the web along with the rest of the command? If not, the following should be enough:

git clone git://git.minix3.org/minix

answered Oct 25, 2015 at 14:20

u1686_grawity's user avatar

u1686_grawityu1686_grawity

428k64 gold badges896 silver badges968 bronze badges

3

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

Понравилась статья? Поделить с друзьями:
  • B8 непрерывный подсчет обнаруженных ошибок
  • Bash продолжить выполнение скрипта при ошибке
  • Bas ошибка мерседес 203
  • Baltur котел газовый ошибка e10
  • Bash подавить вывод ошибок