Skip to main content

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
1 vote
3 answers
133 views

Where to install custom software packages on FreeBSD?

In Linux, according to the Filesystem Hierarchy Standard, /opt is the designated location for add-on application software packages. Thus, when developing my own software package, which is not a ...
user149408's user avatar
  • 1,343
0 votes
0 answers
44 views

What is the significance of lib, share and include? What to do with them?

I installed node.js using: wget -q -nc --show-progress "https://nodejs.org/download/release/latest/node-v21.7.3-linux-arm64.tar.gz" sudo tar -xvf node-v21.7.3-linux-arm64.tar.gz -C /usr/ --...
Ahmad Ismail's user avatar
  • 2,738
0 votes
1 answer
69 views

Why did Red Hat relocate Apache to /usr/sbin

I run Apache http servers on Red Hat and Oracle Linux machines. The account requires that only packages from the Red Hat or Oracle repositories be used. That’s fine , they work and are reasonably ...
JakeS's user avatar
  • 11
-1 votes
1 answer
41 views

Filesystem Hierarchy , private forensic analysis [closed]

I wanted to refresh my memories and ran the command in the terminal find / -mtime some_date -printf '%TY-%Tm-%Td %TT %p\n' 2>/dev/null | sort -r and I see a large number of files, drivers, ...
alex099's user avatar
  • 17
0 votes
0 answers
21 views

How to uncompress two rar archives preserve content order?

How to uncompress two rar archives preserve content order? The archives is not .part1,.part2, just two separate archives containing video courses in folders. The folder names in first and second ...
minto's user avatar
  • 543
0 votes
0 answers
43 views

20+ backup directories, I'd like to dedupe all files to 1 "master directory"

As the title suggests, I have inherited a file structure where there are about 30 "complete or partial backups" of a fileserver full of text files. This obviously makes no sense, and I'd ...
Frank Rizzo's user avatar
0 votes
0 answers
59 views

difference between folder/ and /folder [duplicate]

I have a small confusion regarding a basic thing in paths i.e whats the difference between folder/ and /folder I just want to understand whats the difference between both. I tried to search but didn't ...
HOPE's user avatar
  • 1
1 vote
1 answer
198 views

How to exclude different levels of subdirectories with cp?

This is a follow-up question to my original post: find & cp command doesn't copy 1st level directory I have a directory structure like this: test folders ├── 1 │   ├── 1-1 │   ├── 1-2 │   └── ...
anmac1789's user avatar
0 votes
2 answers
189 views

Return all files of a specific extension with directory and subdirectories paths

using terminal on MAC OS I need to return path along with the file name in the a directory and all sub-directories, but only if a fie has a specific file extension (e.g. .txt). I tried this, but it ...
Data Engineer's user avatar
0 votes
1 answer
56 views

What does "site-wide" mean?

I'm reading man hier, which says: /etc Contains configuration files which are local to the machine. Some larger software packages, like X11, can have their own subdirectories below /etc. Site-...
robertspierre's user avatar
-3 votes
1 answer
137 views

cd command only working when I put the slash after the directory name

I am new to Linux and working through Dion's course for Linux+. I'm currently on Permissions and Sticky Bits, and have run into an issue I can't figure out. The assignment asks to create a directory ...
vinnymarz's user avatar
0 votes
1 answer
117 views

Rename directory hierarchy

How can I rename directory hierarchy? For example I want to rename c/d to x/y There won't be necessary only 2 folders. So the full directory path /a/b/c/d/e becomes /a/b/x/y/e after the operation. Not ...
ka3ak's user avatar
  • 1,265
0 votes
1 answer
58 views

Can you turn an existing directory into a symlink without directly removing the directory?

There is an existing directory, say, dir. I want to remove it and create a symlink dir to another directory. So I know I can just do rm -rf dir and then ln -s /path/to/that/directory dir. Is there a ...
anonuser01's user avatar
0 votes
2 answers
65 views

How to add subfolders from one directory to another directory with the same files unorganized, and prepend folder name to files

I am an R user who is not yet familiar with unix or command line coding. I have a directory with subfolders containing files, and I have another directory with all the same filenames and no subfolders ...
slund's user avatar
  • 1
0 votes
1 answer
1k views

Write directories, subdirectories and file names to .txt file

I am looking for a command that will write the names of all directories, subdirectories and file names to a text file. Example format: directory1 |_subdirectory1 | |_filename1.mp4 |_subdirectory2 | |...
linuxuser24569's user avatar
2 votes
1 answer
803 views

Which Linux directories should be used for python applications?

Until now I use pyenv to install python versions under a user name pydev in directory /home/pydev. I use the Debian package direnv to link the project directory with a python version installed using ...
SystemTheory's user avatar
1 vote
3 answers
235 views

