A file system structure in which to store computer files.

learn more… | top users | synonyms

15
votes
1answer
27k views

Create a symbolic link relative to the current directory

I'm trying to create a symbolic link in my home directory that points to a directory on my external HDD. It works fine when I specify it like this: cd ~ ln -s /run/media/name/exhdd/Data/ Data ...
3
votes
1answer
819 views

How to download all html files from a URL's directory with wget?

I'd like to use wget to download a tutorial in a website, but this tutorial is in a specific directory. Suppose the URL is the tutorial main page http://www.abc.com/aaa/bbb/ccc/index.html. But the ...
2
votes
2answers
46 views

Average number of subdirs

I have a directory which contains a number of subdirs. Each of these subdirs again contains a number of subdirs (call them subsubdirs). Now I would like to count the average number of subsubdirs in ...
0
votes
2answers
60 views

chowning each home user to itself recursively

Okay so I have about 100 directories in my home folder each owned by the home user itself. Sometimes I have to manually replace some files as root so the permissions are disturbed and some files are ...
1
vote
3answers
62 views

Rename directory from within directory?

How would I rename a directory from within that directory? For example: ~/tmp $ rn tmp2 ~/tmp2 $ I can do that with: cd .. && mv tmp tmp2 && cd tmp2, but not sure how to make it ...
0
votes
1answer
477 views

Find and remove sub-directories without error?

I need to find a way to remove sub-directories from within a particular directory without receiving an error if no sub-directories exist. This command will successfully remove sub-directories if they ...
1
vote
2answers
1k views

Cheapest way to find the oldest file (recursively) from a directory under heavy load

What is the least expensive way to find the oldest file in a directory, including all directories underneath. Assume directory is backed by SAN and under heavy load. There is concern that "ls" could ...
2
votes
3answers
264 views

Safer way for granting permissions for self user?

I know sometimes we can do chmod 777 so we have a directory at our complete reach for accessing, reading and writing. But usually I prefer to do a sudo chown {myusername} {directory}. Obviously, the ...
3
votes
3answers
230 views

Quick access to work directory of background job

Minimal effort to reproduce what I am looking for, is as follows /$ sleep 1h & [1] 6564 /$ cd ~$ jobs [1]+ Running sleep 1h & (wd: /) When I use jobs to manage my ...
1
vote
2answers
57 views

Copying Files in a Folder To Individual Folders

This might sound like something quite odd but for my HTPC, I need to rearrange how my files are stored such that each of the individual files in a folder needs to be moved to a subdirectory of its own ...
1
vote
3answers
414 views

rsync only subdirectories and content

I have a directory that contains a number of files and subdirectories. See below: baseDir bad1 bad2 subDir1 file1 subDir2 file1 I would like to rsync the contents of baseDir without ...
3
votes
2answers
167 views

Refer to an item in `dirs`

I use pushd to work with multiple directories in bash and zsh. I've aliased dirs to dirs -v so that I get an ordered list when I want to see what's on the directory stack: chb$ dirs 0 ...
4
votes
1answer
142 views

Customised vimrc for subfolders and projects

I use vim in many different contexts ... actually, probably most people do: There is the editing of configuration files, programming, documenting, email and so forth. I very frequently found myself ...
2
votes
1answer
47 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
76 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 ...
3
votes
2answers
2k 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 ...
4
votes
2answers
248 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
737 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?
6
votes
5answers
811 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
87 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 ...
2
votes
2answers
4k 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
639 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
116 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
105 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
2k 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 ...
3
votes
5answers
3k 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
306 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
582 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
726 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
5k 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
2k 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
1k 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
77 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
139 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
3k 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 ...
4
votes
1answer
2k 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
251 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
179 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
185 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
90 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
72 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
2k 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
563 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
118 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?
6
votes
3answers
5k 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
3answers
886 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
262 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
73 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
432 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 ...
3
votes
1answer
989 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" ...