Questions tagged [directory-structure]

The layout of the directory hierarchy — questions like “where does this file belong?” or “what is this directory for?”.

Filter by
Sorted by
Tagged with
0 votes
1 answer
35 views

Move /var and /home directory on a separate NVME partition

I am using Debian 11 I would like to move /var and /home directories to a NVME partition nvme1n1p1 I have attached to the server. EDIT: I am able to move the home folder and bind to the partition. But ...
user avatar
  • 101
0 votes
3 answers
47 views

How to copy all files with same extension between identical directory structures?

I have 2 independent folders A and B. B has many files with the extension .build. Across A there are a fe subdirectories that have the same structure as subdirectories of B. For example A has ...
user avatar
  • 113
1 vote
1 answer
74 views

$XDG_CACHE_HOME vs. $XDG_STATE_HOME

Based on the XDG Base Directory Spacifications, $XDG_STATE_HOME should store history and log of the programs. But it is very common to see UNIX programs storing these kind of stuff at $XDG_CACHE_HOME, ...
user avatar
0 votes
1 answer
21 views

Create a tar.gz file from a different directory, tar must keep files in specific directory structure

Here is my file structure. I am currently residing in test2/ directory, and all commands must run from there. test/ |_test2/ publish/ |_subfolder1/ |_f1 |_f2 |_f3 |...
user avatar
  • 285
-3 votes
1 answer
62 views

What does 'cd ../..' mean in linux?

I am aware that cd is used to navigate between files in linux commandline. However, I am not sure what the following, that I came across while trying to replicate something, means: cd ../.. It was ...
user avatar
0 votes
0 answers
13 views

How to create a seperate install directory for softwares/ libraries/ applications in Ubuntu?

I want apt-get install files, .deb files and custom install files to be installed in this location. I'm going to do a fresh install of ubuntu on my office laptop. In windows, you can move the program ...
user avatar
0 votes
1 answer
31 views

Find all files OR directories (without contents) that match a name

I'm trying to write a find command that searches for all files or directories with the name andreas in them (forward slashes added for clarity). ~$ find . -iname '*andreas*' ./Documents/Resume - ...
user avatar
  • 9,503
0 votes
2 answers
34 views

When looking at subdirectories, skip one directory

I have a directory /u01/oracle/folders with these subfolders: [root@ricusesasctl01vm tax_receipts]# ls -ltr total 64 drwxr-xr-x 5 OICDev1 oic 4096 Mar 1 2021 Argentina drwxr-xr-x 5 OICDev1 oic 4096 ...
user avatar
2 votes
0 answers
36 views

Is it reasonable to have a network-mounted home dir but a local ~/.cache?

I want to free up some space in my network-mounted home directory. I'm noticing that my .cache directory is very big. I was wondering whether I should replace it with a symlink, ~/.cache -> /...
user avatar
  • 7,249
0 votes
2 answers
27 views

What directory specifications need to be followed on servers?

On PCs, the XDG Desktop specifications allow the individual desktops to set different folders for various data. When writing an application that will only ever be run on servers, should one simply ...
user avatar
  • 133
13 votes
2 answers
4k views

What is the difference between /lib and /usr/lib and /var/lib?

What is the difference between /lib and /usr/lib and /var/lib? Some of the files are symbolic links that "duplicate" content of other directories.
user avatar
  • 160
2 votes
1 answer
151 views

What is the correct place for driver sources?

I have some sources I want to compile using make. The sources will be compiled into a driver I'm going to use. What is the correct place for such files? /usr/share? /opt? /usr/local/...? Edit: the ...
user avatar
0 votes
0 answers
192 views

Rsync Copy failure

I am decommissioning an old intel Windows domain controller and moving the files to a raspberry pi running openmediavault. I am trying to use rsync to copy the files but am getting some strange ...
user avatar
0 votes
1 answer
47 views

Inspecting two directory trees

How can I inspect two directory trees to determine if they are identical. Are there some good tools that allow tree merging that is free? I am using Ubuntu Linux 20.04 LTS on an x86_64 architecture. I ...
user avatar
  • 155
0 votes
1 answer
65 views

What's the most appropriate directory where to place development software shared between users?

About share data (files and directories) among users within the same machine, has sense use the /srv directory it according with: What's the most appropriate directory where to place files shared ...
user avatar
0 votes
1 answer
32 views

Opening file from sd card using dmenu

I would like to use dmenu to open files. I figured out how to get this to work if the file is in my home directory: #!/bin/sh FILE="workbook.pdf" zathura "$FILE" However, I ...
user avatar
-4 votes
2 answers
200 views

Why does every directory have "." and ".." dots? [duplicate]

