Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
1 answers
1875 views
mkdir says folder exists even though it doesn't show with ls -a
Arch linux. I have a CIFS mount from my NAS that was mounted with full permissions # line from my fstab //IP_ADDRESS/path/to/dir /path/to/local/dir cifs uid=my_user,gid=my_group,dir_mode=0777,file_mode=0777,credentials=path/to/my/creds 0 0 and am trying to create a directory, however this fails mkdi...
Arch linux. I have a CIFS mount from my NAS that was mounted with full permissions # line from my fstab //IP_ADDRESS/path/to/dir /path/to/local/dir cifs uid=my_user,gid=my_group,dir_mode=0777,file_mode=0777,credentials=path/to/my/creds 0 0 and am trying to create a directory, however this fails mkdir path/to/local/dir/subdir mkdir: cannot create directory '/path/to/local/dir/subdir': File exists However as far as I can tell it *doesn't* exist: ls -la path/to/local/dir drwxrwxrwx me me 0 date . drwxrwxrwx me me 0 date .. And looking at the files on my NAS that subdirectory does not exist on the remote. I'm stumped. And I can search for this, it just turns up a bunch of results where people didn't understand what dotfiles are. What gives? # Edit Since I got some pushback on the particulars (fair enough), here are the **exact** commands and output. The /mnt/nas/SteamLibrary folder is the local mount point for the folder on the NAS. [I] ⋊> ~ ls -la /mnt/nas/SteamLibrary/steamapps/downloading 17:19:56ls: cannot access '/mnt/nas/SteamLibrary/steamapps/downloading': No such file or directory [I] ⋊> ~ mkdir /mnt/nas/SteamLibrary/steamapps/downloading 17:20:33mkdir: cannot create directory ‘/mnt/nas/SteamLibrary/steamapps/downloading’: File exists [I] ⋊> ~ ls -la /mnt/nas/SteamLibrary/steamapps/ 17:20:41total 108K drwxrwxrwx 2 jsmith jsmith 0 Apr 18 21:30 . drwxrwxrwx 2 jsmith jsmith 0 Apr 19 13:49 .. drwxrwxrwx 2 jsmith jsmith 0 Apr 17 16:05 common drwxrwxrwx 2 jsmith jsmith 0 Apr 17 16:04 compatdata drwxrwxrwx 2 jsmith jsmith 0 Apr 17 16:03 shadercache drwxrwxrwx 2 jsmith jsmith 0 Apr 17 16:05 temp drwxrwxrwx 2 jsmith jsmith 0 Aug 10 2020 workshop -rwxrwxrwx 1 jsmith jsmith 1.2K Feb 27 16:40 appmanifest_102500.acf -rwxrwxrwx 1 jsmith jsmith 686 Feb 27 16:40 appmanifest_107300.acf -rwxrwxrwx 1 jsmith jsmith 694 Feb 27 16:40 appmanifest_107310.acf -rwxrwxrwx 1 jsmith jsmith 498 Apr 19 13:50 appmanifest_1391110.acf -rwxrwxrwx 1 jsmith jsmith 483 Apr 19 13:50 appmanifest_1493710.acf -rwxrwxrwx 1 jsmith jsmith 745 Feb 27 16:40 appmanifest_207320.acf -rwxrwxrwx 1 jsmith jsmith 863 Feb 27 16:41 appmanifest_219780.acf -rwxrwxrwx 1 jsmith jsmith 691 Apr 17 16:03 appmanifest_22320.acf -rwxrwxrwx 1 jsmith jsmith 837 Apr 19 13:50 appmanifest_22330.acf -rwxrwxrwx 1 jsmith jsmith 516 Feb 27 16:59 appmanifest_256460.acf -rwxrwxrwx 1 jsmith jsmith 1.2K Feb 27 16:59 appmanifest_292030.acf -rwxrwxrwx 1 jsmith jsmith 825 Feb 27 16:40 appmanifest_312540.acf -rwxrwxrwx 1 jsmith jsmith 1.1K Apr 17 16:03 appmanifest_340170.acf -rwxrwxrwx 1 jsmith jsmith 1.1K Feb 27 16:40 appmanifest_351970.acf -rwxrwxrwx 1 jsmith jsmith 894 Feb 27 16:40 appmanifest_367500.acf -rwxrwxrwx 1 jsmith jsmith 773 Feb 27 16:40 appmanifest_372360.acf -rwxrwxrwx 1 jsmith jsmith 1.5K Feb 27 16:37 appmanifest_379720.acf -rwxrwxrwx 1 jsmith jsmith 599 Apr 17 16:20 appmanifest_391540.acf -rwxrwxrwx 1 jsmith jsmith 665 Apr 19 13:49 appmanifest_406110.acf -rwxrwxrwx 1 jsmith jsmith 685 Feb 27 16:59 appmanifest_418340.acf -rwxrwxrwx 1 jsmith jsmith 794 Feb 27 16:40 appmanifest_429660.acf -rwxrwxrwx 1 jsmith jsmith 985 Feb 27 16:40 appmanifest_489830.acf -rwxrwxrwx 1 jsmith jsmith 612 Feb 27 16:59 appmanifest_506510.acf -rwxrwxrwx 1 jsmith jsmith 667 Feb 27 16:41 appmanifest_522530.acf -rwxrwxrwx 1 jsmith jsmith 708 Feb 27 16:41 appmanifest_525240.acf -rwxrwxrwx 1 jsmith jsmith 891 Apr 17 16:03 appmanifest_538680.acf -rwxrwxrwx 1 jsmith jsmith 1.1K Feb 27 16:40 appmanifest_72850.acf
Jared Smith (125 rep)
Apr 19, 2021, 06:06 PM • Last activity: Aug 7, 2025, 09:04 AM
0 votes
1 answers
1909 views
Permissions Issue creating folder on remote host with Jenkins
I'm having an issue with using Jenkins to create a folder on a remote host. The remote host in this case is a stock Ubuntu 20.04 AMI EC2 server with the default `ubuntu` user. I am connecting with the `ubuntu` user to the remote server with the code below: ``` sshagent(credentials : [branchConfig.SS...
I'm having an issue with using Jenkins to create a folder on a remote host. The remote host in this case is a stock Ubuntu 20.04 AMI EC2 server with the default ubuntu user. I am connecting with the ubuntu user to the remote server with the code below:
sshagent(credentials : [branchConfig.SSH_CREDENTIALS_NAME]) {
    sh 'ssh -o StrictHostKeyChecking=no ' + branchConfig.SSH_USER + '@' + branchConfig.DOCKER_HOST + ' "echo \"running whoami\" && whoami && echo \"running groups\" && groups && install --directory --mode 0755 --owner ' + branchConfig.SSH_USER + ' --group ' + branchConfig.SSH_USER + ' ~/importengine"'
}
This outputs the following error: + ssh -o StrictHostKeyChecking=no ubuntu@x.x.x.x echo running whoami && whoami && echo running groups && groups && install --directory --mode 0755 --owner ubuntu --group ubuntu ~/importengine Warning: Permanently added 'x.x.x.x' (ECDSA) to the list of known hosts. running whoami ubuntu running groups ubuntu docker install: cannot change owner and permissions of ���/home/ubuntu/importengine���: Operation not permitted I can see that the folder gets created, but it has the following permissons:
drwxr-xr-x 2 root   root   4.0K Oct 13 11:12 importengine
If I delete the folder and run the following command (when logged in as ubuntu):
install --directory --mode 0755 --owner ubuntu --group ubuntu ~/importengine
...then the folder gets created with the following permissions:
drwxr-xr-x 2 ubuntu ubuntu 4.0K Oct 13 11:24 importengine
### Question **Why is the folder getting created as owned by root in the first place?** After all, I can clearly see that whoami outputs as ubuntu, and not root in the error output so it should be creating the folder as if the ubuntu user.
Programster (2289 rep)
Oct 13, 2021, 11:26 AM • Last activity: Jul 22, 2025, 12:10 AM
9 votes
5 answers
1633 views
Is there a command to recreate directory trees?
I created a 'cron' subdirectory in ```/var/log/``` . It is: ```/var/log/cron``` Within ```/var/log/cron``` I've created numerous sub-directories to store my log files for cron jobs. I am wondering if there is a way to output ```mkdir``` to match the directory structure my automated jobs use. For exa...
I created a 'cron' subdirectory in
/var/log/
. It is:
/var/log/cron
Within
/var/log/cron
I've created numerous sub-directories to store my log files for cron jobs. I am wondering if there is a way to output
to match the directory structure my automated jobs use. For example these sub-directory structure exists within
| ronshome
|-- personal_growth
|   |-- building_your_relationship
|   |-- fun_things_that_make_life_worth_living
|   |-- hope_is_found
|   |-- life_lessons
|   |-- thought_of_the_day
|   |-- what_makes_a_good_friend
|   |-- what_my_friends_mean_to_me
|   `-- who_am_i
My desired output is:
mkdir /var/log/cron/ronshome
mkdir /var/log/cron/ronshome/personal_growth
mkdir /var/log/cron/ronshome/personal_growth/building_your_relationship
mkdir /var/log/cron/ronshome/personal_growth/fun_things_that_make_life_worth_living
etc. Essentially if I need to do a server restore I would like to be able to use this to recreate the log directories.
Ron Piggott (205 rep)
Jun 7, 2025, 04:17 PM • Last activity: Jun 16, 2025, 10:21 AM
1 votes
1 answers
825 views
fstab and systemd automount overlay
On an embedded device based on Yocto Linux my rootfs is RO, while I have an additional partition for RW data. Now I want to automount at boot an overlay onto /etc stored on a different partition. Here is my fstab: /dev/mmcblk0p6 /data_local ext4 defaults,sync,noexec,rw 0 2 [...] overlay /etc overlay...
On an embedded device based on Yocto Linux my rootfs is RO, while I have an additional partition for RW data. Now I want to automount at boot an overlay onto /etc stored on a different partition. Here is my fstab: /dev/mmcblk0p6 /data_local ext4 defaults,sync,noexec,rw 0 2 [...] overlay /etc overlay defaults,lowerdir=/etc,upperdir=/data_local/overlayfs/upper/etc,workdir=/data_local/overlayfs/workdir,X-mount.mkdir,x-systemd.requires=/data_local,x-systemd.before=local-fs.target,x-systemd.before=systemd-networkd 0 0 However, this fails because the upperdir and workdir directories are missing on first boot. How can I let fstab or systemd.mount automatically create these directories?
Martin H. (201 rep)
Mar 18, 2024, 03:29 PM • Last activity: Apr 21, 2025, 03:08 PM
2 votes
2 answers
774 views
Create folders with unique names of filenames
I am trying to create folders from unique filenames. Here are the files: T001 └── 20000101 ├── 6_3D-MP-RAGE_97.dcm ├── 6_3D-MP-RAGE_98.dcm ├── 5_133_VOLUMES_99027.dcm ├── 5_133_VOLUMES_99028.dcm ├── 5_133_VOLUMES_99029.dcm ├── 5_133_VOLUMES_99030.dcm ├── 4_COR_3D_T1_MPR_1.dcm ├── 4_COR_3D_T1_MPR_107...
I am trying to create folders from unique filenames. Here are the files: T001 └── 20000101 ├── 6_3D-MP-RAGE_97.dcm ├── 6_3D-MP-RAGE_98.dcm ├── 5_133_VOLUMES_99027.dcm ├── 5_133_VOLUMES_99028.dcm ├── 5_133_VOLUMES_99029.dcm ├── 5_133_VOLUMES_99030.dcm ├── 4_COR_3D_T1_MPR_1.dcm ├── 4_COR_3D_T1_MPR_107.dcm I want bash magic to result in this: T001 └── 20000101 ├── 6_3D ├── 6_3D-MP-RAGE_97.dcm ├── 6_3D-MP-RAGE_98.dcm ├── 5_133 ├── 5_133_VOLUMES_99027.dcm ├── 5_133_VOLUMES_99028.dcm ├── 5_133_VOLUMES_99029.dcm ├── 5_133_VOLUMES_99030.dcm ├── 4_COR ├── 4_COR_3D_T1_MPR_1.dcm ├── 4_COR_3D_T1_MPR_107.dcm And I have tried this code to extract folder names, but got stuck:
all_patterns=()
for file in sorted/folder/*/*
do
    name=${file##*/}
    pattern=echo ${name} | cut -f1 -d '_'
    all_patterns+=( "$pattern" )
done
Relyativist (139 rep)
Mar 17, 2020, 03:54 PM • Last activity: Feb 20, 2025, 12:06 PM
0 votes
1 answers
118 views
Missing files but system said it exist!
I have a working folder with all output files generated from command. When I tried to re-coding one of my file, after a few attempts, I realized the files in my folder left only 1/3 of them! I first thought they are gone, and wanted to repeat the experiment XD But when I tried to create a folder nam...
I have a working folder with all output files generated from command. When I tried to re-coding one of my file, after a few attempts, I realized the files in my folder left only 1/3 of them! I first thought they are gone, and wanted to repeat the experiment XD But when I tried to create a folder named "bin", it said: mkdir: cannot create directory ‘bin’: File exists and there is even files in the "bin" directory! What is happening here? How can I check? 😅 Update: I was having window dual-boot with linux. I opened up my Windows (with not related intention) and just happened to realise that the missing folder could not be opened and was marked as corrupted (still not sure why until now). So I repaired the file as instructed by Windows, and I got them all back!) Thanks everyone for the help anyway! Appreciate them!
web (193 rep)
May 3, 2024, 01:28 PM • Last activity: May 9, 2024, 07:00 AM
2 votes
3 answers
2947 views
Create file in subdirectories that doesn't exist (../new_folder/new_folder/new_file.ext)
For now i use this: mkdir -p a/b/c/d/e; touch a/b/c/d/e/file.abc; Is there more efficient ways?
For now i use this: mkdir -p a/b/c/d/e; touch a/b/c/d/e/file.abc; Is there more efficient ways?
TsV (131 rep)
Nov 26, 2018, 02:54 PM • Last activity: Apr 18, 2024, 03:55 PM
286 votes
13 answers
157480 views
Is there a one-liner that allows me to create a directory and move into it at the same time?
I find myself repeating a lot of: mkdir longtitleproject cd longtitleproject Is there a way of doing it in one line without repeating the directory name? I'm on bash here.
I find myself repeating a lot of: mkdir longtitleproject cd longtitleproject Is there a way of doing it in one line without repeating the directory name? I'm on bash here.
methodofaction (3519 rep)
Mar 12, 2011, 01:15 AM • Last activity: Oct 17, 2023, 08:48 PM
9 votes
2 answers
9935 views
Synchronizing with rsync outputs error "Invalid argument (22)" for directories with dots and other symbols in their name
I tried to synchronize `/dir1` (ext4) and `/dir2` (ntfs) using `rsync -azP`, but got these errors: ```none rsync: recv_generator: mkdir "dir2/X.Y." failed: Invalid argument (22) rsync: recv_generator: mkdir "dir2/CATSNDOGS\#123.11." failed: Invalid argument (22) ``` Note that directories `X.Y.` and...
I tried to synchronize /dir1 (ext4) and /dir2 (ntfs) using rsync -azP, but got these errors:
rsync: recv_generator: mkdir "dir2/X.Y." failed: Invalid argument (22)

rsync: recv_generator: mkdir "dir2/CATSNDOGS\#123.11." failed: Invalid argument (22)
Note that directories X.Y. and CATSNDOGS #123.11. are created by other party and, named as they are, downloaded (using Python script) to /dir1. I can't cd into these directories and ls -d doesn't list them. On the other hand, GUI-based *nautilus* shows both them and content inside them perfectly.
Igor V. (361 rep)
Feb 4, 2021, 09:17 PM • Last activity: Sep 26, 2023, 07:38 AM
1 votes
2 answers
142 views
Can't create included directory
I'd like to create a new directory that looks like `/dir1/dir2/dir3/dir4` but I can't. If I create the directories one by one from the parent and new parent directories, everything works: ```sh lm@debian:~$ sudo mkdir -v ./Pictures/Photos1/onbike2023/ mkdir: cannot create directory ‘./Pictures/Photo...
I'd like to create a new directory that looks like /dir1/dir2/dir3/dir4 but I can't. If I create the directories one by one from the parent and new parent directories, everything works:
lm@debian:~$ sudo mkdir -v ./Pictures/Photos1/onbike2023/
mkdir: cannot create directory ‘./Pictures/Photos1/onbike2023/’: No such file or directory
lm@debian:~$ sudo mkdir -v ./Pictures/Photos1/
mkdir: created directory './Pictures/Photos1/'
lm@debian:~$ sudo mkdir -v ./Pictures/Photos1/onbike2023/
mkdir: created directory './Pictures/Photos1/onbike2023/'
lm@debian:~$
What am I doing wrong?
ant (27 rep)
Sep 8, 2023, 06:28 PM • Last activity: Sep 10, 2023, 02:24 PM
1 votes
1 answers
252 views
mkdir -p dir with braces created wrongly
I executed the following code in Ubuntu server 16.04 xenial: mkdir -p /root/backups/{db, dirs} I recall that in another system, it worked like charm creating all 3 dirs: /root/backups/ /root/backups/db /root backup/dirs Yet this time the result was: /root/backups/ /root/backups/{db, Why is this part...
I executed the following code in Ubuntu server 16.04 xenial: mkdir -p /root/backups/{db, dirs} I recall that in another system, it worked like charm creating all 3 dirs: /root/backups/ /root/backups/db /root backup/dirs Yet this time the result was: /root/backups/ /root/backups/{db, Why is this partial, broken result?
Arcticooling (1 rep)
Jan 9, 2018, 04:35 PM • Last activity: Sep 8, 2023, 07:59 AM
0 votes
0 answers
37 views
Why did this mkdir not work properly?
Why did this `mkdir` not work properly? The folder is strangely named as `{a`. mkdir -p myfile/{a/a{1..10}, b/b{10..30}, c/c{1,2,3}} [![enter image description here][1]][1] [1]: https://i.sstatic.net/nYXRW.png
Why did this mkdir not work properly? The folder is strangely named as {a. mkdir -p myfile/{a/a{1..10}, b/b{10..30}, c/c{1,2,3}} enter image description here
internet (101 rep)
Sep 8, 2023, 04:11 AM • Last activity: Sep 8, 2023, 05:04 AM
1 votes
1 answers
636 views
sudo mkdir /srv/www permission denied
I'm setting up a new webserver on Debian. As my previous install had everything located in /srv/www I want to use the same setup to avoid rewriting a bunch of config files. However executing `mkdir /srv/www` results in permission denied. Using both sudo as executing it as a su does not resolve the e...
I'm setting up a new webserver on Debian. As my previous install had everything located in /srv/www I want to use the same setup to avoid rewriting a bunch of config files. However executing mkdir /srv/www results in permission denied. Using both sudo as executing it as a su does not resolve the error. Permissions of /srv are set to drwxr-xr-x and I'm only using a single disk that's mounted on /. No nfs shares.
user574007
May 29, 2023, 07:45 AM • Last activity: May 29, 2023, 09:57 AM
0 votes
0 answers
1432 views
Inside Docker: mkdir(-p): No such file or directory
I have encountered a strange problem where the mkdir -p command fails to create a directory and returns the following error message: ```bash [root@202 ~]# pwd /root [root@202 ~]# mkdir -p a/b/c mkdir: cannot create directory ‘a’: No such file or directory ``` However, if I execute the same command i...
I have encountered a strange problem where the mkdir -p command fails to create a directory and returns the following error message:
[root@202 ~]# pwd
/root
[root@202 ~]# mkdir -p a/b/c
mkdir: cannot create directory ‘a’: No such file or directory
However, if I execute the same command in the root directory, it works fine:
[root@202 /]# pwd
/
[root@202 /]# mkdir -p a/b/c
[root@202 /]# ls -lhrt a/b
total 0
drwxr-xr-x 2 root root 6 Mar 13 15:06 c
I am currently logged in as the root user, so I don't think it's a simple permission issue. Do you have any other ideas for troubleshooting? The permissions of the /root directory are as follows:
[root@202 ~]# ls -lhart /
dr-xr-x---    2 root root  114 Apr  1  2016 root
And when I tried to modify the permissions of the /root directory, I encountered the same strange phenomenon:
[root@202 ~]# chmod a+w ~
chmod: changing permissions of ‘/root’: No such file or directory
I am currently working within a Docker container and the system is CentOS 7. Docker version: 6e3bb8e/1.13.1 (released on 2017-02-08). Thanks in advance. --- The df of / and /root:
[root@202 /]# df -lh /root
Filesystem      Size  Used Avail Use% Mounted on
overlay         128G   14G  115G  11% /
If I try to create the /root directory (given the "No such file or directory" message earlier):
[root@202 /]# mkdir /root
mkdir: cannot create directory ‘/root’: File exists
Mer (9 rep)
Mar 13, 2023, 08:10 AM • Last activity: Mar 13, 2023, 01:01 PM
-2 votes
1 answers
889 views
how to create a directory that already exists with another name
i want to create directory called "A" inside my home directory but i don't know if such a directory already exists. i want to write a command that creates the directory if it does not exist. But, if the directory exists the command will create a new directory with the same name with a small addition...
i want to create directory called "A" inside my home directory but i don't know if such a directory already exists. i want to write a command that creates the directory if it does not exist. But, if the directory exists the command will create a new directory with the same name with a small addition that changes the name of the directory. The small addition should be random - that is, each time the command is run, a different addition will be received. For example, instead of "A" the command will create directory "A15" or "A7" or any such addition. It can be assumed that the new directory with the addition does not exist. The command will print the message !DONE in case the original directory "A" does not exist and it is created successfully or the message Directory exists. A new one has been created A05 where A05 is the new name
bara (19 rep)
Jan 19, 2023, 03:47 PM • Last activity: Jan 20, 2023, 10:27 AM
2 votes
1 answers
373 views
touch/mkdir seems to ignore default ACL
I am pretty sure it is a stupid mistake but I can't seem to figure it out by myself, so please have a look. I set up an ACL for the current folder like so: ```bash zigbee2mqtt@nuc:/tmp/folder$ getfacl . # file: . # owner: zigbee2mqtt # group: zigbee2mqtt user::rwx user:stack:r-x user:zigbee2mqtt:rwx...
I am pretty sure it is a stupid mistake but I can't seem to figure it out by myself, so please have a look. I set up an ACL for the current folder like so:
zigbee2mqtt@nuc:/tmp/folder$ getfacl .
# file: .
# owner: zigbee2mqtt
# group: zigbee2mqtt
user::rwx
user:stack:r-x
user:zigbee2mqtt:rwx
user:milkpirate:rwx
group::---
mask::rwx
other::---
default:user::rwx
default:user:stack:r-x
default:user:zigbee2mqtt:rwx
default:user:milkpirate:rwx
default:group::---
default:mask::rwx
default:other::---
zigbee2mqtt@nuc:/tmp/folder$ id
uid=978(zigbee2mqtt) gid=977(zigbee2mqtt) groups=977(zigbee2mqtt)
so when I now create a folder/file in that folder like so:
zigbee2mqtt@nuc:/tmp/folder$ touch foo; mkdir bar
It results in the following permission on the folder foo:
zigbee2mqtt@nuc:/tmp/folder$ getfacl foo
# file: foo
# owner: zigbee2mqtt
# group: zigbee2mqtt
user::rwx
user:stack:r-x
user:zigbee2mqtt:rwx
user:milkpirate:rwx
group::---
mask::rwx
other::---
default:user::rwx
default:user:stack:r-x
default:user:zigbee2mqtt:rwx
default:user:milkpirate:rwx
default:group::---
default:mask::rwx
default:other::---
which looks fine so far. But the ACL of the file then looks off:
# file: bar
# owner: zigbee2mqtt
# group: zigbee2mqtt
user::rw-
user:stack:r-x                  #effective:r--
user:zigbee2mqtt:rwx            #effective:rw-
user:milkpirate:rwx             #effective:rw-
group::---
mask::rw-
other::---
1. I would expect the mask to be rwx (desired). 2. Since group and other are --- (desired) the permission in ls -la to be the same, but they are:
zigbee2mqtt@nuc:/tmp/folder$ ls -la
total 20
drwxrwx---+  3 zigbee2mqtt zigbee2mqtt 4096 Jan 15 17:55 .
drwxrwxrwt  16 root        root        4096 Jan 15 17:59 ..
-rw-rw----+  1 zigbee2mqtt zigbee2mqtt    0 Jan 15 17:55 bar
drwxrwx---+  2 zigbee2mqtt zigbee2mqtt 4096 Jan 15 17:55 foo
but I would expect (and desire):
zigbee2mqtt@nuc:/tmp/folder$ ls -la
total 20
drwxrwx---+  3 zigbee2mqtt zigbee2mqtt 4096 Jan 15 17:55 .
drwxrwxrwt  16 root        root        4096 Jan 15 17:59 ..
-rw-------+  1 zigbee2mqtt zigbee2mqtt    0 Jan 15 17:55 bar
drwx------+  2 zigbee2mqtt zigbee2mqtt 4096 Jan 15 17:55 foo
**EDIT:** Ok, did some testing and all seems to work as desired, the result of ls -la does not seem to reflect the correct rights:
zigbee2mqtt@nuc:/tmp/folder$ sudo -u nginx -g zigbee2mqtt bash
nginx@nuc:/tmp/folder$ ls
ls: cannot open directory '.': Permission denied
milkpirate (123 rep)
Dec 28, 2022, 12:22 AM • Last activity: Jan 15, 2023, 06:46 PM
0 votes
2 answers
4102 views
move and make directory
I know its a big classical but I didn't found the exact situation that concerns me I need a `mkdir`+`mv` command that can be invoked like that : ```sh mvdir /home/user/Documents/irs.pdf /mnt/work/45/223/insight/irs1970.pdf ``` Exactly like a normal `mv` command works, just with a creation of path in...
I know its a big classical but I didn't found the exact situation that concerns me I need a mkdir+mv command that can be invoked like that :
mvdir /home/user/Documents/irs.pdf /mnt/work/45/223/insight/irs1970.pdf
Exactly like a normal mv command works, just with a creation of path instead of a no such file or directory Considering that work/45/223/insight/ doesn't exist and need to be created All other command that I've found can't be invoked like that, needs some more informations, need to distinguish the path and file ourself, or something Attempt: mkdir -p /mnt/work/45/223/insight && mv /home/user/Documents/irs.pdf /mnt/work/45/223/insight/irs1970.pdf
aaa (177 rep)
Nov 27, 2022, 10:39 AM • Last activity: Jan 1, 2023, 10:22 PM
-1 votes
1 answers
1878 views
mkdir error, permission denied
i was installed spotify yesterday with snap in kali linux, then i run with snap run spotify and i get error like this : snap run spotify WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement mkdir: cannot create directory '/run/user/0': Permission denied No protocol spec...
i was installed spotify yesterday with snap in kali linux, then i run with snap run spotify and i get error like this : snap run spotify WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement mkdir: cannot create directory '/run/user/0': Permission denied No protocol specified No protocol specified Unable to init server: Could not connect: Connection refused (spotify:9119): Gtk-WARNING **: 00:22:57.815: cannot open display: :0.0 can you help me fix this please, i just learn in this operating system
Rachmat Ashari (1 rep)
Nov 18, 2021, 10:57 AM • Last activity: Dec 4, 2022, 07:20 PM
0 votes
1 answers
197 views
replacing explicit user names with variables in mkdir and chown
**What specific changes need to be made in the commands below in order to use a variable username and a variable user_home to create a subdirectory within the current user's home and then to change ownership of the new subdirectory to the current user?** The current commands we are using in a GitHub...
**What specific changes need to be made in the commands below in order to use a variable username and a variable user_home to create a subdirectory within the current user's home and then to change ownership of the new subdirectory to the current user?** The current commands we are using in a GitHub ubuntu-lastest runner are too brittle because the following commands use the explicit name of the user: mkdir /home/runner/mysubdirectory/ sudo chown -R runner:runner /home/runner/mysubdirectory/ This OP is asking how to replace /home/runner with a variable declaration of the current user's home, and how to replace runner:runner with variable representations of the current user's name.
CodeMed (5357 rep)
Nov 19, 2022, 12:03 AM • Last activity: Nov 19, 2022, 09:28 AM
50 votes
9 answers
20881 views
mkdir -p for files
`mkdir -p` will create a directory; it will also make parent directories as needed. Does a similar command exist for files, that will create a file and parent directories as needed?
mkdir -p will create a directory; it will also make parent directories as needed. Does a similar command exist for files, that will create a file and parent directories as needed?
Zombo (1 rep)
Jan 30, 2013, 09:09 AM • Last activity: Nov 17, 2022, 03:29 PM
Showing page 1 of 20 total questions