A file system structure in which to store computer files.

learn more… | top users | synonyms

1
vote
1answer
23 views

write permission to a folder

I have the following folder: $ ls -ahl /mnt/smrtanalysis/ total 16K drwxr-xr-x 4 smrtanalysis smrtanalysis 4.0K Jul 25 01:52 . drwxr-xr-x 6 root root 4.0K Jul 25 01:46 .. lrwxrwxrwx ...
34
votes
4answers
12k views

Flattening a nested directory

This is probably very simple, but I can't figure it out. I have a directory structure like this (dir2 is inside dir1): /dir1 /dir2 | --- file1 | --- file2 What is ...
2
votes
2answers
145 views

How to redirect file output to a different directory?

I have a program that regularly outputs files to a directory, let's say /a/b. I am utterly unable to change where these files are outputted. But for me to use them, I must first move them to, let's ...
4
votes
4answers
2k 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 ...
0
votes
1answer
37 views

Copying files from one sub directory to another

I think I must be missing something obvious. I am in a directory called AmHist, with 2 subdirectories, Assign and Resources. I want to move 2 files from Assign to Resources. I try cp LinuxHist ...
2
votes
4answers
65 views

Extract the directory path containing the file with matching string

I have multiple subdirectories at multiple levels containing a file results.out ./dir1/results.out ./dir2/dir21/results.out ./dir3/dir31/dir311/results.out Now i need to search for string1 in ...
11
votes
3answers
6k views

find with -execdir

When I run find with -execdir I don't get the results I was expecting. For example: mkdir -p a/b/c find . -type d -execdir touch foo \; $ tree a a ├── b │   ├── c │   └── foo └── foo Directory c ...
1
vote
2answers
39 views

inaccessible directory

I git cloned into a directory "/source" before I mkdired it. It did not show up in its parent directory, but when I run the ls command, the output is indented like this: database static ...
0
votes
1answer
24 views

Copy folders has specific part of name and it is content

I have a long list of folder as follow: 001_bat_3513 002_mon_3213 003_bat_3515 004_btt_3540 005_bat_4513 055_bpt_8523 056_bot_3513 058_bat_1513 . . From this list: How can I copy the folders ( and ...
1
vote
1answer
23 views

Rename all the folders by removing specific part of first digits or characters from it is name

I have a long list of folders as follows: 001_bat_3513 002_mon_3213 003_bat_3515 scd_btt_3540 s52_bat_4513 xx2_bpt_8523 056_bot_3513 058_bat_1513 . . From this list: How can I rename all the ...
1
vote
2answers
1k 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
vote
1answer
914 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:...
6
votes
5answers
2k views

How can I use locate only for a directory

This finds a large number of files that are under various subdirectories of "Dropnot" $ locate Dropnot Can I find just the directory location with locate? (which directory "Dropnot" is in) So if ...
13
votes
4answers
14k views

How can I force unzip / zip not to create a subdirectory when I extract it?

Depending on how a zip file is created, sometimes it will extract all of the files directly, and sometimes it will extract the files into a subdirectory. If the latter is true, how can I force the ...
0
votes
1answer
33 views

Create folders from specific parts of lines in a text file

I have parent folder includes sub folders. In every sub folder I have folders as follow: Parent_folder folder1 folder_01_PAP_515151 folder_02_PAPA_554651 folder_03_PAPX_541313 ...
19
votes
3answers
40k views

How do I remove all sub-directories from within a directory?

This question is kind of a phase II to the first question I posted at here I have a directory that contains a bunch of sub-directories, .zip files, and other random files not contained within a sub-...
68
votes
11answers
77k views

How do I get the MD5 sum of a directory's contents as one sum?

The md5sum program does not provide checksums for directories. I want to get a single MD5 checksum for the entire contents of a directory, including files in sub-directories. That is, one combined ...
12
votes
5answers
6k views

How to run a command when a directory's contents are updated?

There is a directory A whose contents are changed frequently by other people. I have made a personal directory B where I keep all the files that have ever been in A. Currently I just occasionally ...
2
votes
3answers
41 views

Find a specific file in the nearest ancestor of the current working directory

I'd like to find a way to find a given file by looking upward in the directory structure, rather than recursively searching through child directories. There's a node module that appears to do ...
0
votes
1answer
19 views

Create directory from files and move files

I want to move files based on a specific pattern. I was working with this code, but it does not work well with the task. for file in *.fastq.gz do dir="${file%R*}" mkdir -- "$dir" mv -- "$file" "$...
1
vote
1answer
34 views

wget not downloading files recursively

I saw some of the posts on this website about how to download files from a directory recursively. So, I executed the following line: wget -r -nH --cut-dirs=3 -A '*.bz2' -np http://www.xfce.org/...
1
vote
1answer
607 views

How does apache determine what directory to show from public_html?

I am using Ubuntu 12.04 and have configured apache to serve from ~/public_html. I am trying to serve some directory contents over http on LAN. When I did the following: ln -s ../Videos/android-...
42
votes
8answers
52k 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 ...
1
vote
2answers
3k views

Can't access Apache log folder

I want to see apache log file. This is what I tried: I granted most all permissions to apache2 folder. hieund@hieund:/var/log$ sudo chmod a+rw apache2/* But I can't cd to it. So I add my user to ...
1
vote
2answers
1k views

How can an I/O stream in a particular Linux directory or file be monitored for bytes read/written?

I have a problem with the monitoring of an I/O stream in a particular directory: the amount of read and written bytes during a specified period. I have been trying to use iostat, inotifywait and ...
1
vote
2answers
42 views

Get `scp path/` behave like `rsync path/`

I have local file structure: /tmp/24 /dir1 /file1 /file2 /dir2 /file3 /file4 and I want to upload it to remote compute. When I use rsync /tmp/24 host:/...
0
votes
0answers
28 views

File not createable in one directory having the same permission as another directory where it is

Trying to create a file in one directory works, whereas in a sibling directory with owners and permission copied, the same errors out with Permission denied. (touch as root works in both directories.) ...
0
votes
1answer
35 views

Centos, uploaded files from application have different owner and group [duplicate]

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
509 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
44 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
47 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-...
0
votes
1answer
39 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 ...
3
votes
1answer
458 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 ...
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
85 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 ...
34
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
37 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
26 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
35 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
29k 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 ...
2
votes
1answer
33 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
33 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
20 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 ...
35
votes
5answers
61k 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
27 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 ...