Questions tagged [directory]

A file system structure in which to store computer files.

Filter by
Sorted by
Tagged with
12 votes
1 answer
1k views

Why did 'scp 10.0.0.11:/home/someuser/.*' start copying from /home as well?

I'm doing my first ever moving of user files from an old system to a new system. My goal is to use SCP for it's simple syntax of scp -r source destination. I tried the following command to copy the ...
  • 262
2 votes
1 answer
132 views

How to "listen to" directory size changes?

I need to do some actions when a directory grows above a certain size limit. Obviously, obtaining the size can be done with du, but a single run of du takes a long time in my case, loads the disk ...
0 votes
1 answer
45 views

Too many levels of symbolic links issue

Whenever I attempt to cd my Downloads folder to run a C# program that I have written, I keep getting this message. When I try moving the file to snap and/or socket (the only two which are responding ...
0 votes
1 answer
65 views

Bash find directory name

I have a script which takes number then moves it to variable $n. Question how we can find directories which are contains this character/number in their name?
0 votes
0 answers
24 views

Is there a fast command like tar --remove-files that leaves file chunks in place?

I create hundreds of thousands of files, each several megabytes, resulting in directories (and subdirectories) containing a TB or more. To move the data to another drive, 'cp' tends to slow down over ...
-1 votes
1 answer
32 views

Machine readable output of "diff -r"

Is there any machine readable output for comparing two directories with diff? If I do diff -rq a b I get: Only in a: aa Only in b: bb Files a/t and b/t differ But maybe something like the following ...
0 votes
1 answer
21 views

Remove/move files in a directory with filename timestamp pattern

So I have files that need to remove/move/filter. All files have this pattern like this in a directory, let's say directory frames contain this pattern filename timestamp_in_nanosecond.jpg. And this is ...
1 vote
3 answers
44 views

Detect leaf directories in Perl

For a Perl script I'm working on, I'm looking for a fast and reliable way to find all subdirectories (transitively) of a given directory which are leaves, i.e. those not having any subdirectories of ...
1 vote
1 answer
310 views

copy/paste not working in ubuntu22

just copied some files from /home/user/Downloads directory and tried pasting into ntfs filesystem,and got this way "could not paste files;permissions do not allow to paste files in this directory&...
0 votes
2 answers
56 views

Script to monitor directory size change

I need a bash script to monitor directory size change. The directory is a NFS file system with multiple users (500-600) who have sub-directories with vastly differing sizes. E.G /home/nfs/xxx/ccc etc. ...
  • 1
0 votes
0 answers
11 views

How to get Nemo in cinnamon to use the directory name as the taskbar text?

I'm using Cinnamon 5.2.7 and nemo 5.2.4 (on a Devuan GNU/Linux daedalus system). Unfortunately, in the taskbar, all of the nemo windows have the title Files rather than whatever the folder name is ...
  • 7,683
0 votes
1 answer
24 views

Create directory using filenames and move the files to its respective folder

My question is a bit different than: Create directory using filenames and move the files to its repective folder Since in the same folder I have two similar copy of each file like: 001.txt and 001(1)....
2 votes
2 answers
96 views

How do I add to PATH a directory with colon (":") in it?

Here I found the file with ..:; name. mkdir '..:;' worked fine. But in PATH directory names are split by :. How to add this directory to PATH?
  • 205
0 votes
1 answer
77 views

What happens when you name a folder as ".."?

Instead of moving a folder to parent directory, I renamed it as ".." using mv folder_name ... Do you have any solution to recover the folder or is it just deleted? (macos 12.4)
  • 3
0 votes
0 answers
17 views

chmod 014 directory listing permissions [duplicate]

Say I login as root and create a directory > mkdir /mydir Now I create a group mygroup > groupadd mygroup Then I add a user someuser to the group mygroup > usermod -a -G mygroup someuser ...
0 votes
0 answers
32 views

Directory on an NTFS drive suddenly became hidden and doesn't list but it exist

