Создал пользователя через консоль и так же создал ему папку. В чём может быть проблема и как её решить?
$ ls -l /home/
итого 12
drwxr-x--- 6 nas-scanner root 4096 июн 26 15:32 nas-scanner
$ ls -l /home/nas-scanner
итого 8
-rw-rw-r-- 1 nas-scanner nas-scanner 4 июн 26 15:32 123.txt
drwxrwxrwx 2 nas-scanner nas-scanner 4096 июн 26 13:37 scanner
echo "123" >> /home/nas-sacanner/scanner/123/123
-sh: 15: cannot create /home/nas-sacanner/scanner/123/123: Directory nonexistent
задан 26 июн 2017 в 11:18
shaman888shaman888
1,8262 золотых знака30 серебряных знаков63 бронзовых знака
Вы пытаетесь сделать запись в директорию 123
, которой не существует. Сделайте так:
$ echo "123" >> /home/nas-scanner/scanner/123.txt
если вы ходите записать в файл 123.txt
в директории scanner
или
$ echo "123" >> /home/nas-scanner/scanner/123
если вы ходите записать в файл 123
в директории scanner
Или, если всё-таки надо записать в директорию 123
, предварительно её создайте:
$ mkdir /home/nas-scanner/scanner/123
$ echo "123" >> /home/nas-scanner/scanner/123/123
UPD. Исправил nas-sacanner
на nas-scanner
ответ дан 26 июн 2017 в 11:38
10
- Печать
Страницы: [1] Вниз
Тема: directory nonexistent (Прочитано 1893 раз)
0 Пользователей и 1 Гость просматривают эту тему.

