Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [directory-structure]

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

0
votes
1answer
35 views

Where should I store my application files (data, cache, logs, crashes, etc.) [on hold]

Although I did some research on this subject, I couldn't reach the exact information I wanted. Actually, not exactly disclosed, everyone approached in a different way. For the: Filesystem Hierarchy ...
0
votes
1answer
29 views

What is a good command for moving a directory containing relative symbolic links to files outside the directory?

I like to use relative symlinks when possible because they stay valid even when my filesystem is mounted in a non-root location, for example if I am accessing it remotely. However, if I move a ...
1
vote
1answer
35 views

On FreeBSD, or other BSDs, what directory is commonly used for data folder storing the content of a database such as Postgres

I am wondering if there is a convention on where to store the data folder containing all the files for the tables and rows of a relational database system such as Postgres.
0
votes
0answers
19 views

What is the directory “/home/[username]/.checkers” and why is it owned by root?

This is for a website that has been passed from one WHM/Cpanel hosting environment to another. It's running the Loaded Commerce shopping cart and ShipRush shipping plugin. The ShipRush plugin needed ...
0
votes
2answers
31 views

How to create file with text in every subfolder?

For example I have a hierarchy a/b/c. How do I crate a file with name d.txt and text "Hello World" in every folder a, a/b and a/b/c?
-2
votes
1answer
46 views

A directory showing up in itself [closed]

I do cd ~ and then pwd. It shows /root. Then I do ls. It again shows root. This is NOT another directory with the same name because when I do cd root, it says -bash: cd: root: Not a directory. ...
0
votes
1answer
107 views

Creating a file named '.' and how to read and write data to it?

How would I create a file named . (dot) and read or write data to it, given that . also refers to the current directory? I know this is possible because I have a directory structure. I'm looking at ...
0
votes
0answers
50 views

What's the right way to add directories to XDG_DATA_DIRS?

I've installed some app under /opt/myapp, which has a /opt/myapp/share directory. As I finish installing, it tells me: Note that '/opt/myapp/share' is not in the search path set by the XDG_DATA_HOME ...
4
votes
1answer
465 views

Wget: downloading files selectively and recursively?

Question about wget, subfolder, and index.html. Let's say I am inside "travels/" folder and this is in "website.com": "website.com/travels/". Folder "travels/" contains a lot of files and other (sub)...
1
vote
0answers
49 views

doubts about the Linux filesystem hierarchy [duplicate]

I'am trying to learn about the filesystem hierarchy but I can't get my mind wrapped around some of the concepts. /mnt: What do I put here? In theory, is a place for mounting temporary file systems so,...
1
vote
2answers
72 views

Can you change permissions for a child directory that you do not own?

