A file system structure in which to store computer files.

learn more… | top users | synonyms

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
vote
0answers
23 views

how to find duplicate folders inside main folder [on hold]

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
votes
1answer
38 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
18 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
23 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
28 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
3answers
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 ...
3
votes
4answers
413 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 ...
30
votes
12answers
168k 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 ...
1
vote
0answers
18 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
43 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
28 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
134 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: ...
0
votes
2answers
29 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
151 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 /. $ ...
1
vote
2answers
53 views

expand wildcards “inside a command” instead of in the shell

(This is a simplest working example of something in a much messier context.) I have a directory d with files 1.txt 2.txt 3.txt 4.wav. My current directory is somewhere else. ls d reports 1.txt 2.txt ...
1
vote
2answers
25 views

How do I remove all files from wtihin a certain directory except for a child directory of that directory?

I’m using bash shell. I have this command to delete all JAR files within a particular directory find ~/.jenkins/jobs/subco/ -name '*.jar' -print0 | xargs -0 -r rm However, I want to modify the ...
1
vote
2answers
938 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 ...
1
vote
2answers
29 views

How to work with symbolic links to directories

I am experimenting with symbolic links and I'm encountering a couple issues. The first is how after following a symbolic link to a directory to display the actual working directory instead of the ...
4
votes
6answers
9k views

Get a list of directory names with find

I know I can do this to get a list of directory names: find . -type d -maxdepth 1 The output looks like this: . ./foo ./bar I prefer the listing without ./. Is there a way to get find to output ...
35
votes
4answers
145k views

“Input/output error” when accessing a directory

I want to list and remove the content of a directory on a removable hard drive. But I have experienced "Input/output error": $ rm pic -R rm: cannot remove `pic/60.jpg': Input/output error rm: cannot ...
1
vote
1answer
821 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 ...
0
votes
1answer
26 views

rsync wants to resend files after a recent run

I am using rsync to keep two directories in sync. Specifically I ran: rsync -avz /path/to/src /path/to/dest After this command finished, I ran: rsync --dry-run -avz /path/to/src /path/to/dest ...
2
votes
2answers
51 views

Delete directories that contain a certain file

I want to find all directories that contain a certain file and then delete those directories. With find . -name thatcertainfile -execdir pwd \; I get a list of all the directories I want to delete, ...
2
votes
2answers
49 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
112 views

`ls` behavior on EACCES error for /root and /root/some-rubbish

I'm trying to code a clone of the ls command as part of a school exercise. I'm wondering why the following output is displayed by ls: $> ls -- -test_dir /root /root/some-rubbish ls: ...
2
votes
1answer
152 views

How to scan a directory with a space in its name with maldet

I'm trying to scan some directories with Linux Malware Detect (command-line command maldet): maldet -a /SOMETHING\ 1/ But I get: maldet(13857): {scan} invalid path /SOMETHING 1/ I've tried ...
53
votes
8answers
47k views

Merging folders with mv?

If I use mv to move a folder called "folder" to a directory that already contains "folder" will they merge or will it be replaced?
1
vote
1answer
31 views

How does 'Create New Folder' short-key work?

In many file managers there is a shortcut/key to create a new folder. In Nautilus, Thunar, Panthon-Files, this is Ctrl+Shift+N, in Dolphin it is F10. How does this shortcut work? I imagine that ...
0
votes
0answers
29 views

Directory became UNIX binary (OS X)

I recently fixed the file permissions of my home directory using System Recovery mode. But after rebooting I found that one directory had become a single unix binary. I have tried everything from ...
1
vote
2answers
41 views

Detect and remove empty directories from list

A common problem game developers have with the Unity3D engine and Git is that Unity and Git fight for whether an empty directory should exist or not - Git doesn't care, Unity3D will keep making git ...
10
votes
3answers
1k views

Boot into a chroot?

I have Linux (Debian Jessie) installed on a hard drive. Drive - sda1, ext4fs, and sda2 - swap I have a /chroot folder. There is installed another system, in /chroot folder. Question: How to tell ...
0
votes
2answers
20 views

Ubuntu: Installing programs into specific locations

I have software which is built using a makefile. This makefile also contains (relative) paths to different programs (such as gsoap, postgresql and others) which provide stuff that I need to include. ...
0
votes
3answers
23 views

How to get second directory name in the perforce file path?

I need to get the directory in the second column after depot. For example given the below file(s) list, I need "Directory2" as the output. //depot/Directory2/Dir3/Dir4/Dir5/Dir6/Filename1 ...
1
vote
1answer
29 views

How can I get a persistent dirstack with unique entries in zsh?

The Arch Wiki has this interesting bit of zsh configuration: DIRSTACKFILE="$HOME/.cache/zsh/dirs" if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then dirstack=( ${(f)"$(< ...
2
votes
1answer
96 views

Directory stack order discrepancy in zsh

I am working on Zsh 5.0.2 (latest stable version), and I noticed that: dirs -v and cd -<TAB> show a different list of directories (or at least directories in different order). Moreover, ...
65
votes
10answers
70k 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 ...
-3
votes
1answer
24 views

How can get back to directory line from mysql line

So I'm not sure what exactly do but enter to mysql and now I cannot return to directory line. I show in picture what exacly I mean: My question is: How can from this directory go in: Here I ...
9
votes
4answers
430 views

Keeping history per working directory (cf. per shell session)

Is there a way to make a modern shell's history feature be scoped to a path? My working contexts are split up as paths on the file system, and the pattern of shell activity, such as repeatedly issued ...
91
votes
7answers
32k views

Why are hard links to directories not allowed in UNIX/Linux?

I read in text books that Unix/Linux doesn't allow hard links to directories but does allow soft links. Is it because, when we have cycles and if we create hard links, and after some time we delete ...
0
votes
1answer
31 views

(ls) command won't show exact size - Weird output [closed]

I am trying to find the size of the files on my hard drive in exact bytes, but whenever the size gets too big the number turns all weird (like 1.98329e+12). Can I stop it from doing this or convert ...
1
vote
2answers
223 views

Aircrack-ng: No /pentest/passwords/wordlists/darkc0de directories

this is my fist question on this forum. I'm currently using Linux Mint 17.2 Cinnamon and trying to run Aircrack-ng to show the password of my own Wi-Fi connection, I got the Handshake too. The problem ...
1
vote
3answers
664 views

tar excludes way too much

When running tar in /, how can i exclude e.g. "/sbin" while not also excluding "/usr/sbin"? Some details: It is widespread opinion that tar --exclude=dir only excludes "dir" and its subfolders seen ...
2
votes
2answers
38 views

List all the files in ending with several file extensions?

If I want files ending with .fas I know I can do the following with ls command : ls -l /users/jenna/bio/*.fas and this lists out all the files ending with .fas. But how can I get files ending with ...
1
vote
2answers
62 views

Why does Linux not allow `cat`ing a directory? [duplicate]

I read in The Design of the UNIX Operating System that directories are files containing the names of each file they contain. So I tried cating one on my Mac, and it resulted in an error: cat: ./: Is a ...
1
vote
1answer
29 views

Trying to get files into individual folders (1 folder for each file)

from the comments here: https://generateme.wordpress.com/2015/08/12/training-own-dnn-for-deep-dream/ I have around 15k images and each one needs its own folder. I ran this once, when I had fewer ...
1
vote
1answer
75 views

What is the number at the top for the results for ls -l? [duplicate]

When you type in ls -l, there is a number on the first line labeled "total 22037"? What does this number mean? I am attempting to write my own version of ls -l( in C), and how do I get this value or ...