How do I find the directory with the longest path?

How can I find the directory with the longest path (contains the largest number of subdirectories) , in the current directory , using ls ~ -R commmand
bara's user avatar
  • 19
0 votes
1 answer
627 views

What's the idiomatic way of obtaining the "default" C++ include base path?

I'm building a command-line for some utility which, for some reason, needs the C++ include root, e.g. /usr/include/c++/10 (for libstdc++ of GCC-10). My question is: How do I determine what that path ...
einpoklum's user avatar
  • 9,662
0 votes
2 answers
44 views

Operate and output inplace results

I have a shell function which operates in-folder (in my case, it looks for *.eps` files and convert them to pdf without blank borders). Let us abstract this by the below function: function do_here() { ...
Bruno Lobo's user avatar
0 votes
1 answer
509 views

Moving folder contents up 2 directory levels

I'm trying to write a command that uses mv to move files two directory levels up. So if the folder order goes like this: ~/Test/2020-08-01/001/002/file.txt, I want to move file.txt from directory 002 ...
LukeSmith's user avatar
3 votes
1 answer
306 views

Why do we create custom partitions in Linux?

I am completely new in Linux and I installed centos VM in virtual box, at the time of installation I created partitions : /(root), boot, home and swap, so I thought that this is the same like in ...
shank's user avatar
  • 31
1 vote
1 answer
475 views

How to move files in a directory based on a substring in filename

I'm very new to scripting and working in Unix/Linux systems, so I appreciate any help. I'm sure this has been answered before but I cannot figure out why none of the other solutions are working for my ...
Melanie's user avatar
  • 11
3 votes
0 answers
206 views

How to limit "diff -r" to a certain depth?

How can I compare sub-directories in two directories down to a certain directory depth? Command diff doesn't have an option to specify depth, and -r option takes you all the way down to the files, ...
Renat's user avatar
  • 131
1 vote
2 answers
718 views

Is there a way to add a "description" field / meta-data that could viewed in ls output (or an alternative to ls)?

I have been using unix systems the majority of my life. I often find myself teaching others about them. I get a lot of questions like "what is the /etc folder for?" from students, and ...
BitWrecker's user avatar
0 votes
0 answers
19 views

Check which files in directory A are already contained somewher in directory structure B

I have a neatly organized folder structure with subfolders which contains jpegs (directory structure B). I also have several unorganized folders of jpegs (directory A). I would like to delete all ...
TorbenKorx's user avatar
1 vote
2 answers
649 views

How to move file contents deeper without copying

I have files in /home/jjblack/foo/. I want to move all the contents of this directory into /home/jjblack/foo/bar/. I am unable to copy the contents elsewhere as there is not enough disk space. I am ...
Jake's user avatar
  • 101
0 votes
1 answer
297 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 ...
Mathijs's user avatar
0 votes
1 answer
988 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 ...
Tapash's user avatar
  • 101
0 votes
3 answers
145 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 ...
Makogan's user avatar
  • 113
3 votes
1 answer
3k 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, ...
Rubem Pacelli's user avatar
0 votes
1 answer
2k 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 |...
Dave's user avatar
  • 621
-3 votes
1 answer
134 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 ...
Sachin's user avatar
  • 107
0 votes
1 answer
74 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 - ...
IQAndreas's user avatar
  • 10.4k
0 votes
2 answers
37 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 ...
Indermohan Mokha's user avatar
3 votes
0 answers
111 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 -> /...
einpoklum's user avatar
  • 9,662
0 votes
2 answers
95 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 ...
Krateng's user avatar
  • 163
27 votes
2 answers
22k 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.
Huzi's user avatar
  • 412
2 votes
1 answer
667 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 ...
CIsForCookies's user avatar
0 votes
1 answer
73 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 ...
Vera's user avatar
  • 1
0 votes
1 answer
909 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 ...
Manuel Jordan's user avatar
0 votes
1 answer
109 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 ...
Joe Gerth's user avatar
-3 votes
2 answers
2k 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 ...
Rucent88's user avatar
  • 1,880
1 vote
1 answer
292 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 ...
Paul's user avatar
  • 517
2 votes
2 answers
2k 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 ...
Skywarth's user avatar
  • 135
1 vote
2 answers
3k 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 ...
chikipichi's user avatar
0 votes
0 answers
663 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 ...
Chris Graham's user avatar
2 votes
1 answer
110 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 ...
nemuroito's user avatar
0 votes
1 answer
109 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 ...
Ryan Blanchard's user avatar
2 votes
1 answer
137 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, ...
shikhanshu's user avatar
0 votes
2 answers
2k 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 ...
sheth7's user avatar
  • 211

1
2 3 4 5
10