A file system structure in which to store computer files.
2
votes
1answer
15 views
Procmail standard base path for directory delivery
I had trouble with procmail not wanting to deliver my mail to a specific folder. I had:
DEFAULT=/home/vmail/${ER_DOMAIN}/${ER_USER}/
:0
* ^To:.*my-email
* ^Subject:.*some-filter
.the-dir/
But got ...
2
votes
1answer
32 views
How can I make multiple copies of one folder without merging?
When two or more identically named folders are to be copied into or moved to the same location, the default option either in the GUI file manager, or using in a terminal cp -r --backup=numbered or ...
2
votes
2answers
49 views
Where do installed RPMs go?
I download and install packages on my Red Hat Enterprise Linux Server 6 machine using YUM package manager in command-line mode.
When I install apk files on my Android phone, they go to /data/app ...
3
votes
2answers
59 views
Permissions by path instead of file mode bits
I often find that the unix way of handling file permissions is powerful, particularly when combined with ACLs, but rather difficult to handle. Setting file modes, group ownership and extended ...
2
votes
2answers
99 views
Prevent creating directories but allow creating files
I have a directory shared through Samba. I want users to be able to create/modify/delete files but not create/erase directories. I haven't found a way to do it. Maybe with SELinux? But how?
4
votes
4answers
176 views
Making a directory protected from 'rm -rf'
I just lost some data in folder A which was inside folder B after doing rm -rf B. Before I could realize what have I done, it was all over. Now a lesson is learnt, I wish to make some of my folder ...
0
votes
1answer
64 views
What is the common name for directories . (dot) and .. (dot dot)? [closed]
The . (dot) and .. (dot dot) exist in every directory (and probably in every OS).
As we all know (or at least should):
. (dot) is the current directory
.. (dot dot) is the parent directory
Is ...
0
votes
1answer
48 views
Unable to delete a directory even as root
I am unable to delete a directory even as root. The command rm -rf kdyiyv.pif
returns nothing. Then I tried the command, touch kdyiyv.pif for which there was an error: touch: setting times of ...
1
vote
2answers
62 views
cat files in current folder and all subfolders [duplicate]
I want to cat a file in current folder and all files in all subfolders (and subsubfolders).
Here is my directory structure
$ tree
.
├── f
│ └── foo
└── yo
I want to cat foo and yo.
I've tried ...
5
votes
3answers
206 views
Walking through files in directory randomly
How to change for track in *.mp3; do so that all .mp3 files in the current directory are walked through but in a random way?
2
votes
4answers
49 views
find command: how to ignore pathname?
I have to find some type of files in a directory and it's subdirectories and I only have to print out the filenames.
So here's the main command:
find -type f -name "*.c"
Now, how could I cut the ...
3
votes
1answer
66 views
How can I delete a hardlink to a directory?
Before I get 100s of answers that tell me it is impossible to hardlink directories in linux: yes, I know that.
The file in question appeared in lost+fount after I checked the filesystem with e2fsck ...
3
votes
1answer
104 views
ACL, ls, “permission denied” and a lot of questionmarks
I have two users, Alice and Bob. Bob should be allowed to list, ls, Alice's home directory. Alice also has a file in her home directory that Bob should also be allowed to read.
I run these commands ...
2
votes
4answers
125 views
Find and copy directories containing file type
I have a directory "Movies" containing subdirectories "Movie Name". Each subdirectory "Movie Name" contains a movie file and related image/nfo files etc.
I'm trying to copy all directories containing ...
0
votes
1answer
36 views
centos httpd.conf set different ip for a directory
I have 3 IPs in my server, i want use them to increase twitter API limits.
How to set a different ip for a directory in centos 6.1 httpd.conf (apache 2.3.1)
I added these line in the bottom of ...
2
votes
1answer
40 views
Share a directory over FTP with chroot_local enabled
I'm using vsftpd. By default, when I create a user, they are jailed in their directory which is /home/user.
I have enabled chroot_local_user=YES.
On the other hand, I also wanted to create a shared ...
4
votes
4answers
391 views
Is it possible to make multi-level directory? [duplicate]
Using mkdir() (the C function) I can create a 1-level directory, if I want to create multi_level directory like:
folder/subfolder/subsubfolder
is it possible? if so, how?
1
vote
2answers
100 views
using root to mkdir in another users home directory
having a bit of a difficult time trying to create a folder under another user's /home/devuser1/pubic_html folder. I'm trying to avoid using sudo and looking for an alternative. The permissions on the ...
2
votes
3answers
82 views
Passing multiple directories to the -prune option in find
I am using find to locate and delete backup files but wish to exclude certain directories from the search. The backup filenames could terminate in .bck, bak, ~, or backup.
The Minimal Working Example ...
2
votes
2answers
72 views
Permissions for FTP directory: Inherit directory owner
I am making multiple folders for users (userA/, userB/, etc.) where anyone can create/read a file/folder in any directory (userC can make fileX inside userA/). However, only the directory's owner can ...
1
vote
1answer
40 views
Directory stack order 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, ...
1
vote
8answers
110 views
remove content of directory in elegant way
I would like to remove all content of the current working directory.
How to do it in efficient and elegant way?
I have several files, directories and some of them starts with dot, like:
touch .abc; ...
1
vote
4answers
253 views
Is there a command to list files, exclude sub-directories and display size and date?
Before I begin please assume I have only basic knowledge in UNIX. Basic meaning I have only started reading about it since last week for a work related purpose.
I have been experimenting with the ls ...
3
votes
1answer
85 views
Listing both ls information and mount points of a directory?
On my Ubuntu Natty, typically all new drives inserted (e.g. USB Flash thumbdrives) are mounted under /media. So, on my system, I can do something like this:
$ mount | grep '/media'
/dev/sda6 on ...
1
vote
0answers
108 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 ...
1
vote
2answers
52 views
How to strip directory structure with command line (or script)
I have a large collection of files packed into a two-level directory structure with many, many, many folders.
In other words, I have a folder with a great many subfolders in it. There are no ...
2
votes
3answers
121 views
What has happened to the file when I entered “mv file.txt ../”?
I wanted to move 'file.txt' one folder up, but instead of mv file.txt ../file.txt I entered mv file.txt ../.
Now the file is gone and I didn't get any error message. So it seems the some action was ...
2
votes
1answer
54 views
Why is the output of find sorted in Cygwin but not in Solaris?
I wonder why find does not behave in the same way in Solaris as in Cygwin or Linux.
I have a bunch of directories that have files called CS##########. Each # is a digits but there are always 10 ...
1
vote
1answer
31 views
Error writing /home/alessiomtx/.config/tint2/tint2rc: Not a directory
I need to edit my ~/.config/tint2/tint2rc because the file is blank and so I don't have tint2 shown in my desktop, but when I try to save I have this error:
[ Errore durante la scrittura di ...
0
votes
2answers
90 views
increasing a logical volume
I need to increase the logical volume of the var directory, the maximum size of var right now is 10GB, I need to make it 50GB. I have a Centos 6 server.
The output of df -h is:
Filesystem ...
1
vote
1answer
94 views
How do I manually modify an inode?
I am using Ubuntu Linux and, just for fun, I want to create a hardlink to a directory (as seen here). Because I'm just doing this for fun, I'm not looking for any sort of pre-developed ...
1
vote
1answer
47 views
mark or color empty directories for `ls`
ls's -F flag allows to see the types of file and distinguish directories. Is there a way to add a functionality to distinguish an empty directory?
5
votes
3answers
255 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 ...
2
votes
4answers
124 views
Find directories that do not contain subdirectories
I'm writing script is ksh. Need to find all directory names directly under the current directory which contain only files, not subdirectories.
I know that I could use ls -alR and recursively parse ...
0
votes
1answer
129 views
how are directories implemented in UNIX filesystem?
This question is extension to How are directories implemented in Unix filesystems?
I'm aiming to implement basic filesystem: After reading inode number and name we come to know Name of file and hence ...
0
votes
1answer
54 views
Rsync adding a “?” at the beginning of directories
I currently have many of these commands running in a .sh file that looks like this:
rsync -avz -e ssh --rsh='ssh -p1337' --bwlimit=10000 root@DestinationIP:/home/backup /home/localbackup
rsync -avz ...
3
votes
2answers
132 views
Why do . and .. have a file size of 4 kB and 12 kB, respectively? [duplicate]
As displayed by ls -al, for example:
drwxr-xr-x 9 jb jb 4.0K Mar 8 18:05 ./
drwx------ 49 jb jb 12K Mar 17 14:15 ../
I assume this is the minimum amount of space required to store the inode's ...
2
votes
1answer
107 views
“Recently used” directories and files in bash
In Firefox under Ubuntu, when I try to save some webpages to my local computer by Ctrl+S, there will be a window popping out for me to select the destination, where I can choose "Recently Used" ...
4
votes
1answer
74 views
Using '@' for a directory name
Though Unix/Linux will technically allow any character in file and directory names, using punctuation is almost always fraught with peril due to the extensive use the O/S makes of punctuation for ...
4
votes
4answers
105 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 ...
2
votes
5answers
103 views
move a directory with a single character (back quote) as its name [duplicate]
How can I move a directory whose name is just a space?
ls -lah
drwx------ 4 user1 user1 8.0K Mar 13 14:16 .
drwxr-xr-x 3 root root 60 Mar 13 13:48 ..
drwx------ 18 user1 user1 4.0K Mar 13 11:18 ...
4
votes
3answers
130 views
Determining number of files in a directory without counting them
Related: What's the best way to count the number of files in a directory?
I have a system with a largish number of files in a directory
$ ls -god xml
drwxrwsrwx 7 7070720 Mar 12 11:51 xml
...
1
vote
1answer
65 views
Create a recursive diff directory. Copy reference and diff. Recreate original directory
I have several directories/web site resources, each has total size of several gigabytes. They are more than 90% the same. Sometimes only a few files are modified.
I need to download these files for ...
2
votes
2answers
29 views
PATH work with relative directories
I'm trying to get a program to work that isn't in my distro's package manager. It doesn't provide a makefile or sources, just binaries. If I copy the whole folder to /usr/local and then add that to ...
4
votes
1answer
73 views
Can I access Nautilus's bookmarks in terminal?
I have made a some bookmarks in Nautilus, i.e. shortcut links to some directories.
I would like to cd to a directory which has been bookmarked in Nautilus. I was wondering if that is possible?
...
1
vote
1answer
30 views
Can one move a relpath in one command?
This question is similar to one I asked recently, but the answers to that question, for the most part, do not extend to this one, AFAICT. The main difference between the two questions is that the ...
5
votes
3answers
87 views
Filtering redundant paths from a list of paths
I have a list of relative paths such as this:
dir1
dir2
dir2/dir3
dir2/file1
dir3/file2
dir3/dir4
dir3/dir4/file3
In the example above, the specifier dir2/file1 (for example) is redundant, because ...
1
vote
2answers
101 views
Can one copy a relpath in one command?
I find myself doing this often enough that I wonder if there's a standard Unix way to do it:
% mkdir -p /TARGETDIR/relative/path/to
% cp ./relative/path/to/somefile /TARGETDIR/relative/path/to
In ...
0
votes
2answers
95 views
Remove soft link but not the target
I have a directory that contains a link to another directory that I just created. I would like to remove the link but preserve the directory my link was pointing to. How do I do this?
> mkdir rgac
...
4
votes
8answers
210 views
Run a command on all subfolders
If you have a series of subfolders (like from a to z) and want to run a command on each one of them (like rm *.pdf or ls *.pdf), how do you do that? The "manual" approach would be cd a, rm *.pdf, or ...