Nastya_S
Прошу, по возможности, не посылать меня матом и сильно не ругаться, т.к. я просто прошу о помощи: я новичок в этом и вполне допускаю возможность совершения глупых ошибок.
При отладке выдается сообщение, о том, что не может найти каталог. Но каталог — текущий и он существует.Не могу понять, что не так. Будьте добры, помогите, пожалуйста, разобраться, в чем ошибка. Заранее премного благодарна.
Текст скрипта:
#!/bin/bash
a=$(find . `pwd` -maxdepth 1 -type f -mtime -1 | xargs ls -at1)
b=$(grep ‘[!.]*’ «$a»)
cat $b
exit 0
При отладке выводится сообщение:
«find: невозможно искать `’: Нет такого файла или каталога.»
« Последнее редактирование: 11 Декабря 2015, 01:48:40 от Nastya_S »

victor00000
a=12345
echo "$a"
L~$ a=12345
L~$ echo "$a"
12345
L~$

Nastya_S
shura1,
Я пытаюсь разобраться в проблеме. Я новичок в этом. И поэтому прошу о помощи.
« Последнее редактирование: 11 Декабря 2015, 01:51:12 от Nastya_S »

victor00000
shura1,
помощь ему, не могу клаву.
shura1
Оболочка — это уникальная штука. Как язык программирования, это самый дурацкий язык (после brainfuck-a ). Но в тоже время — это замечательный, полезный и очень нужный инструмент.
Просто надо понять, что скрипты — это объединение команд, которые вы вводите с клавиатуры, для того, чтобы было удобно.
Как бы с этого и надо подходить к разработке скриптов. Вы вводите команды, смотрите, что они делают, тестируете, а потом объединяете. А не наоборот.
Итак, надо начинать с
find . `pwd` -maxdepth 1 -type f -mtime -1
А еще правильнее с pwd — эта команда выполняется самой первой. Что она делает? Каков результат ее выполнения? Какой смысл в том, что результат вывода этой команды используется в качестве параметра команды find?
Наберите ее в терминале. Наберите ее в гугле. Вот здесь есть страницы руководства (man pages) на русском.
Потом можно перейти к команде find. Что вы хотите найти? Потом к объединению вывода этой команды в конвейер с ls. Зачем это надо?
И т. д., и т. п. И все получится, и все станет понятно. Честное слово.

Cxms
Без указания find и так работает в текущей директории:
a=$(find -maxdepth 1 -type f -mtime -1 | xargs ls -at1)
- Печать
Страницы: [1] Вверх
Today I made mistake by deleting “/etc/ssh” folder manually. Then when I try to re-install openssh-server in Ubuntu Oneiric, it gave me several errors like this :
1 |
/var/lib/dpkg/info/openssh-server.postinst: 456: cannot create /etc/ssh/sshd_config: Directory nonexistent |
To solve this problem, you need to :
1. Uninstall openssh-server
1 |
sudo apt-get —purge remove openssh-server |
2. Mkdir “/etc/ssh”
3. Fixing several ssh dpkg info by removing -e in several error files.
For instance, it said
1 |
/var/lib/dpkg/info/openssh-server.postinst 456: cannot create /etc/ssh/sshd_config: Directory nonexistent |
So, I just open “/var/lib/dpkg/info/openssh-server.postinst” and remove “-e”
change into
Then, you can install openssh-server :
1 |
sudo apt-get install openssh-server |
1 |
sudo apt-get install openssh-server |
Now I can restore deleted “/etc/ssh” folder and run SSH services as normal 🙂
whenever I try to intall any packages the following bug comes up (OS in ubuntu 14.04).
anil@anil-HP-15-Notebook-PC:~$ sudo apt-get upgrade
[sudo] password for anil:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libpcap0.8:i386 wine-gecko2.24 wine-gecko2.24:i386 wine-mono4.5.2
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up getdeb-repository (0.1-1~getdeb1) ...
/var/lib/dpkg/info/getdeb-repository.postinst: 15: /var/lib/dpkg/info/getdeb-repository.postinst: cannot create /etc/apt/sources.list.d/getdeb.list: Directory nonexistent
dpkg: error processing package getdeb-repository (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
getdeb-repository
E: Sub-process /usr/bin/dpkg returned an error code (1)
anil@anil-HP-15-Notebook-PC:~$
Braiam
66.2k30 gold badges174 silver badges262 bronze badges
asked Oct 26, 2014 at 4:47
It seems that /etc/apt/sources.list.d
folder doesn’t exist in the system.
Check if folder is present with:
ls /etc/apt/sources.list.d
and if it is missing, try:
sudo mkdir /etc/apt/sources.list.d
and redo apt-get
command.
answered Oct 26, 2014 at 11:43
LetyLety
5,9542 gold badges27 silver badges36 bronze badges
I have a running docker container. I was previously able to connect to this container. During use, I was disconnected. Attempts to reconnect to the docker container (or other variations thereof) are unsuccessful. I’ve included the logs for this below.
It looks like it cannot access the /tmp/ directory. I’ve tried mapping this directory to the container using -v. I’ve also tried opening up permissions. I’ve tried creating the container specific to my user. I’ve tried using privileged parameter. I’m a little at a loss here.
[225 ms] Dev Containers 0.275.1 in VS Code 1.75.0 (e2816fe719a4026ffa1ee0189dc89bdfdbafb164).
[225 ms] Start: Resolving Remote
[227 ms] Setting up container: container_name_redacted
[227 ms] Host: host_redacted
[230 ms] Start: Run: host_redacted /bin/sh
[251 ms] Start: Run in host: id -un
[3684 ms] name_redacted
[3685 ms]
[3685 ms] Start: Run in host: cat /etc/passwd
[3702 ms] Start: Run in host: echo ~
[3719 ms] /home/name_redacted
[3720 ms]
[3721 ms] Start: Run in host: test -x '/home/name_redacted/.vscode-remote-containers/bin/e2816fe719a4026ffa1ee0189dc89bdfdbafb164/node'
[3738 ms]
[3738 ms]
[3739 ms] Start: Run in host: test -f '/home/name_redacted/.vscode-remote-containers/dist/vscode-remote-containers-server-0.275.1.js'
[3756 ms]
[3756 ms]
[3769 ms] userEnvProbe: loginInteractiveShell (default)
[3770 ms] userEnvProbe: not found in cache
[3770 ms] userEnvProbe shell: /bin/bash
[3852 ms] userEnvProbe PATHs:
Probe: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games'
Container: None
[3871 ms] Start: Run in Host: docker inspect --type container /redacted_container_name
[3933 ms] Start: Check Docker is running
[3933 ms] Start: Run in Host: docker version --format {{.Server.APIVersion}}
[3999 ms] Server API version: 1.41
[4047 ms] Command failed: /bin/sh -c cat >'/tmp/devcontainer-config-91de0ba6-e023-476c-b3a0-df813264bd3f.json'
[4047 ms] /bin/sh: 1: cannot create /tmp/devcontainer-config-91de0ba6-e023-476c-b3a0-df813264bd3f.json: Directory nonexistent
[4047 ms] Exit code 2
asked 17 hours ago
New contributor
Botz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.