A historical question. I tried searching for the answer to this, but no luck. Every directory contains a "." and "..", even ROOT (/) contains "..", but why? Neither seem ...
user avatar
  • 1,736
0 votes
1 answer
129 views

What might be an equivalent to Linux /opt/ in OpenBSD?

In OpenBSD there is no /opt/, as there is with Linux. From man hier in Ubuntu Server 18.04: /opt This directory should contain add-on packages that contain static files. What would be a ...
user avatar
  • 423
0 votes
2 answers
419 views

DD command included directories

I'm learning the dd command in Linux. For test purposes, i initiated this command: sudo dd bs=4M if=/dev/mmcblk0 of=/media/some_remote_host/stuff/myImage.img I know that dd is for taking an image of ...
user avatar
  • 115
0 votes
2 answers
112 views

What does mounting do in Linux and why do files appear in both /dev and /media after mounting?

I'm pretty new to Linux and I've been trying to understand how the file system works but I just can't seem to get what mounting is. I've seen several other questions on this site explaining but they ...
user avatar
0 votes
0 answers
67 views

How to rebuild original file structure from the "Lost" folders that show in UFS Explorer Professional Recovery

"Documents" folder had been deleted on CentOS which used LUKS & XFS. UFS Explorer Professional Recovery has been able to recover what it seems all documents that were inside this folder ...
user avatar
  • 133
0 votes
0 answers
168 views

Rsync & MergerFS creating directories one by one

I have mergerfs setup with the default policy of epmfs. This means if I have local/target/ on all disks and copy files into local/target/, each file will get copied to the disk that has the most free ...
user avatar
2 votes
1 answer
61 views

How can I move all files matching a pattern into a new folder?

I have files like these : - REPORT_100_COMPLETED.csv - REPORT_100_FAILED.csv - REPORT_101_COMPLETED.csv - REPORT_101_FAILED.csv - REPORT_102_COMPLETED.csv - REPORT_102_FAILED.csv I want all of them ...
user avatar
0 votes
1 answer
61 views

True contents of a directory in a *nix system [duplicate]

I am learning about *nix file systems. In particular, I've been following this tutorial https://www.grymoire.com/Unix/Inodes.html interspersed with some Googling & whatnot. Is the true form of a ...
user avatar
2 votes
1 answer
44 views

Figuring out why permission is denied on a file by recursively checking permission on parents

I get permission denied on a file /some/very/long/path while trying to do df on it. I try to do df /some/very/long and get the same. Then I go one more level up df /some/very, still same. Finally, ...
user avatar
0 votes
2 answers
142 views

merge multiple files in several subdirectories into 1 file for each subdirectory and delete original files

I have a directory structure DIR SUBDIR1 11-01-11.txt 13-05-23.txt SUBDIR2 12-05-56.txt 13-04-02.txt ...
user avatar
  • 91
6 votes
2 answers
601 views

How to mirror directory structure and files with zero size?

I am trying to mirror the directory and file structure of a particular directory. However, I want the mirrored files to have no size. So for example, if I had the following directory tree: ...
user avatar
0 votes
1 answer
49 views

What is convention on where to install cross-platform libraries?

What is the prevailing (or correct) convention on where to install cross-platform libraries? E.g. libfoo.so.1.0.0 compiled for the host might typically be located at /usr/local/lib/. If I also had to ...
user avatar
  • 1,291
0 votes
1 answer
41 views

command that display the directory and the files inside that directory like a tree

To get information about a directory we should use a certain command, so what command that display the directory and the files inside that directory like a tree in Linux? Thank you.
user avatar
0 votes
1 answer
86 views

Move specific file types in subfolder to destination folder but without loosing subfolder structure

first of all I have very limited knowledge in Linux but I am always trying my best. I also have already automated a lot of things in my Unraid Server and RPi by using Cronjobs and scripts, but now I ...
user avatar
  • 1
0 votes
0 answers
32 views

Creating a chart of directory structure on a complicated Linux server

Im part of a development team for a certain server. Our project has a lot of old/legacy stuff, including code and design, and for this iteration at least it will remain like this. The server is Debian ...
user avatar
  • 177
1 vote
1 answer
113 views

Add directory to manpath based on users input

Using: Ubuntu 20.04.1 LTS Editor: Nano I am working on a small shell script for college and it needs to have menu with a range of options available to the user. One of the options is to "add a ...
user avatar
  • 11
0 votes
0 answers
112 views

How can I make a dummy directory tree with dummy files that contain realistic data?

I'm looking for preferably a one-liner that drops a directory tree a few layers deep with files that contain "realistic" data, as in, not /dev/zero nor /dev/urandom. Data that noticeably ...
user avatar
  • 293
-2 votes
2 answers
148 views

How to run a loop in all directories inside a directory [duplicate]

