A file system structure in which to store computer files.

learn more… | top users | synonyms

0
votes
1answer
16 views

Centos, uploaded files from application have different owner and group

I have an application that uploads a file via SFTP using sftpuser. Once the file is uploaded the owner and group is user1:user1. The owner of the parent directory is apache:apache. I can not figure ...
0
votes
1answer
459 views

Is there a way of copying only directories and not files? [closed]

I want to copy only directories from a folder on a remote server to my server. Is that possible? Here is the code I have so far but it copies files and folders: scp -rq username@192.168.78.331:/copy/...
3
votes
3answers
36 views

Ignore specified absolute directories with tab completion?

I work on a cluster with many users. There are 50 users on the cluster with the same first letter as my username, and a user who has the same name up to the last letter. When I tab complete from /home/...
1
vote
2answers
45 views

How to display the contents that give rise to the sizes that `ls -l` reports for directories?

I understand that the sizes that ls -l reports for directories reflects the space taken up by the "metadata" for those directories. Also, I imagine that this metadata exists in binary/non-human-...
39
votes
7answers
50k views

Find the total size of certain files within a directory branch

Assume there's an image storage directory, say, ./photos/john_doe, within which there are multiple subdirectories, where many certain files reside (say, *.jpg). How can I calculate a summary size of ...
0
votes
1answer
20 views

Cannot change directory at /home as root user (Permission denied) [closed]

I am using GNUroot debian ( an android app ) and after many attempts to connect with ssh to my server I now have no access with cd at my /home folder as a root user. I can run ls /home but I cannot ...
2
votes
1answer
169 views

Print recursively all directories and subdirectories