Picture a scenario in which you have a parent and a child directory. In the parent directory you have given group rwx. Below that directory you have a directory in which the group permissions are --- (...
1
vote
0answers
22 views

Should application directory names include version numbers? [closed]

I have an application which is expected to have occasional updates. For my sins, its a .Net Core app running on Centos as a systemd service. The service is expected be available running more or less ...
-1
votes
1answer
66 views

How to run a script file

Using Mint Linux 19 here. I have a script file called test.sh. This script-file is located in a path e.g. /home/shyam/Mi A1/tissot, and I use it to flash Android system on my phone. The script ...
0
votes
2answers
94 views

mksquashfs: how to include full absolute directory paths inside the squashfs image?

When I create a squashfs image from multiple directories such as: /bin/ /usr/bin/ /usr/local/bin/ /some/other/random/folder/ /another/long/path/ If I use command... mksquashfs /bin /usr/bin /usr/...
0
votes
1answer
93 views

Why is ls -i slower than ls?

I know that ls lists the names of the files in a given directory and ls -i shows the names and the inode numbers. But why is it slower? EDIT: This happens with big directories The names and the ...
0
votes
1answer
22 views

Conventional directory for application build source [duplicate]

I know this is rather subject to opinion but what are some good choices where on the file system to locate the source code of a build that the server builds (let's say it's a build/integration server)?...
-1
votes
1answer
57 views

Why do relative paths that traverse a symlink in reverse resolve using the true path?

Either I've completely misunderstood something about symlinks (most likely), or their behaviour has changed at some point and I'm now catching up. I have a script directory that resides somewhere on ...
10
votes
1answer
305 views

Have group permission but unable to create file

This question is originally posted on rsapberrypi stackexchange. Since it is not so raspberrypi-related, I think it's better to post here. I found a strange thing while playing with pi3B. I want to ...
0
votes
3answers
56 views

Solution to change directory passing a directory pattern as the parameter

I'd like to get any script or Linux solution to implement changing directory passing not exactly a directory but a pattern as the parameter. Something like this: # Ex: I'd like to execute a "cd" to a ...
1
vote
1answer
41 views

How to Define Custom Conditional Expression Primaries in Bash?

How would I redefine and/or define new conditional expression primaries in bash? For example, I would like a primary that tests for the existence of an empty directory. Of course, it would be ...
0
votes
0answers
224 views

What is the difference betweeen “~/.local/share” and “~/.local/share:”?

Under my ~/.local directory I have two sub-directories named share: and share. Upon inspection, there seems to be little difference between the two, both of them containing, as you'd expect, local ...
1
vote
2answers
32 views

copying files recursively without preserving directories

I have a bunch of directories that contain MP3 files inside. These directories contain no other directories inside. How do I delete all directory structure without deleting the files? That would be ...
1
vote
0answers
22 views

Listing only shallowest directories containing no files, all the way down

Supposing this file system structure: ROOT DIR1A FILE DIR2A DIR2B DIR3A DIR1B DIR2C DIR2D DIR3B DIR1C DIR2E ...
0
votes
2answers
84 views

Can't install to Cygwin's MinGW sysroot (it's protected)

I have built a library with this command: $ ../configure '--host=x86_64-w64-mingw32' --prefix=/usr/x86_64-w64-mingw32/sys-root/mingw && make && make install Installation fails ...
2
votes
0answers
44 views

Exclude sub-directories from tree output [duplicate]

I would like to document a directory structure, and installed tree to do so. I don't wish to include files but only directories and symbolic links which point to directories (haven't decided if the ...
2
votes
2answers
202 views

Wildcard not being interpreted in if statement

I am currently writing the below script. The code looks at a certain directory for a filename inputted by the user. The script first checks to see if the input file is a gzip, if so, it runs the ...
2
votes
1answer
1k views

Is there a home directory location for overriding icons?

There are a few home directory locations that complement /usr locations. Files in these locations override their /usr counterparts. For example: ~/.local/bin complements /usr/bin ~/.local/share/...
2
votes
2answers
48 views

Where do I install non-end user commands?

In a project of mine I have a couple of specialized commands which are only called by other commands, and are not supposed to be invoked by the end user. Should these internal commands be installed in ...
0
votes
1answer
373 views

How to prepend a directory to files placed in a tar archive?

I want to tar the files foo and bar into a tar archive archive.tar, but I want them to appear, within the archive, as being within a directory, bazdir. Thus when I untar someplace I want bazdir to be ...
0
votes
1answer
30 views

Merging Directories Based on their Suffix

I have a directory structure produced during archiving. The archiving system can't be changed. Whenever a duplicate directory occurs the archiver appends an integer suffix to the directory name. My ...
0
votes
4answers
45 views

How can I do subdirectory manipulation in shell?

For example, running a command on n-number of sorted subdirectories, where n is an input. Or how can I run a for loop on a range of subdirectories where I can give that range as an input? Like the ...
1
vote
1answer
110 views

Should I install programs directly into /usr/local or a subdirectory in usr/local or into /opt? [duplicate]

I want to install PHPStorm IDE on my PC. The Linux version is distributed as a .tar.gz archive which contains bin, help, jre64, lib, license and plugin directories and 2 text files. I have searched ...
1
vote
0answers
155 views

${HOME}/Desktop directory somehow got moved in Linux Mint

I started up my laptop PC today and the Desktop directory inside my home folder has somehow been moved into a place other than ${HOME}/Desktop and another Desktop directory exists inside my home ...
0
votes
1answer
170 views

The content of directory /dev/fd have difference file in one time

I have such command. #echo -e "ls\npwd" >test #bash #exec <test After this code.You will find #ls /dev/fd 0 1 2 3 #cd /dev/fd;ls 0 1 2 255 Fun,the directory /dev/fd have ...
1
vote
1answer
19 views

Proper location for software on non-boot partition

I've got a computer that boots off an SSD, with an HDD for miscellaneous user data (currently, my /home partition). I want to move some installed software from /usr/local/bin to a directory on the ...
0
votes
1answer
116 views

lftp changes directory size without changing files in directory

i used this code to backup a directory to an ftp mirror -R /media/root/7CBAA4537758FCA/SAVE/DeesBootCD_SlipStreamed2/ /luksftpmnt/put-into-images-folder/DeesBootCD_SlipStreamed2 and it worked well ...
2
votes
4answers
2k views

Is the bin/ directory for storing binary files?

I have seen many tutorials saying that the bin directory is used to store binary files, meaning there is only 0 and 1 in the files in that directory. However, in many cases, I see files in bin that ...
1
vote
1answer
195 views

$HOME/.cache - on a small SSD or on an HDD?

I have a system with a small SSD (about 90 GB available for my single Linux partition mounted as /) and a much larger HDD. Now, my home directory has been balooning in space, filling up all of the ...
3
votes
2answers
1k views

The different uses of folders in the / (root) directory

There are a lot of folders in the / directory what do they all do? I know a few like /dev has links to devices in the system but what about /lost+found or /proc I just am curious.
1
vote
0answers
25 views

Which subfolders of $HOME should I put on a scratch disk, and which on a backed-up one?

On my computer at work I have Fedora 24 installed (not my choice). My home folder is NFS-mounted and backed up routinely. I also have a pretty large local disk which is not backed up. Now, I've been ...
2
votes
3answers
581 views

Why isn't the var directory user-specific?

I'm quite new in the UNIX world, so feel free to let me know if my question is silly. So-called Filesystem Hierarchy Standard states that the /var directory is supposed to keep data like logs and ...
3
votes
0answers
95 views

Where should be located a web application in Linux?

Here is an example of the file structure of a Linux distro: https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-filesystem-fhs.html Each directory has a specific purpose, and seems like a ...
0
votes
2answers
631 views

Tar --absolute-names flag does not work

I would like to put everything into an archive from a given directory, while also saving the whole dierctory layout, so superior directory names would be required. I run the following command: tar --...
4
votes
3answers
5k views

How to find a depth of a directory

Is there a way to find a maximum depth of given directory tree? I was thinking about using find with incrementing maxdepth and comparing number of found directories, but maybe there is a simpler way?
0
votes
2answers
100 views

File containing directory structure

I'm currently doing a CTF challenge and have extracted what I assume is the flag by injecting a relative path into the $filename parameter of a call to the PHP function file_get_contents($filename) ...
0
votes
1answer
566 views

help for user permissions and file directory access mac OS Sierra

Im trying to sort my usrers and usser permission in terminal to install Ruby gems and other libraries, but getting nowhere because of the permissions denied errors. Steps I tried: Had a call with ...
0
votes
2answers
48 views

Installing “duplicate” on SSH /home/user

I am on a SSH server and want to use a program that is at /usr/local/bin but I don't have permission. So I copied the program installation files from my system to my user on the server in order to ...
1
vote
2answers
52 views

Is there a standard directory to keep software projects shared by multiple users?

When working on source code (for example, a python project) that needs to be accessed by multiple users, is there a standard place to keep those projects? I found this answer which suggests /usr/...
13
votes
4answers
4k views

Standard location for holding software source files

Is there a standard location in Linux for holding source files for example OpenSSL. I am building Nginx from source with non default version of OpenSSL. I need to download and untar OpenSSL and I did ...
3
votes
1answer
258 views

In Linux I'd use “/opt” for custom software. In FreeBSD?

Where should I install "add-on application software packages" or "for software not managed by the system packager"? That is, software compiled by myself from sources or what-not. In Linux I'd choose /...