date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,383,413,207,000 |
In the context of /var is that an abbreviation for "variables"?
Or what's the intention behind the naming of this folder?
|
From the Filesystem Hierarchy Standard,
/var contains variable data files. This includes spool directories and
files, administrative and logging data, and transient and temporary
files.
So you're almost correct, it's not variables, it's an abbreviation for variable. Files which have variable, changing data.
| What is "var" an abbreviation of? |
1,383,413,207,000 |
On a terminal in Ubuntu (14.04) when I hit Tab after cd /usr/bin it gives cd /usr/bin/X11.
If I keep hitting Tab, I get cd /usr/bin/X11/X11/X11/X11/X11/X11/X11 and so on. Should it be like this or am I looking at something funny?
|
Yes it looks somewhat funny but that's intended configuration we all have for the backward compatibility. On Debian/Ubuntu based systems x11-common package actually provides such a symlink:
$ ls -l /usr/bin/X11
lrwxrwxrwx 1 root root 1 Mar 17 02:52 /usr/bin/X11 -> ./
$ dpkg -S /usr/bin/X11
x11-common: /usr/bin/X11
... | Infinitely nested directories within /usr/bin/X11 |
1,383,413,207,000 |
I am running a web application and I want to move a directory containing my php files above the server root directory. Where would be the best place to put them?
On my web server I rent from Namecheap, there is a directory called php in the same directory where public_html is. Is this a good place to put my php files?... |
I use a structure like:
/var/www/sites/
/var/www/sites/project.com/
/var/www/sites/project.com/includes/
/var/www/sites/project.com/library/
/var/www/sites/project.com/www/
/var/www/sites/project.com/www/index.php
Where /var/www/sites/project.com/www/ is set as the virtual host's document root, and I use index.php to... | What is the best place to put php files above server root directory? |
1,383,413,207,000 |
I recently downloaded Master PDF Editor. It's a proprietary software for Linux and the archive contained bascically only a *.desktop file and the actual binary.
Looking at the *.desktop file, the binary is supposed to be placed in /opt/master-pdf-editor-3. I'm aware I could change that but I followed the suggestion. ... |
Creating a hardlink should probably be avoided, there's no need for one and a symlink is simpler and safer. Your other solutions are also fine though. You can create as script that calls the binary or you can add the directory to your PATH. The latter might be preferable if you expect to add other binaries in /opt as ... | How to call a binary outside PATH |
1,383,413,207,000 |
The SDK for Dart comes as a zip file for Linux. I've only previously installed software using apt-get. Is there a convention for where I should put the dart-sdk folder? And should I add dart-sdk\bin to my path, or symlink it into a folder that's already in the path?
|
In the arch package, it seems Dart gets installed into /opt/dart-sdk. This also seems to match with what FHS says:
/opt is reserved for the installation of add-on application software packages.
The use of /opt for add-on software is a well-established practice in the UNIX community. The System V Application Binary In... | Where is the recommended place to install applications that are not from apt? |
1,669,279,247,000 |
I have learn linux recently, but i confused about how linux system works, especially about how linux handle program files, in windows all program is in one directory Programfiles (and some in Windows) but in linux, when i install program automaticly (apt) i think its "randomly" place the program files not in one place... |
In short: As long as you use the package manager that comes with your Linux distribution, you can't change the place where the binaries are installed. However, the installation paths follow a long-established convention (with minor differences between distributions).
If you build packages on your own you could, in the... | Change the default program installation location? |
1,669,279,247,000 |
I was looking to download some tool and it said to update your PATH variable, but I thought /usr/bin was the "standard".
|
It is not too uncommon to have tools that expect to be installed at user level. As such, they will not assume that you can modify anything directly under /usr. It is often common, however, to have a ~/bin or ~/usr/bin directory where you can include symlinks to tools that you have installed for your user. Such that... | Should I use symlinks in /usr/bin or use the PATH variable instead? |
1,669,279,247,000 |
I've installed windows 7 and linux dualboot. My partitions are:
/dev/sda2: UUID="EC328C61328C329E" TYPE="ntfs"
/dev/sda3: UUID="800E88610E8851D8" TYPE="ntfs"
/dev/sda4: UUID="20e7c430-bab0-4aa1-8afe-caa9d97e1de3" TYPE="ext4"
where sda2 is windows sda3 is shared partition and sda4 is linux
sd3 has mounting point /wi... |
Keep the lines as they were in original user-dirs.dirs :
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
And now create symbolic links to point to your windows folders (make sure you have no important data in the three concerned folders :
cd ~
rm -fr Music Pictures Videos... | Redirect home to shared NTFS partition |
1,669,279,247,000 |
I want to start using our home server as a media server for movies and shows, the question is where is the most appropriate place to store them?
The most appropriate places seems to be:
/var
My user directory
Create a new user specifically for media and store stuff there
Ideas or suggestions?
|
Its up to you really, I store all my media in /home/{name}/videos and share it with samba. No problems with that.
You can store it in /var; nothing wrong with that either.
There is only problems if you are working in a multi-user environment. If that was the case, I would suggest you store personal files in /home/{nam... | Where to store media files on a shared linux server |
1,669,279,247,000 |
If
ls -aR | grep ":$"
returns
./.hiddendir2:
./dir1:
./dir3:
./dir3/.hiddendir4:
then how can you update the pattern given to grep so that you only get
./dir1:
./dir3:
(note that the last line containing .hiddendir4 was omitted even though it's parent was not hidden)
Here is a wordy version of the same question wi... |
The first command you posted can't give the results you show, because they don't have colons at the end; presumably you stripped them. The script you refer to does this to select directory paths, which ls -R displays with a colon appended, but there is nothing preventing a file name & path from ending with a colon and... | How to exclude directories from `ls -R` output? |
1,669,279,247,000 |
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 caches of including but not limited to local packages:
/var contains variable data files. This includes spool directories... |
/var is kind of global directory for a system, and all cache-data and logs of all users appear to be shared among them.
This is partially incorrect. Not all cache and logs are stored under /var, and what is stored there is not necessarily shared by all users. Applications and/or the OS own what is stored in /var.
Th... | Why isn't the var directory user-specific? |
1,669,279,247,000 |
I have a folder structure like this:
/domains/some-domain-1/applications/j2ee-apps
/domains/some-domain-2/applications/j2ee-apps
/domains/some-domain-3/applications/j2ee-apps
What is the best way to handle folders like this where the parent and child folders are the same? For example, if I wanted to cd to a cousin di... |
You can set a variable to hold the variant part. Like so:
domain='some-domain-1'
cd /domains/$domain/applications/j2ee-apps
domain='some-domain-2'
cd /domains/$domain/applications/j2ee-apps
Since the cd command is the same, you can recall it on your shell with the arrow keys.
Depending on how frequently you do this, ... | how to have find on a directory with a changing pattern? |
1,669,279,247,000 |
I'm running FreeBSD 10 and I'd like to build dwm. I've installed Xorg using pkg install. Where are the headers located? Maybe I'm just old fashioned but I first looked in /usr/X11R6 ... not there. Anyone has any idea where Xorg will install its headers files in FreeBSD?
|
You can install dwm from port (/usr/ports/x11-wm/dwm). You can use own config.h:
make DWM_CONF=/path/to/dwm/config.h
I think you should use the port system instead of own compiling - it appears in your packages list.
| Location of Xorg headers on FreeBSD 10 |
1,669,279,247,000 |
My Ubuntu boot has iwconfig living in /sbin. I was under the impression that /sbin is usually for programs that are required for bootstrapping, or at least need to be available before /usr is mounted.
I don't really see how iwconfig fits either of these conventions, though. What's the rationale?
|
As per Filesystem Hierarchy Standard, /sbin is a place where
Utilities used for system administration (and other root-only commands) are stored.
And yes, iwconfig may be needed by some startup scripts before /usr/ is mounted (if it uses a different partition) - therefore the place for it is not /usr/sbin/.
| Why is iwconfig in /sbin? |
1,669,279,247,000 |
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 Standard
I should store my files at:
Temp files: /var/temp/app_name/* or /temp/app_name/*
Cache files: /var/cache/app_n... |
Part of your confusion may be the distinction between user applications and system applications.
So, for example, apache isn't run as an end user ("Harry" normally doesn't run Apache; it's run from a system startup script - systemd or init or however). These sort of applications typically will follow the file system ... | Where should I store my application files (data, cache, logs, crashes, etc.) [closed] |
1,669,279,247,000 |
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 the given disk/drive. But I'm curious whether it includes mounting folders according to Unix file structure (file stru... |
dd doesn't know anything about mounts or folders or unix file structure in filesystems. dd only knows about raw data and a few trivial transformations of raw data and data blocks. It was originally designed to read and write data from or to block devices (including disks and tapes) and could handle changing the stru... | DD command included directories |
1,669,279,247,000 |
I have gone through a related thread here.
A colleague of mine has copied the phantomjs binary to /usr/bin. In our system, this binary will be used only by a non-root user. At the moment, the regular user is able to run this binary fine, but going to the thread posted in this question, it does not like a right thing t... |
The Filesystem Hierarchy Standard says, per
/usr/local : Local hierarchy, that
The /usr/local hierarchy is for use by the system administrator when
installing software locally. It needs to be safe from being
overwritten when the system software is updated. It may be used for
programs and data that are shareabl... | Should I move a binary used by a non-root user from /usr/bin/ to /usr/local/bin/? |
1,669,279,247,000 |
find . * -depth -print0 | xargs -0 rmdir
It finds and removes all empty folders (including hidden ones) recursively.
I only tried it on my home folder and a pendrive in Linux PC and it worked but I don't know if it is safe to run from / as root
I once nuked my OS by running some command off the internet (which I didn... |
The man page for rmdir says:-
Remove the DIRECTORY(ies), if they are empty.
If you want to remove all empty directories then it will be safe. The question you need to ask is:-
Do you want to remove all empty directories?
Some applications need a directory even if it's empty. For example, journald can be configured ... | Is this command safe to run from / as root |
1,669,279,247,000 |
I just bought an external hard drive that's 1TB. I formatted my laptop and burned Linux to it. The thing is, I also use my hard drive for other things. Can I move these boot files into a custom folder? Or should I leave them alone?
|
I'm not sure why you would want to move the /boot stuff. It should be possible, but it would break a lot of fundamental assumptions in boot-related tools.
One common thing that people do is store /boot on a separate partition, in which case /boot/boot should be a symlink to '.' so that when the bootloader mounts that ... | Possible to move boot files? |
1,669,279,247,000 |
I have a tmp folder in /var and it has the file channel.xml in it.
I don't know what this is and if it should be there and what permissions it should have because at the moment it is wide open.
Also what is the folder above /var called please?
|
The directory /var/tmp should have permissions rwxrwxrwt, which allow anyone to change to this directory, create and read files in this directory and write/rename/delete files they own (this last restriction is caused by the t in the permissions, which is the "sticky bit").
The file you see in there is a temporary fil... | What is the tmp folder in /var? |
1,669,279,247,000 |
When installing software in $HOME, how do the linux filesystem hierarchy directories map to subdirectories of $HOME?
I am asking this question so that I can write a build system that picks reasonable default paths for a user install. The build system infrastructure is Haskell-specific (Cabal) but the installed files ... |
$PREFIX is ~/.local/. Everything else maps under there.
| Filesystem organization for software in HOME |
1,669,279,247,000 |
Like most of us, I have several machines: at home, at work, for travelling... etc. I mainly write papers or books while I code. But I'm tired of svn'ing, rsync'ing and so on, so I've decided to carry a pendrive with me, with my Ubuntu customizations (bash, emacs, ...) and at the end of the day, do a rsnapshot. My ques... |
The answer is pretty simple :-)
You should put in there your documents you are working on and the dotfiles of the applications you use.
Theres no such thing like a minimal set of files you need. If an application is missing its configuration file, it will usually create a new one like at the first start.
Which files y... | Carry-on Ubuntu Customization |
1,669,279,247,000 |
I'm using a Linux system on which I don't have root. My home directory is remote-mounted and backed up (and there's a quota on that filesystem). Now, I would like to work on some files on this machine itself, they don't need to be backed up, and I would like to (but not have to) have them relatively large.
Where can I... |
You could use /var/tmp, but:
If you have a quota, the admin will probably not appreciate you creating large files outside of your $HOME directory. Quite likely you even got a limit for /var/tmp. So that might just be an option for small files.
However, if you are member of the fuse group (ask your admin to add you to ... | Where can I/should I place files outside my home directory? |
1,669,279,247,000 |
I'm trying to structure an android project for continuous integration/continuous delivery via gradle and git.
The main code will be pulled from git on the build server without various files that contain keys.
Gradle needs these files to successfully build the project.
I will pull those files on the build server separ... |
The most official location for such files would be in /srv, which is for “site-specific data which is served by this system”.
Alternatively, you can use /home/autobuilder as the home directory of the autobuilder system user and store the files there.
Another common convention is to have a toplevel directory such as /n... | Public, Non-Root Access to file system? |
1,669,279,247,000 |
I am configuring a Linux work station that will be used by a small number of users (20-30). These users will belong to a small set of groups (5-10) with each user belonging to at least one group and potentially multiple groups. On the work station there are files that should only be writeable by members of a particula... |
Who should own the files that already exist? I was thinking either root or creating a set of dummy users corresponding to the groups.
Leaving them owned root but belonging to a common group, presuming the files are masked 0002 (i.e., are group writable) has a little bit of an advantage in terms of preventing them f... | Who should own files shared by a group and where should they go |
1,669,279,247,000 |
There is a server with several users.
A user may want to read another user's files (few gigabytes) and may want to put processed files in other's directory.
What's the common practice to do it? I can think of create a /share folder and make it rwx to all. Is this the common practice?
|
I think you are searching for /usr/local/share/ but it is hard to answer since this depends on what kind of file your are planning to "share" between users.
But if we are talking about office files or something like that maybe you should use use some kind of revision system like subversion or git. And then the users ... | The common practice to share file for all users on the same machine? [duplicate] |
1,669,279,247,000 |
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 driver is going to be a kernel driver, and I'll be using dkms for the installation. The distro I'll be using is Ubuntu, bu... |
It's really up to you but normally sources are stored in /usr/src as mentioned in the comments. Since system-wide installed applications could install their sources in this directory as well, to avoid possible conflicts, you could use /usr/local/src instead but again in the end no one stops you from storing sources an... | What is the correct place for driver sources? |
1,669,279,247,000 |
I am encrypting my /home partition and I would also like any secrets /root (not /) contains to be encrypted. Is the /root folder considered part of the /home partition by default, or do I need to explicitly add that folder to the encrypted volume? Thanks!
|
/root is normally on the root partition. It's meant to be available even if something goes wrong and other partitions can't be mounted.
Note that /root only contains what you put yourself. Sensitive data created by the system ends up under /etc or /var.
These days, with most CPUs having accelerated AES instructions, d... | On Debian 9, is /root part of the /home partition? |
1,669,279,247,000 |
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 PREFIX/bin or are they better installed somewhere else, for instance in PREFIX/lib?
Edit: The internal commands in que... |
The Linux Filesystem Hierarchy Standard says this,
/bin contains commands that may be used by both the system
administrator and by users, but which are required when no other
filesystems are mounted (e.g. in single user mode). It may also
contain commands which are used indirectly by scripts.
and
The /lib dir... | Where do I install non-end user commands? |
1,669,279,247,000 |
I want to secure my data on a multi-user system, so ful-system encryption is not an option.
I encrypted /home/me with ecryptfs, the swap with cryptsetup. But I read that the applications can sometimes use /tmp to store personal data, so I will encrypt it exactly like the swap.
Is there any other directory where user d... |
It might be worth looking at the Filesystem Hierarchy Standard which describes what the various filesystems are generally for (from a standards perspective, not everyone has to follow it), which will let you know where personalised data might be stored. However, the short answer is - anywhere an application wants to ... | Where can users' personal data be? |
1,669,279,247,000 |
I am programming in shell scripting, and would like to log results.
Is there any way to know what is the default path storage for logfiles in my operating system?
I have researched:
set | grep "log" -i
but there is nothing that seems to be like a log path directory.
|
For any system that follows the Filesystem Hierarchy Standard this should be /var/log. I think this is safe to assume for most modern systems.
Note that this is for system processes (ie daemons etc), for user processes the common thing to do is just to create the log file as a hidden file in the user's home directory.... | How can I know the default path for log directory? |
1,669,279,247,000 |
I created some scripts for administrative tasks etc, I made them to be independent from environment - every dependency is injected through arguments. However it is annoying to provide to script commonly used dependencies every time I run it, and I don't want to hardcode in it any local information, so I created wrappe... |
Forget the wrapper stuff:-)
All you need is a .file (dot file) with the user configuration options, in the $USER directoy. You can have one in /etc for system wide config options as well.
Make your script check for these .fils (dot file) and if they exist, use them.
HTH,
.
| Where to put wrapper scripts? |
1,669,279,247,000 |
I just installed npm and node.js, and I couldn't access npm. And I'm like "why?" and my OS is like "because /usr/local/bin is at 700 permissions" and I'm like "should it really be that way?" /usr/local is supposed to be .. the local user's bin folder? Then why does it require root access?
It is filled with GAE stuf... |
No, /usr/local/bin and pretty much everything in it should be set 755.
| Should my /usr/local/bin be 700 permissions? |
1,669,279,247,000 |
Some how, can't remember why, I got into the habit of downloading source to the directory /opt, which I chown to my user/group.
I have this feeling that it is not a good thing to do. Is there anything wrong with owning a directory that is outside of your own home directory?
|
First of all, another question explains the /opt directory.
Now, your question about the ownership depends on the environment. Is this is a work system, or personal system?
If it's entirely your computer system, download wherever you want to!
That seems like a fine place to maintain ownership of on your own system.
I... | Bad to own a directory outside of your home directory? |
1,669,279,247,000 |
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 to be put inside subfolder according to the related id :
100
| REPORT_100_COMPLETED.csv
| REPORT_100_FAILED.csv
101
... |
for i in REPORT_*_*.csv ;do
dir=$(cut -d'_' -f2 <<<$i)
mkdir -p $dir && mv $i $dir/
done
| How can I move all files matching a pattern into a new folder? |
1,402,555,469,000 |
The updatedb command, as I understand it, is basically the utility that keeps the mlocate.db database file updated. And it's a good idea to keep it updated regularly.
For that matter, I've kept a daily cron to run the updatedb command.
Now I'm looking under the hood, for the sake of understanding it better.
When I ca... |
First there's an error in your updatedb.conf as it says PURNE_BIND_MOUNTS when it should be PRUNE_BIND_MOUNTS.
Now to answer your question, there are various reasons why you might want to ignore indexing specific directories:
PRUNE_BIND_MOUNTS - prevents from indexing bind mounts. bind mounts allow you to mount a spe... | updatedb for a beginner |
1,402,555,469,000 |
I need encrypt whole disk on Debian 7.5, (it will be work as server) but I need enter encryption password via SSH. So I need encrypt whole disk except primary system features as ssh server, because for example I need remotely restart this server. Do you know about any effective options?
|
First step would be to decide what needs to be encrypted and what not.
There is no need to encrypt a standard debian server release, its not like it contains any secrets.
Create at least two partitions, one for the normal stuff and one for the sensitive stuff.
Then you install the complete server as normal, without a... | Encrypt my disk but allowing to enter the password with SSH |
1,402,555,469,000 |
This thread What do the numbers in a man page mean? answers the question of the significance of the numbers between parentheses within a man page. My question is related.
I have a local installation of a package called ffmpeg. The build folder has the typical bin, lib, etc. and then the folder:
man/man1/ with the foll... |
The suffixes (such as 1) correspond to the numbers mentioned in "What do the numbers in a man page mean?". The represent sections of the manual.
"Which path should I add to MANPATH? The one pointing to man?" Yes (ie, not one of the inner man1, man2, etc. directories).
These have the same significance as the director... | Man folders and MANPATH |
1,402,555,469,000 |
I am trying to find this path on FreeBSD but it is not working: /usr/local/lib/python2.7/dist-packages
This same path is working on Ubuntu.
Can please some tell me where I can find Python dist-packages? Actually, I am trying to find the Django folder.
|
Start your python and then type
import sys
print sys.path
You are likely to have something ending in site-packages or dist-packages in there.
Django probably has its own, additional, folder structure (I know that web2py does), so you might have more luck using a web page with that code and analysing the output from ... | Where are Python dist-packages stored in FreeBSD? |
1,402,555,469,000 |
I wrote a package, and would like to use /var to persist some data. The data I'm storing would perhaps even be thought of as an addition for /var/db.
The pattern I observe is that files in /var/db, and the surrounds, are owned by root. The primary (intended) use of the package filters cron jobs - meaning you would n... |
If that package is installed as root it has access to /var.
If it's installed by a user (who can neither write to /var nor /usr) the default procedure is to set --prefix=$HOME/somedir in the configure script. Or you provide other means to set the directory to a location the user has write access to.
| Do best-practices indicate that usage of /var should be restricted to sudoers |
1,402,555,469,000 |
I have a set of libraries and some apps that depend on it. Some of these libraries names might conflict with already installed libraries.
The easiest way for me to deploy them would be
Install the libraries in a fixed-path "/usr/local/[my-firm]/lib"
Compile my apps with a rpath pointing to this path
My apps' install... |
If the libraries you install are specific for your application and may conflict with system libraries installed then I would recommend setting up a structure like this:
/opt/<app>/<version>/lib
or
/opt/<app-libs>/<version>/lib
This way you can deploy at will separately from others and not affect anything that someon... | Deploy libs in hard-coded dir |
1,402,555,469,000 |
I've got a pogoplug running Arch Linux that I'm using for a NAS with rsync backing up my data over SSH. Right now, I'm the only one using it, but I'd like to add my roommate as well. She has her own external hard drive on which to store her backup data.
Would it be strange to mount /home/my-user/ on the hard drive I c... |
Yes, that's a perfectly reasonable way to do it. Having home directories on a separate partition from the OS is pretty common. Having home directories directly under /home is common on systems with a small number of users; systems in institutions with a large number of users often have subdirectories under /home corre... | Linux multi-user system: Each user's home partition on its own Hard Drive |
1,402,555,469,000 |
I have a default OpenBSD 5.1 install. How Can I enabled httpd, OK.
QUESTION: How can I use the
/dev/sd0a on /mnt/usbhdd type ffs (local, nodev)
instead of the default "/var/www" directory? What are the most secure mount options (for a webservers that only servers static html/files)?
|
Either mount /dev/sd0a to /var/www or configure your web server to use
/mnt/usbhdd instead of /var/www. – Marco Oct 29 '12 at 11:41
| How to move the /var/www directory to a USB HDD? |
1,402,555,469,000 |
I have 142 notes in Tomboy but I don't understand why is there such an amount of files and folders created inside the main folder of Tomboy. In there, there are 5 subfolders, named "0", "1"... "4" and in each one of them there are 100 subfolders named:
"0", "1", ..., "99", inside folder "0"
"100", "101", ..., "199" i... |
That kind of multiple level directory structure is a common solution to speed up file retrieval when you have to handle a large number of files. A lot of other application use that kind of structure to keep some kind of file cache (e.g. firefox, squid).
Instead of a single large directory with all the files, the appli... | Why are there so many files and folders within the folder of Tomboy? |
1,402,555,469,000 |
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
error: No package owns /usr/lib/udev/hwdb.bin
Then searching, it seems clear it's compiled by systemd-hwdb, which is itself... |
Package file listings for Arch Linux include files that are contained in the package, that are installed when the package is installed. They don't include files that the installed application could potentially create on your system.
For instance, the package for the Evolution e-mail program would not list every e-mail... | Are package file listings supposed to include only distributed files, or runtime generated files too? |
1,402,555,469,000 |
I need to write a program that receives a block device as input, like /dev/sda1, and has to perform a set of operations depending on if the filesystem inside are currently running or not.
We'll assume the input will always has a correct linux directory tree, the only I need to know is if there's a particular directory... |
I’ve written a function that returns 1 if the argument is the root device,
0 if it is not, and a negative value for error:
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
static int
root_check(const char *disk_dev)
{
static const char root_dir[] = "/";
struct stat root_statb;
... | How to determine whether a linux filesystem belongs to a running system or not |
1,402,555,469,000 |
I am new to this, so sorry if its obvious. I am running a Debian server and installing the likes of UWSGI, NGinx etc on there. The configurations keep talking about pointing to "sockets".
In the build options I seem to be able to specify where the sockets for each program go. By default it looks like most of them go i... |
I would do a mkdir /var/run/nginx (or whatever the program name is) and locate them there. You can then restrict access to the sockets if needed by changing ownership of the that directory.
It's probably not terribly needed for security reasons unless you are a bit paranoid or let people you don't know very well log ... | Where to locate "sockets" |
1,402,555,469,000 |
Edit: places where I said $HOME/.bin I should have written $HOME/bin or any equivalent is fine. I.E, any user-writable directory that is in the user's PATH.
So I have a bash script which I am distributing as a client for my API. Current version installs like this curl -s http://api.blah.com/install | sudo sh. I may ... |
I ended up giving them two options on my "Getting Started" page. I explain briefly what the installer script does, such as looking for ~/.local/bin or the like and then potentially adding that to PATH in ~/.zshrc or ~/.bashrc. I also give them the option of manually installing, instead of using the script, with simp... | What code should I use to download and install my script into a user-writable directory in the user's PATH (without requiring sudo)? |
1,402,555,469,000 |
I currently have this which works but isn't as tidy as I'd like;
mkdir -p backup/{daily/{directories,databases,logs},weekly/{directories,databases,logs},monthly/{directories,databases,logs}}
Is it possible to nest the directories,databases,logs part so as to not have to have it 3 times in the command?
|
No need for nesting:
mkdir -p backup/{daily,weekly,monthly}/{directories,databases,logs}
| created nested directories the short way |
1,402,555,469,000 |
I was working on a project to control my digital camera using Ubuntu and gphoto2. At one point I noticed a new "~" directory in my project folder, /home/greg/project/~. When I enter this new "~" directory, it takes me backwards to my home directory /home/greg/ (as you might expect).
I don't know exactly how this hap... |
You need to quote it to protect it from shell expansion.
ls ~ # list your home directory
ls "~" # list the directory named ~
ls \~ # list the directory named ~
Same thing with rm, rmdir, etc. The shell changes ~ to /home/greg before passing it to the commands, unless you quote or escape it. You can see this wit... | Where did this copy of my home directory come from? |
1,402,555,469,000 |
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 sometimes I have the same questions myself. I know that all of the information is available with a simple google search, but I was wond... |
tree --info will do what you want.
You can create .info txt-Files that contain your remarks about
certain files and folders
or groups of files and folders (using wildcards).
tree --info will then show them in the directory listing.
Multi-line comments are possible.
There is also a Global info file in /usr/share/finf... | Is there a way to add a "description" field / meta-data that could viewed in ls output (or an alternative to ls)? |
1,402,555,469,000 |
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 with ls --all -l that shows a file named . owned by a different user than the user that owns the . and .. directories.
|
I'm afraid it only looks like you have a file called .. What is very likely happening is that you have a file whose name starts with a dot but is then followed by a whitespace or other special character. To demonstrate how you'd figure this out:
$ cd "$(mktemp --directory)"
$ touch '. '
$ for path in .*
> do
> pri... | Creating a file named '.' and how to read and write data to it? |
1,402,555,469,000 |
If I run df -h in an Oracle LINUX 5 server, I got below output:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 12G 8.8G 1.8G 84% /
/dev/sda4 3.8G 592M 3.0G 17% /home
/dev/sda1 99M 70M 24M 75% /boot
tmpfs... |
What is tmpfs?
Tmpfs is a file system which keeps all files in virtual memory.
Read More
What is /dev/sdc1 and how can I use the enough space available (46G)
/dev/sdc1 is just another file system that you have created and mounted in your system. The mount point is /u000. Read more on mount points
how can ... | How to know in which partition my application has been installed? |
1,402,555,469,000 |
I am very new to Linux (Ubuntu 13.10) and having difficulty understanding the file system, particularly with regards to installing applications. In Windows, when I installed an application, it put the contents of the application in a folder in Program Files, by default. I knew exactly where to look if I wanted to brow... |
It does actually tend to be consistent. The standard is the FHS specification and while it is admittedly not always followed it mostly is:
/bin : Essential user command binaries (for use by all users)
/boot : Static files of the boot loader
/dev : Device files
/etc : Host-specific system configuration
/home : User ho... | Consistency in default installation directories |
1,402,555,469,000 |
I'm trying to locate where some files are stored and I can easily browse to them via ssh by going to "cd ~/foldername", however, I have no idea what directory "~/" actually is.
When I browse around folders via WinSCP (yes, I'm a Windows admin), I can't seem to locate this folder at all.
Note: I'm using Amazon Linux o... |
The tilde character is shorthand for the home directory of the current logged-in user. If you are logged in as jason, then ~ is likely /home/jason/. It is the home directory of any username, as given in /etc/passwd. It is also the same as the $HOME environment variable. The expansion from ~ to the home directory is do... | What is the "~/" directory? |
1,402,555,469,000 |
(See update at the foot of the question).
This is a followup question to "Make directory copies using
find".
This question involved manipulating a bunch of directories, This got
too complicated to handle in a single command, so I decided to go with
an approach which saved the list of directories to a bash array,
despi... |
If you want to append things to an array in a loop, you can use something like:
for x in */C/populate.sh; do
myarr=(${myarr[@]} "${x%%/*}")
done
See the bash arrays documentation for lots of stuff you can do with them.
Alternatively, you can use += to append to an array (see here) like this:
myarr+=("${x%%/*}")
... | Looping over directory entries in bash and saving to an array |
1,402,555,469,000 |
My problem is that my /var partition is over 80% (total size: 4.9G). I was reviewing the files into this partition and I saw a file which has 3.4G. (/var/lib/pengine)
I dig into that /pengine file and I saw it is full of .bz2 extension files. I want to move these files but I would like to know if is risky or not.
|
bz2 is a type of data compression, it soesn;t tell anything about the purpose of the files .
Pengine (whatever that is, a game?) probably needs them.
If the files are using up most of the space on var you could consider
moving them to a partition with more space eg /home
# umask 22
# mkdir /home/var_lib_overflow
# mv... | Are .bz2 files inside /var/lib/pengine safe to delete? |
1,402,555,469,000 |
At a low level, /usr/share/geany.glade does configure some important aspects of Geany which are not controlled by geany.conf (e.g., visibility of the menubar). Copying a modified geany.glade file in ~/.local/share/geany/ did not make any change. So, how can this program be altered without root privileges?, what is the... |
geany.glade defines the user interface, and isn’t user-overridable (in the same way that the application’s code isn’t user-overridable).
If you want to tweak the interface without being root, you’ll need to install your own copy of Geany in your home directory and modify it there.
| What is the per-user correlate of /usr/share? |
1,402,555,469,000 |
Asking this question on mpv player and dvds, I stumbled into a more generic question: is it generally possible to specify a path in which one of the directory names is variable?
Let's say that I want to execute a file with a command. The executable is in /dir1/dir2/dir3/, but the name of dir2 is variable, although it ... |
Bash can make use of globbing. Globbing allows you to specify a pattern that will match multiple values. It works similarly to REGEX, but it is important to note they are not the same.
*(pattern) matches a pattern 0 or more times
?(pattern) matches a pattern 0 or 1 times
+(pattern) matches a pattern 1 or more times
[... | Is it possible to specify a path in which a directory name is variable? |
1,402,555,469,000 |
I am building a small embedded system for a x86_64 target, with a Linux kernel and an initramfs which contains a dynamically linked busybox.
I tried to install the needed libraries (libm.so.6, libc.so.6) into /lib and the linker ld-linux-x86-64.so.2 into /lib64( because the busybox binary request it at this place).
li... |
Read the manual of ld.so (the dynamic linker/loader). The actual search paths are mainly determined by /etc/ld.so.cache (which is compiled from /etc/ld.so.conf by ldconfig) or built-in paths in your ld.so binary. So check your platform configurations and how you built your glibc.
You can watch detailed activities of... | The linker does not find libraries in /lib |
1,422,471,670,000 |
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 contain command lines like:
fastboot $* flash modem_a `dirname $0`/images/modem.img
if [ $? -ne 0 ] ; then echo "Flash modem_a... |
Open the terminal application (you can find it in the application menu) and run:
cd /home/shyam/Mi\ A1/tissot
chmod u+x test.sh
./test.sh
Each line is a command.
Keep in mind that running application found on the internet can be dangerous. Before doing this you should learn how to use the linux shell ( this is a goo... | How to run a script file |
1,422,471,670,000 |
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 basically move all files found inside these directories to the current directory. The current directory is the directory ... |
With find and single linear:
find . -mindepth 2 -type f -execdir sh -c 'mv -vt ../ "$@" ; rmdir "$PWD"' _ {} +
-mindepth 2 will let the find command to ignore current directories' files.
-execdir this is important here, and this make find to change the current directory to the directory where a file found and the co... | copying files recursively without preserving directories |
1,422,471,670,000 |
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 around and the place for user-intalled programs is apparently /usr/local or /opt.
Should I install it into /usr/local o... |
Consider that you have two options installing software:
1) System-wide: the application will be accesible by all users, and have to be installed with administrator (root) privilegies.
2) Only for your user, inside your /home/user, installation does not need administrator privilegies.
In the 1) case you normally have t... | Should I install programs directly into /usr/local or a subdirectory in usr/local or into /opt? [duplicate] |
1,422,471,670,000 |
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)
that is executed by an Apache server on the target system.
I got the name of the file the flag was hidden in through a h... |
The locate command, which is installed on most Linux machines, gets its information from a database containing all the paths on the system. A cron job maintains this database.
There are competing implementations of locate and probably competing ideas on where the database should be, so you may have to dig up a few ver... | File containing directory structure |
1,422,471,670,000 |
I'm writing a tar implementation for a package manager, and I wonder if I can skip the permission setting of the user in the tar headers and keep what is there by default, the user who wrote the files, in my case root.
Would this present a problem? The package manager is designed to not write anything inside /home.
|
Most but not all files that are part of the system are owned by the root user. It's rare for system files not to be owned by root, because a user that owns system files can modify them and this is usually not desirable. It's a lot more common to have files that are owned by a group other than root, and that have mode ... | Are all files outside of /home/userabc owned by root? |
1,422,471,670,000 |
I've googled, searched Unix & Linux Stack Exchange, and... well, there's not really much else I can do, is there?
I was browsing some quines in various shell languages, and I came upon the following shebang:
#!/xhbin/bash
A lot of old websites (seem to) talk about it like we talk about /bin today, but on the other ha... |
Mikel is right. From this post on Google Groups' group for CS246 at the University of Waterloo:
Don't let the /xhbin part spook you. This is a peculiarity of the
MFCF/CSCF environment. I don't know all of the details, but some
time ago MFCF developed a program called xhier to make it easier to
distribute so... | What was xhbin? |
1,422,471,670,000 |
I've been writing a Linux device driver for some measurement devices I'm attaching to my Raspberry Pi. I've created my kernel module and an application to access the character device driver, but the device needs to be calibrated regularly and I need to store the calibration data somewhere. Where is that data usually... |
Per the Filesystem Hierarchy Standard, /var/lib/ might be the right place:
This hierarchy holds state information pertaining to an application or
the system. State information is data that programs modify while they
run, and that pertains to one specific host. Users must never need to
modify files in /var/lib t... | Where to store calibration files for a custom Linux device driver |
1,422,471,670,000 |
I have Debian wheezy chrooted in my Android. However all its directory is in my internal memory. So, if I apt-get install something, it gets installed in /data/data/.../debian/usr/local/bin directory.
I have bound my external sd under /sdcard/sdext2 in Debian.
I can access it by cd /sdcard/sdext2 and verified with ls... |
Debian does not install anything into /usr/local, in the sense that official Debian packages are forbidden to touch that hierarchy. Also, Debian packages can assume absolute installation paths, so they may not work correctly if moved by hand (or by somehow tricking dpkg into installing them into a different hierarchy)... | How to change the default directory where programs get installed |
1,422,471,670,000 |
Could someone please explain this to me? I'm having trouble understanding how this is set up and why it behaves the way it does.
I wanted to see where zsh is actually installed on a machine that I use. So I used ls to find where the symlink points.
$ ls -l /bin/zsh
lrwxrwxrwx 1 root root 14 Dec 1 20... |
/bin is probably a symlink to /usr/bin on your system. If that were true then:
/bin/../sfw/bin/zsh
would actually be the same as
/usr/bin/../sfw/bin/zsh
which reduces to
/usr/sfw/bin/zsh
which is where zsh actually lives. Note that what you tried, which was
/bin/sfw/bin
does not correspond to any path that you act... | Strangeness with Symlinks and Relative Paths |
1,422,471,670,000 |
On my server I have a bunch of accounts that have WordPress installed and also have backup directories in the format: softaculous_backups.
I can find all the directories using the command:
$ find / -type d -name "softaculous_backups" -ls
I can use commands to check the disk space used by each folder like:
$ du -smc ... |
How about that:
find / -type d -name "softaculous_backups" -exec du -sm {} \; | sort -n
For every found directory, du -sm is executed. After that all output is sorted numerically.
| Search directories and return size / disk space usage for each |
1,422,471,670,000 |
I'm under the impression that there are a bunch of directory names that have common semantics, like (in no particular order):
usr
tmp
src
lib
etc
share
opt
bin
sbin
var
data
include
There are others that may or may not be UNIX-y (e.g. libexec) but they show up frequently enough to imply that conventions exist.
I no... |
Racket has a concept of collections. From its website:
A library is module declaration for use by multiple programs. Racket further groups libraries into collections that can be easily distributed and added to a local Racket installation.
It appears as though the collects directory holds collections that are distrib... | Is there any common meaning to a `collects` directory? |
1,422,471,670,000 |
If I were to write a library for a C-incompatible language (like D), where would be the best place to install my "header files" to?
usr/include seems like a bad idea, since the FHS says it's for "header files included by C programs."
|
You define your own conventions, but I'd indeed stay away from /usr/include.
/usr/lib/<lang> seems popular here for interpreted languages (I've at least /usr/lib/python, /usr/lib/perl and /usr/lib/ruby with variants for the handling of version specific stuff) I think that /usr/share/<lang> is more proper from the FHS... | Where are "headers" for other languages kept? |
1,422,471,670,000 |
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 dependency for anything else, I would place that in /opt/somepackage, with a hierarchy of my choice underneath.
FreeBSD, acco... |
You install user programs in /usr/local/. There is no /opt in the standard install or mentioned in the hier man page.
From the man page:
/usr/ contains the majority of user utilities and applications
And:
local/ local executables, libraries, etc. Also used
as the default destination for the ports(7)
frame... | Where to install custom software packages on FreeBSD? |
1,422,471,670,000 |
ls - list directory contents
empty_dir# ls -al
total 0
drwxr-xr-x. 2 root root 6 Dec 31 09:49 .
dr-xr-x---. 6 root root 284 Dec 31 09:49 ..
find - search for files in a directory hierarchy
empty_dir# find
.
|
find has to deliberately exclude . and ..
It has to avoid descending into them, as it would do for other directories returned by readdir().
Rather than show the directories . and .. but not show any of their contents, it excludes them entirely.
This is the desired behaviour, for example if you used find -exec touch \{... | Why does find . not show all files |
1,422,471,670,000 |
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 HDD, to save space on the SSD for things where the improved loading time is more significant (and also save wear on the SS... |
I'm not aware of any standard having rules or recommendations for this situation, however it is fairly common so well worth discussing.
Firstly, I would avoid symlinks. In my opinion it is usually much cleaner to modify the path. Using either /etc/environment or /etc/profile is probably best.
As for directory structur... | Proper location for software on non-boot partition |
1,422,471,670,000 |
I have some sshfs mounts which I want to put in a Linux filesystem location following the Filesystem Hierarchy Standard.
The standard is strangely silent on where network mounts should be placed:
media Mount point for removeable media
mnt Mount point for mounting a filesystem temporarily
Mounting under /net ... |
The FHS is defining directory names and usage. Creating a custom directory directly under the root one is considered risky as it might conflict with a future version of the standard or with a new OS owned directory.
Unlike many other Unix and Unix like OSes file system standards (e.g. freeBSD and Solaris), the FHS fai... | Where should sshfs mounts be placed in the filesystem? |
1,422,471,670,000 |
I have a NFS-mounted home directory where I keep some executable programs for different OS and machine architectures. (A particular executable is built for one particular architecture only.) I have to store these executables in different bin directories (one bin directory for each OS/machine combination) so that I can... |
While the current version of the FHS does not discuss locations of binaries for different architectures, a related issue came up in their bugtracker. This proposal could be extended to include the OS as well, but that should be discussed in the FHS mailing list.
In short: no standard exists (yet) and every site is fre... | Multi-arch bin directories |
1,422,471,670,000 |
What I want to do is present a directory, the contents of which are sourced from a series of other directories on the file system. It would be like a soft-link, only a link to multiple directories at once, rather than just one.
The directory might be considered read-only - or, if updates to a file are made, it would b... |
It's not available as part of standard Unix or a graphical Linux interface.
Linux system administrators can use overlayfs. Actually one of the most important uses is to allow modifications to a running LiveCD system, e.g. installing extra packages.
There are also equivalents in FUSE, which can be used on Linux withou... | Unix equivalent of smart folders |
1,422,471,670,000 |
I have created new module code. And want to compile it for my kernel. But I am not sure about I thing. Should I copy it to some designated directory before I start the compilation? Or I can just compile it wherever I want?
Thank you very much!
|
There isn't anywhere special the source code needs to be. Normally it'd be wherever your repository is.
If you want to leave it somewhere for the next admin to find, the most obvious place would be a company VCS server. /usr/src would also be a reasonable place to look, as well as $HOME.
Eventually, if you decide to s... | Where (the directory) should I put my newly created module in the kernel? |
1,422,471,670,000 |
I am writing a piece of software (C++) which generates Python scripts.
Where should these temporarily existing scripts be placed in the file system?
I read a couple pages about the Filesystem Hierarchy Standard, but I didn't find any reference to generated scripts.
/usr/bin does not seem to be a good idea as it might ... |
Temporary files whose lifetime doesn't exceed that of the program that creates them, and in particular aren't supposed to survive a reboot, go into /tmp. Or rather, the convention is to use the directory indicated by the environment variable TMPDIR, and fall back to /tmp if it isn't set.
You can execute files in /tmp.... | Where should generated scripts be placed in the filesystem? |
1,422,471,670,000 |
Is there a conventional location to store non-secret bulk files that can be accessible by multiple users? I know that I can create a new folder (and set the right permissions) in most places in the file system. But I'd like to follow a established convention so (a) the structure is more familiar to our new users an... |
Usually it depends on exactly what the files are for. In practice I've seen people use /srv for server data, /var/www/html for web-accessible files, and /usr/local as sort of a catch-all. I've also seen a lot of vendors using /opt as being similar to C:\Program Files on Windows (i.e a collection third party applicatio... | recommended storage location for multiple users [duplicate] |
1,422,471,670,000 |
This is a bit vague of a question, as I could just create a folder anywhere in the filesystem and set the permissions accordingly. However, I would like to know where the "correct" location to place shared media in the Linux filesystem hierarchy would be.
In my case I have a single machine with a user for personal/rec... |
There are as many answers to this as there are linux servers out there.
Personal advice is to do it one way and then stick with it.
My personal setup is inherited from ubuntu (as it was once upon a time); all my data is stored in an LVM volume group, so each data category has its own LVM drive. I.e music is on the 'mu... | "Correct" place to store shared media on a single machine |
1,422,471,670,000 |
Not sure what I'm missing here, but when I try to list the contents of the Applications directory from the Terminal it produces a directory with a couple .dmg files and none of the actual application directories or content.
I would like to get access to the list of actual Applications within the directory. I'm on Yos... |
You are using the ~/Applications/ Folder and Not /Applications.
Try:
cd /Applications
And then:
ls
~ Means home, which is /Users/user/. There is a users Application folder but it is very rarely used and it is for Applications that are installed for only that certain user. All default Applications are in /Application... | Unable to view Applications Directory Content in Terminal |
1,422,471,670,000 |
I'm new to Unix, and wanted to give it a try. I had an old PC lying around and decided to turn it into a network based backup system to keep the data in the other PCs safe. So I installed FreeBSD on it, and set up Bacula on it to handle the backups. So far so good.
I'm configuring the system now, and I noticed that th... |
For a permanently attached disk for storing backups of other hosts, /var/bacula is fine; hier(7) says /var is for "multi-purpose log, temporary, transient and spool files" (emphasis mine). Backups by their very nature change over time, making /var a good choice. MySQL, on some platforms, is configured to use /var as i... | Where should I mount a disk to store backups? |
1,422,471,670,000 |
The kdebase-workspace package on Arch Linux only preservers changes made to /usr/share/config/kdm/kdmrc when the package is updated. I need to edit /usr/share/config/kdm/Xsetup to get my monitors to rotate correctly, but the changes get lost every time kdebase-workspace gets updated. The Arch Wiki recommends copying /... |
Files under /usr are meant to be under the control of the package manager (except for files under /usr/local). Configuration files that the system administrator may modify live in /etc. This is part of the traditional unix directory structure and codified for Linux in the Filesystem Hierarchy Standard. The recommendat... | Why do upgrades to KDM/KDE not preserve changes to configuration files? |
1,422,471,670,000 |
I'm writing a server on a shared development desktop that moonlights as a server.
This is my first attempt at writing a linux server for someone else on a shared box. I'd like to conform to unix standards and make it as professional as possible.
In what directory should the websocket server be placed? I was thinking... |
I'm not sure what you mean by “websocket”. If this is a web server, it listens on TCP, and there's no reason why it would also have to listen through a unix socket.
Assuming you do want to use a unix socket, if your server is started by root, you can create a subdirectory in /var/run, give your daemon write permission... | Server socket location, startup and monitoring |
1,422,471,670,000 |
In the past when I have compiled applications from source I have extracted the source code to ~/src and compiled from there.
I realize now that there may be no need for me to create the ~/src directory, as Linux probably already has an established location for source code for applications such as this.
Is this the cas... |
There's no pre-determined, or even globally preferred, location. The closest analogue I know of would be the /usr/src tree in Red Hat Enterprise Linux and derivatives, but most applications that you compile are designed to be unrolled into their own directories, compiled as a non-privileged user, and only then install... | Where to place source code for applications compiled from source? |
1,422,471,670,000 |
Which directories should I expect to have in an install prefix when I'm writing makefiles? I've noticed that in the common prefix /usr, there is no /etc, yet there is an /include dir, which isn't in the root directory. Which paths are hard-coded such as /etc and /var maybe and which directories lie in a prefix? As far... |
See the FHS (Filesystem Heirarchy Standard) for details: http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard and http://www.pathname.com/fhs/
| What do I install into a given install prefix |
1,487,538,464,000 |
Update: The specification provided in the answer below negates the actual question, that is it applies to a broader scope of specifications, thereby eliminating the need for this question (see answer).
I'm struggling to find cohesive documentation on this one. Basically, I would like to know, with references where pos... |
I couldn't find a specification specifically referencing mounting, but Chapter 19. Additional Recommendations - Linux Standard Base Core Specification, Generic Part seems applicable.
19.1.1. Directory Write Permissions
The application should not depend on having directory write permission
in any directory except /t... | GNU/Linux: What is the behaviour specification (if any) of a program mounting a volume? |
1,487,538,464,000 |
It seems to me that there's a lot of confusion (or at least there is on my part) about how different file systems are structured among different distributions of Linux/Unix.
It would stand to reason then that instead of having different types of packages for each system, it would be more useful to have environment var... |
Linux doesn't have an equivalent to Windows's %ProgramFiles% variable because it doesn't need one. There's a standard location for programs that are installed in their own directory: /opt. Bit most programs aren't installed there, because they come in packages, and their files are located where they will be found by o... | Standard environment variables for distribution-specific paths |
1,487,538,464,000 |
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 inode numbers are stored in the directory information block together, hence why does it take more time to query the inode num... |
strace shows me that ls -i is calling lstat() on each filename
That would explain the extra work.
Given that readdir() has already returned the inode number this appears to be sub-optimal
while this feels like a bug, this behaviour is for consistency with mount points. (see Thomas' comment)
| Why is ls -i slower than ls? |
1,487,538,464,000 |
Suppose, I create seperate partition for "/usr" directory. This is the directory which contains all user programs. If I switch from one OS to other(for eg. From Ubuntu to Arch Linux or vice versa), can Arch linux run that program?
Will blender that I installed on Ubuntu work on Arch Linux?
|
You can make them run on different distributions with some work.
The main things programs rely on are libraries. These libraries will be stored in different locations in different distributions, but you can find out where these libraries are linked with the ldd command.
For example, this is the output of ldd when run ... | Does software installed in one distribution of linux run in another distribution of linux? |
1,487,538,464,000 |
I have the following directory structure:
/media/storage/sqlbackup/CUSTOMER1
/media/storage/sqlbackup/CUSTOMER2
...
/media/storage/sqlbackup/CUSTOMER*
Each CUSTOMER* directory may contain subdirectories named daily, weekly, and monthly. If a CUSTOMER* directory does not contain daily OR weekly OR monthly, I want it t... |
You can create the directories while hiding any error related to the directory already existing:
for custDir in /media/storage/sqlbackup/CUSTOMER*
do
mkdir -p "$custDir"/{daily,weekly,monthly}
done
You cannot use /media/storage/sqlbackup/CUSTOMER*/{daily,weekly,monthly} because the {...} sequence is expanded befo... | Find all directories NOT containing matched subdirectory and create them |
1,487,538,464,000 |
I would like a cleaner way to nest this command;
if [ ! -d $BACKUPDIR ]; then
mkdir -p $BACKUPDIR
mkdir -p $BACKUPDIR/directories
mkdir -p $BACKUPDIR/databases
mkdir -p $BACKUPDIR/logs
else
:
fi
|
With brace expansion, you could do just
mkdir -p "$BACKUPDIR"/{directories,databases,logs}
If you want to make sure the subdirectories exist, too, you can just run mkdir without the test. With -p it shouldn't complain about existing directories, and there will be no chance of the main directory $BACKUPDIR existing, b... | create a nest of directories in bash |
1,487,538,464,000 |
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 following except how can I define the range here?
for d in ["sd1"-"sd2"] do ( cd "$d" && do stuff ) done
|
Use brace expansion if you have a shell that supports it:
for d in sd{1..2}; do
( cd "$d" && dostuff )
done
With zsh, ksh93 or yash -o braceexpand (but not bash), you can do
n=4
for d in sd{1..$n}; do
( cd "$d" && dostuff )
done
Related question: Can I use variables inside {} expansion without `eval`?
A vari... | How can I do subdirectory manipulation in shell? |
1,487,538,464,000 |
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 --create --gzip --recursion --file=/home/user/test_backup.tgz --directory=/home/user/opt .
However this only saves the dir... |
When you use --directory FOO . you're telling tar to change to the FOO directory and start archiving from there.
If you want full path names then you should specify them as the pattern.
eg
tar -czf /home/user/test_backup.tgz /home/user/opt
However this will strip off the leading / character, so you need to tell tar t... | Tar --absolute-names flag does not work |
1,487,538,464,000 |
For example, on my Red Hat Enterprise Linux 7.2 there are
/etc/rc.d/init.d/rabbitmq-server
/etc/logrotate.d/rabbitmq-server
/usr/sbin/rabbitmq-server
/usr/lib/ocf/resource.d/rabbitmq/rabbitmq-server
more than 4 'kinds' of rabbitmq-server (in fact there are 2 other ones ), are they the same thing? I mean, if I want to... |
No, they are totally different and have different content.
For example I have
A/file
B/file
$ cat A/file
hello
$ cat B/file
there
We can see they say different things.
In your case:
/etc/rc.d/init.d/rabbitmq-server - this will be the startup at boot time script
/etc/logrotate.d/rabbitmq-server - this will manage th... | Are same name in different directory the same thing? |
1,487,538,464,000 |
I have a directory structure
DIR
SUBDIR1
11-01-11.txt
13-05-23.txt
SUBDIR2
12-05-56.txt
13-04-02.txt
15-04-06.txt
I would like to write a bash script that leads to this Desired output
DIR
SUBDI... |
The script:
for f in */*.txt; do
cat "$f" >> "$(dirname "$f")/$(dirname "$f")_merged.txt"
rm "$f"
done
Loop the txt files across the subdirectories:
for f in */*.txt; do
$(dirname "$f")
returns the name of the folder in which the txt resides wich is used both to name the file and the path to save the file.... | merge multiple files in several subdirectories into 1 file for each subdirectory and delete original files |
1,487,538,464,000 |
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 itself, and surprisingly this removed the dir directory but when i checked my current working directory using pwd it was st... |
If you want to understand why this is, you need to understand the difference between files and inodes. rm, rmdir and mv all take action on the inodes describing the file/directory, not the actual file. If you have a file/dir open (e.g. by being in the directory), the inode information is removed, but the actual data ... | Trying to remove current directory using rmdir |
1,487,538,464,000 |
Man expects the man directories listed in $MANPATH or $(manpath) to be split by section into directories named "man$section". This duplicates the section information that is already available in the suffix of the manpage. (e.g. for ls.1.gz, the .1 info gets duplicated in man1/).
Why not skip the middle man-directories... |
It doesn't duplicate the information: you can have more suffixes in a given directory than the plain ".1" or ".3", e.g., (depending on the platform) letters following the numbers. For example, Debian follows the ".3" with a an application suffix such as "pm" for Perl modules.
Here is (part) of the listing from /usr/s... | Man directory layout -- why the subdirectories? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.