I am trying to print all directories and sub directories with a recursive function but I get only the first directory. Any help? counter(){ list=`ls $1` if [ -z "$(ls $1)" ] then ...
5
votes
5answers
1k views

Bash pattern to match all files but directories

In bash, how do I specify a pattern that matches everything but subdirectories in current directory. Given that the pattern */ matches all the subdirectories, I tried (with extglob turned on): $ echo ...
39
votes
13answers
19k views

What's the most resource efficient way to count how many files are in a directory?

CentOS 5.9 I came across an issue the other day where a directory had a lot of files. To count it, I ran ls -l /foo/foo2/ | wc -l Turns out that there were over 1 million files in a single ...
4
votes
4answers
1k views

How to count occurrences of all the words in all the files of a directory using grep? But with count incremented only once per word per file

I have already asked a similar question but people misunderstood what i was asking. I was asking how to generate a list of every word with a word count incremented only once per word per file. For ...
1
vote
2answers
2k views

RewriteRule to cause subdomain to load another DocumentRoot?

I could sure use a little help with what I am trying to do with a RewriteRule in .htaccess: ...to causes URLs using our sharpedge. subdomain to auto-load from the Internet_IE directory - one level ...
3
votes
6answers
2k views

finding the absolute directory

Here is the scenario: foo/ > data/ > stuff/ > scripts/ -> /.../generic/scripts When calling foo/scripts/bar.sh from any location (other folder or inside the folder), I would like to be ...
1
vote
2answers
58 views

How to zip directory with encryption for file names?

Using command line, I know that I can encrypt a directory with the following command: zip -er Directory.zip /path/to/directory However, this does not encrypt the filenames themselves. If someone ...
33
votes
2answers
6k views

Why can't I remove the '.' directory?

I tried removing the '.' directory. I thought I could just delete my working directory without having to go into a parent directory. The point of my question is to look for some insight into how the ...
1
vote
0answers
35 views

How to set folder permission with + at the end?

I'm trying to mount a network shared device in a linux box. I get permission issue but it was mounted properly in another linux server. The only difference on the server it works has a + permission at ...
1
vote
0answers
21 views

Removing dirs with lots of tiny files on Lustre

I have a dir with a gigantic amount of very small files that I want to remove and simply removing the dir with "rm -rf /path/to/the/dir" is already taking multiple days. It might sound strange that ...
8
votes
8answers
12k views

What's the best way to count the number of files in a directory?

If parsing the output of ls is dangerous because it can break on some funky characters (spaces, \n, ... ), what's the best way to know the number of files in a directory? I usualy rely on find to ...
2
votes
2answers
34 views

Change Name of Mounted Hard Drive

I just mounted and formatted an extra hard drive to Xubuntu, and the name is way too long for access from the terminal: boy@boy:~$ cd /mnt/d1b2aa11-a3e4-434b-b71c-47a8ac23ac23/ boy@boy:/mnt/d1b2aa11-...
21
votes
2answers
28k views

rsync compare directories?

Is it possible to compare two directories with rsync and only print the differences? There's a dry-run option, but when I increase verbosity to a certain level, every file compared is shown. ls -alR ...
2
votes
3answers
58 views

A folder with d?????????? in the ls -l

I am running the EDG-12.2.1-Trn (CentOS 6.6 64-bit) VM on Virtual Box. This is the Oracle Database VM. When I try sharing a folder, through VirtualBox, it shares successfully (automatically), and ...
1
vote
1answer
26 views

Find and list duplicate directories

I have directory that has a number of sub-directories and would like to find any duplicates. The folder structure looks something like this: └── Top_Dir └── Level_1_Dir ├── standard_cat ...
1
vote
1answer
26 views

Can I replace a directory with a symlink without write permissions in parent?

I would like to replace a directory with a symlink. For the directory itself I have full permissions (rwx), but for the parent directory I don't have write permissions (r-x). Is this possible? The ...
-1
votes
1answer
15 views

On a OS X machine, how can remove a directory that has name “--crm”? [duplicate]

I am trying to remove a directory that has the name --crm. When I do rm -f -R '--crm' I get the following error: rm: illegal option -- - usage: rm [-f | -i] [-dPRrvW] file ... unlink file I ...
33
votes
5answers
58k views

How to recursively find the amount stored in directory?

I know you are able to see the byte size of a file when you do a long listing with ll or ls -l. But I want to know how much storage is in a directory including the files within that directory and the ...
1
vote
1answer
26 views

Group or world writable directory

I'm trying to use a script but get the following error: Directory is group or world writeable. This is insecure, since any malicious user can trick you to write newly generated private key into his ...
0
votes
1answer
9 views

“find” doesn't list all files under specific directories

I'm attempting to get a list of all files under specific folders, recursively, with the "find" command. find / -path "/usr/sbin/*" -o -path "/usr/bin/*" -o -path "/usr/local/sbin/*"-o -path "/usr/...
2
votes
1answer
38 views

Can directories and file inherit same permissions as parent directory?

I want all directories and files to inherit same permissions as parent directory.
1
vote
2answers
978 views

How to give sftp access to sub-directory only not to parent

I want to give SFTP access to user tom for directory /var/www/html/my_project/. while I don't want to give any SFTP access to directory /var/www/html/. currently /var/www/html/my_project/ and /var/...
-1
votes
2answers
46 views

How to find Directories that updated last day in linux?

I have a problem, like I need to find the directories that got updated yesterday. I tried using find command but its listing all the files that got updated in the directories. But I need only the ...
2
votes
0answers
45 views

how to find duplicate folders inside main folder [closed]

I've moved a lot of files and folders from my old nas to my new smb share. The problem is that someone made entire copies of nearly every folder on that thing. And I need the space. I'm currently ...
1
vote
1answer
861 views

Apache created files and its permissions for CentOS 6.x

In short, I have an authenticated HTTP-POST that: posts a jpg image (created as 666 apache:www) into /directory1 (777 ftpuser:www) creates /directory2 (created as 666 apache:www) in a 777 ftpuser:...
2
votes
1answer
40 views

How to change name of “~” directory? Debian 8 [duplicate]

I was providing an install directory for SteamCMD to install a server to, but it created a "~" directory as the parent directory for the directory I wanted. Example: /home/steam/SteamCMD/~/...
5
votes
2answers
2k views

Encrypt directory with GnuPG?

Is there any way to encrypt a directory using gpg? It seems to only accept files as arguments.
-1
votes
1answer
47 views

Sub Directories in sub directory using loop

On my CentOS machine, I need to create a main directory inside which I will have a few sub directories and, inside them, some subsubdirectories. Something like: main_directory->sub1,sub2,sb3.. ...
3
votes
6answers
1k views

Check in ksh if a directory is empty

How do I check if a directory is empty or not in ksh on AIX? If files exist I need to remove files only.
-1
votes
1answer
26 views

Move all sub-directory content up one level

My top level directory contains a bunch of sub-directories: af ar ca cs da de el en ... (lots more) Each of these directories has the exact, same structure. They contain two directories: v2.3.0 ...
0
votes
1answer
28 views

Get parent directory in cshell script

Hi I'm trying to get parent directory in cshell script but the following code found not working in cshell script: #!/bin/csh -f set dir=$PWD set parentdir="$(dirname "$dir")" Error info: Illegal ...
0
votes
3answers
32 views

wget’s --output-document= option failed when contain ~ character

I wright a documentation so I prefer use long options because it’s self-descripting. --output-document= is more readable than his short equivalent -O. Then, I have to indicate a file in the home ...
3
votes
4answers
426 views

Bash script detecting change in files from a directory

I am a beginner in bash scripting and I am trying to make a script that detects if any of the files in a directory were changed within a 2 seconds interval. What I have so far is: #!/bin/bash for ...
31
votes
12answers
177k views

How to remove all the files in a directory?

I am trying to remove all files and subdirectories in a directory. I used rm -r to remove all files, but I want to remove all files and subdirectories, excluding the top directory itself. For example,...
1
vote
0answers
21 views

How do I set up user quota for /var/www?

I want to add quota per user in my Apache2 webroot. My /var/www directory is not a partition. I've found tutorials on how to set up quota for partitions, but how do I set up /etc/fstab without moving ...
2
votes
1answer
51 views

Prevent sudo user access to specific folder and files [duplicate]

How can I restrict sudo access to a specific user in the /var directory or its contents?
1
vote
2answers
33 views

How to use cloc to find lines of code in a debian package

cloc - statistics utility to count lines of code Now the manpage mentions that it can be used to count lines of code of a tarball cloc perl-5.10.0.tar.gz Now a debian package is just like a ...
1
vote
2answers
32 views

How to get all subfolder names consisting of uppercases only?

How to get the folders in a parent folder, the names of which are composed of A-Z, without lowercases, underscore, dot or any other things?
0
votes
1answer
136 views

Hyphen/Dash “-” Symbol's use in Linux bash /dir + GRUB booting for newbs

I am attempting to complete this GitHub tutorial on creating a custom GRUB loader for a stubborn Asus Win8.1 laptop on which I am hoping to install Ubuntu: https://github.com/lopaka/instructions/blob/...
0
votes
2answers
33 views

Man directory layout — why the subdirectories?

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 ...
1
vote
1answer
43 views

Limited access to a directory's contents

There is a file in a directory that me and the other users want to be able to read. I want the other users not to be able to see the other files in the directory. They should be able to read a ...
2
votes
1answer
154 views

Why can I cd to // but not /// or //// or ///// or … [duplicate]

When I change directory to //, it seems to put me in a special directory that is very similar to but slightly different to /. However, trying to add any further slashes (///) simply drops me in /. $ ...