An NTFS drive is mounted which i use as storage, i was copying some files to some of the directories in the drive and before i realised one of the directory named Java went hiding ( it doesn't appear ...
0 votes
1 answer
100 views

How can i create sub directories within a directory? [closed]

I am trying to make a photo organizer with a zsh shell script. But i am having trouble creating sub directories within each main directory(based on date). Currently the script starts from a folder i ...
0 votes
0 answers
28 views

Typo3 - Folder "/" does not exist - Error

When I am in the backend in the filelist Module or want to link something, I get the error message: "#1314516810: Folder "/" does not exist." (see screenshot). The folder exists of ...
  • 1
1 vote
1 answer
69 views

Is "running a folder" possible in Linux?

Is there a philosophy behind running a folder as an executable in linux? user@node main % ls -lash ./bin total 0 0 drwxrwxrwx 2 user staff 64B May 23 21:04 . 0 drwxr-xr-x 6 user staff 192B ...
1 vote
2 answers
313 views

Set up a shortcut to open terminal in a specific directory

As far as I know, when you hit Ctrl+Alt+T, the Linux terminal pops up. However, it opens in the default home directory. I want to set up this shortcut to open in the directory I am currently in at my ...
  • 109
0 votes
0 answers
28 views

Can we set user permission to create a file but not a subdirectory in a directory? [duplicate]

Is it possible to give permission to only create files but not a directory to a user in linux? abc@xyz:~/temp$ touch a abc@xyz:~/temp$ mkdir b abc@xyz:~/temp$ I want mkdir b to fail but touch a to ...
1 vote
0 answers
328 views

How to create a shared folder between Linux and Windows?

How to create a shared folder between Linux and Windows? If possible, do not use additional applications. If it's not possible, please tell me the app that can be used. These are my previous steps: ...
0 votes
1 answer
27 views

Missing directory after move to a link

I have the following dir structure zfs filesystem - /opt/test/tmp zfs filesystem - /opt/data/ I have two directory links: /opt/test2/_tmp -> /opt/test/tmp /opt/test2/_tmp2 -> /opt/data In /opt/...
  • 796
1 vote
1 answer
48 views

Why do I have capacity in an empty folder?

Why do I have capacity in an empty folder? I found a strange thing while I was developing after seeing the company's old project. It was strange that the folder had a capacity of 36M, so I entered the ...
0 votes
2 answers
55 views

A directory that is owned by some non-superuser, but can't be deleted by them

Is it possible to create a directory that its owner can't delete? Let's say I have directory bar owned by user foo, and I'd like to create a subdirectory bar/baz, also owned by foo, such that: foo ...
  • 735
1 vote
0 answers
53 views

How merge two directories? [closed]

For example i have dirA, dirB - all with subdirectories. I want to merge dirA into dirB with "force" dirA. I tryied to use this /usr/bin/rsync -avh --progress dirA dirB But "force"...
1 vote
1 answer
133 views

How to list directories I have access to?

I don't know how to describe very well the situation. I don't have access to a directory, but I do have access to some stuff within that directory. For example: In /path [me@pc path]$ ls ls: cannot ...
0 votes
0 answers
53 views

Change to the same directory as the other pane in tmux

When there are two panes in a current window of tmux session, is there simple way to change to the same directory as that of the other pane? -- I found the answer at https://superuser.com/a/911890, ...
  • 238
0 votes
0 answers
26 views

Directory on external disk marked as an empty file

I've an external disk (FAT32) with a folder called archiwum where I keep all the photos and videos (kind a of a backup). Unfortunately when I connect the disk to my mac via USB it does not recognise ...
  • 101
0 votes
1 answer
356 views

Finding a string in multiple folders that are in the same directory

I have a directory A that has multiple folders, and I want to find a string in those folders. How can I do it? I have tried grep -rw string * in A, but it takes a lot of time.
0 votes
1 answer
57 views

For all zips, and unzip in working directory and maintains its structure

With this command find . -name '*.zip' -exec unzip '{}' ';' we find all zip files under . (directory), then unzip them into the current working directory, However, the structure is gone. /backUp/...
0 votes
1 answer
23 views

In bash, how do I delete child directories older than the date that another directory was created?

I can use the following command to delete child directories in a particular directory older than x number of days find /path/to/base/dir/* -type d -ctime +10 -exec rm -rf {} \; but how would I delete ...
  • 1,952
1 vote
1 answer
270 views

What should dirname and basename be in this command?

With this command, we can recursively unzip archives in a directory and its sub-directories and remain its structure in the current working directory. find ../backUp/ -name "*.zip" | ...
0 votes
0 answers
23 views

Recursive bind mount not working android x86 7.1.1

I have 3 directories: a, b and c. Directory 'a' contains the subdirectories '1' and '2', and these sud-directories both contain files 'foo' and 'bar'. Directory 'b' also has subdirectories with the ...
0 votes
1 answer
257 views

WSL Linux doesn't known directories on other partition exist - Help

Title explains it, I got a new installation of Linux on WSL and it doesn't see existing directories on my laptop. I'm not sure what the issue is, I've tried what was on the net to assess the issue to ...
1 vote
1 answer
465 views

How to bulk rename files/directories containing spaces?

How can you bulk rename many files and/or directories by replacing a snippet f o o with b a r in the file/directory name? For each suggested method, preferably answer the following questions. Is it ...
  • 153
0 votes
0 answers
58 views

Why doesn't creating file with echo work for remote directories in this script?

I aliased the following script: #!/usr/bin/bash if [[ -d "template.html" ]]; then : else cp -n /home/$(whoami)/CS/Software/Pollen/template.html . fi /usr/bin/echo "#lang pollen [...
0 votes
0 answers
180 views

How to move files and maintain directory structure

I need to move files from one place to another and keep the structure that the original directory has. The parameter for this file to be moved would be to have more than 365 days without access and ...
0 votes
3 answers
86 views

What would be a command to zip all folders in a directory

I have a few folders in a directory that I want to zip individually. Root -folder1 -folder2 into: Root -folder1.zip -folder2.zip -folder1 -folder2 What would be a command to ...
  • 135
4 votes
2 answers
255 views

Should TMPDIR have a trailing slash?

In Unix/POSIX/Linux systems it's possible to set the temporary directory via the TMPDIR variable. Wikipedia references a specification by the Open Group mentioning this. What this doesn't answer for ...
  • 81
0 votes
0 answers
63 views

How to remove hardlink to /home created by timeshift?

After installing timeshift on Kali Linux, the same device/drive with a different name/path was created as seen in the system monitor under the File Systems tab: Even after uninstalling timeshift, the ...
0 votes
0 answers
34 views

sftp directory-change shortcut

If sitting at an arbitrary unix desktop system and using sftp (e.g. OpenSSH as shipped by Debian) to contact another arbitrary system, is there any shorthand that can be used to switch to the same ...
0 votes
0 answers
45 views

the suggestions about restoring the directories under /var?

Terribly sorry for this basic question, I'm a newbie to the linux world. Currently I have a RHEL 7.5 machine which should normally have the following stuff under /var directory: adm, cache, crash, db, ...
0 votes
1 answer
99 views

Setgid on a directory is not giving execute permission on the file within directory

I have created directory as following: root@host [~]# mkdir mydir root@host [~]# ls -ld mydir drwxrwxr-x 2 test test 4096 Mar 2 19:36 mydir root@host [~]# Then I have changed the group ownership ...
  • 161
1 vote
1 answer
51 views

Setting setuid on `mkdir` without making it as executable

I am setting setuid on mkdir without making it as executable. chmod u+s /usr/bin/mkdir chmod u-x /usr/bin/mkdir [root@rhel-85 /]# ls -l /usr/bin/mkdir -rwSr-xr-x. 1 root root 84664 Jul 9 2021 /...
  • 161
0 votes
1 answer
194 views

Can't access directory from netns

I created a simple test netns : sudo ip netns add test Then I brought up the lo interface. I'm currently in the home directory of user1, and by executing sudo ip netns exec test ls -la I see all the ...
  • 1
1 vote
3 answers
96 views

Can one do the equivalent of "rm -rf targetdir && mv sourcedir targetdir" with one command?

There are a few ways to interpret the operation of "replacing one file with another", but the one I want to focus on here is the one that can be achieved with the command mv /that/there/...
  • 13.4k
0 votes
0 answers
29 views

Log directories that users go to

Is there any way to log the directories that a user goes to? For example as soon as the user jack goes to /home/jack/music/ there is a log that shows he went to /home/jack/music/.
  • 1
1 vote
3 answers
249 views

How to find if a directory is having a symbolic link as well with any other names

lrwxrwxrwx. 1 oracle oinstall 10 Oct 14 03:47 abc -> xyz drwxr-xr-x. 6 oracle oinstall 4 Oct 26 21:11 xyz i want to find that xyz is having a symbolic link with name abc
's user avatar
1 vote
2 answers
398 views

bash + test if folder is empty but exclude files with a leading dot

We used the following approach in order to verify if a folder is empty: [[ "$(ls -A /var/folder)" ]] && echo "not empty" on /var/folder, we did the following: ls -l /var/...
  • 11.4k

1
2 3 4 5
34