Let's say I have a directory called /tmp/main and inside it I have 100 other directories . I want to run a loop through each directory of those directories, for example to make a file with touch test....
user avatar
  • 327
0 votes
1 answer
65 views

Print only files, directories containing files and empty directories

I am trying to index some LTO tapes (and some hard disks as well) and would like a simple output, stored in a text file. Something like the example below: ... /home/norg/Desktop/empty\ dir/ /home/norg/...
user avatar
2 votes
1 answer
573 views

How to organize /opt?

I'd like to place a handmade script in its conventional place and folder structure. It's currently located in /opt/chkobm/chkobm, but it seems like a bad practice since it requires $PATH to include ...
user avatar
  • 243
1 vote
0 answers
258 views

Show files modified after a particular date ('find') in hierarchical format ('tree')

I'm trying to view files modified before or after a certain date using the hierarchical output of the Unix tree command. For example, I know that one can use tree to sort files chronologically and ...
user avatar
0 votes
1 answer
97 views

How to rsync a large directory tree, but only leaf directories that match a regex?

This is easier to explain with an example. Imagine I have a directory structure as follows: pics/cats/png/01.png pics/cats/png/02.png pics/cats/jpg/01.jpg pics/cats/jpg/02.jpg pics/dogs/png/01.png ...
user avatar
  • 321
3 votes
2 answers
6k views

Why is /var/lib used by application for storing data?

MySQL, fail2ban and many other server applications store their data in /var/lib. Are they using the correct directory? If so why is it named lib, which implies libraries?
user avatar
  • 579
0 votes
2 answers
146 views

Tree structures and directories [closed]

I need to draw the tree structure of the following code. cd /; mkdir a b c a/a b/a; cd a; mkdir ../e ../a/f ../b/a/g; cd../b/./; mkdir /a/k a/b ../a/./b /c I know that: cd /; (goes to root) , mkdir ...
user avatar
0 votes
1 answer
202 views

Listing the content of the SFTP working directory

I am trying to create SFTP Account and I have the following configuration in /etc/ssh/sshd_config Match group sftpgroup ChrootDirectory /sftp/ X11Forwarding no AllowTcpForwarding no ForceCommand ...
user avatar
1 vote
1 answer
145 views

Copy directory structure and sample of files from remote system

I would like to recreate the directory structure from a remote system to a local system and copy a sample of the files in each directory (e.g. copy only 5 files from each directory). There may be many ...
user avatar
  • 11
0 votes
1 answer
447 views

remove user access from /tmp directory

Is it possible to remove access of /tmp directory for a particular user, i.e user should not be able to even read /tmp directory ? I know tmp directory has 1777 permission and let every user to ...
user avatar
2 votes
1 answer
21 views

Are package file listings supposed to include only distributed files, or runtime generated files too?

I've been looking for where some files on my system have come from, such as (for sake of having an example, but question not specific to this) /etc/udev/hwdb.bin: $ pacman -Qo /etc/udev/hwdb.bin ...
user avatar
  • 1,588
2 votes
3 answers
49 views

Messed up Folder structure. Is there a way to delete the empty subfolders except one?

After trying to reorganize my movie folder on my Debian machine, I ended up with a structure like this: ├── Universal.Love(2017)(1080p) │   └── Universal.Love(2017)(1080p) │   └── Universal.Love(...
user avatar
1 vote
2 answers
144 views

Unix: ".." doesn't point to parent -- how is this possible?

I recently ran into the following problem on a Solaris 11 system I do development on: Somehow, a few directories had their parent pointer (..) pointing to a different directory from the parent. Let'...
user avatar
3 votes
2 answers
103 views

How do I copy files across/outside symbolic links? (dest) [duplicate]

Suppose I have a file system like this: /home/me/dir1/dir2/dir3/dir4/dir5/dir6/file1 Then in /home/me/dir1, I create a symbolic link: $ cd /home/me/dir1 $ ln -s /home/me/dir1/dir2/dir3/dir4/dir5/...
user avatar
0 votes
1 answer
71 views

how copy and move files in Ubuntu Linux

Trying to use the copy move and remove commands in Linux but always get error messages. There are three symbols in Linux directory structures that I'm having a hard time with These are ".", "~", and ...
user avatar
3 votes
1 answer
538 views

`tree` horizontal display

Is there an alternative to tree command (or some way using the tree command itself) to print the directory structure horizontally? Quite often, I have a tree structure, for which I have to scroll a ...
user avatar
  • 4,358
2 votes
0 answers
252 views

Where should I put web application code in the file-system hierarchy [closed]

What would be the most FHS compliant and standard location for putting the source code of a web-app, let's say a Flask app, be? I've looked around and haven't found any definitive and satisfactory ...
user avatar
  • 141

1
2 3 4 5
9