Stack Exchange Network

Stack Exchange network consists of 175 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?”.

6
votes
4answers
756 views

How to find only directories without subdirectories? [duplicate]

Is there a way in linux to look through a directory tree for only those directories that are the ends of branches (I will call them leaves here), i.e., dircetories with no subdirectories in them? I ...
1
vote
1answer
23 views

Tool for creating and calling folder structure templates?

Is there a Linux utility for creating templates for directory structures, outside of the scripts packaged with a DE like Gnome or LXDE? (I run openbox and would like to avoid a DE at all costs) There ...
1
vote
0answers
55 views

AWS Linux image - where to put application directory?

I need to install my application files in the linux server. Where should I put the files? and what are the permission that I should set? Can I put them at /var/app? (AWS Beanstalk put the app at /var/...
0
votes
1answer
40 views

Trying to remove current directory using rmdir

I created a directory dir at Desktop and then i keyed in cd dir so as to make dir as my current directory and then i typed in the terminal rmdir /home/user_name/Desktop/dir from the dir directory ...
0
votes
1answer
47 views

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

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
52 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
41 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
30 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
34 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
49 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. ...
1
vote
1answer
224 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 ...
1
vote
0answers
125 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
910 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
50 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
114 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
24 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
75 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
145 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
106 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
29 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
75 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
309 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
57 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
52 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
273 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
92 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
220 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
2k 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
49 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
562 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
31 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
47 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
126 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
174 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
216 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
125 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
228 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
2k 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
652 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
116 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
818 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 --...
5
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
109 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
584 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 ...