A file system structure in which to store computer files.

learn more… | top users | synonyms

3
votes
3answers
107 views

Bulk remove a large directory on a ZFS without traversing it recursively

I want to remove a directory that has large amounts of data on it. This is my backup array, which is a ZFS filesystem, linear span, single pool. The data is in this pool called san, mounted on /san ...
3
votes
2answers
10k views

Create target directory when extracting tarball

Is it possible to create a target directory, similar to mkdir -p, where I can define a non-existent target directory within my tar command, and tar will create the directory for me? I know I can ...
3
votes
1answer
148 views

Exit bash when find gets to a folder with permission denied

I'm trying to write my second Bash script. Where i go through folders recursively and make a list of and count files and folders. In a way it works but if "find" gets to a directory where it has ...
8
votes
3answers
34k views

How can I delete all files with a particular extension in a particular folder?

If I set the current/working directory (navigating to it using cd) to some particular directory and then type: rm *.xvg What will this command do? Is it true that the above command will only ...
6
votes
4answers
13k views

How to recursively list all hidden files and directories?

I want to list all hidden files and directories and then save result to file. Is there any command for this?
1
vote
3answers
192 views

How to identify if a direcory is created by System or a root user?

How to identify if a directory is created by Linux system and by user like root. Example: in /etc there is a directory named sys which is created by Linux. And I logged in using root and created the ...
4
votes
3answers
559 views

Find files in directory with paired names

I'm running tests of a variable-size-and-contents test set. Data files are added and removed frequently. I'm looking for an automated way of gathering a file list. All files are in subdirectories of ...
5
votes
3answers
83 views

List all directories that do NOT have a file with a given file name inside

How would I go into listing all directories that do not have a file with a given file name inside? e.g. given this tree / /a README file001 file002 /b README file001 /c ...
5
votes
3answers
14k views

“cannot remove 'some_directory': Directory not empty”

I tried to delete some directory, but $ rm DE.aspx_files -r rm: cannot remove `DE.aspx_files': Directory not empty But listing its content returns none $ ls DE.aspx_files $ Added: Actually $ ...
12
votes
4answers
46k views

How can I list subdirectories recursively?

The obvious ls -dR does not work. I am currently using find /path/ -type d -ls but the output is not what I need (plain listing of sub-folders) Is there a way out?
0
votes
0answers
22 views

xfs directory quota doesn't work

now I have two tasks and I wanna run them in different directory and limit the directory's size. I use xfs's project quota to achieve this. I follow the steps from ...
0
votes
0answers
4 views

“[unixODBC][Driver Manager]Data source name not found, and no default driver specified” When using Teradata ODBC Drivers

I am running a PHP script on a RedHat server using Teradatas ODBC drivers. <?php $conn = odbc_connect("Teradata", "username", "password"); $result = odbc_exec($conn, 'SELECT count(*) FROM ...
4
votes
3answers
11k 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 ...
4
votes
3answers
70 views

How to remove space in all sub directories in shell script?

I tried following shell script to remove all spaces with underscores: find $1 -depth -name "* *" -print0 | \ while read -d $'\0' f; do mv -v "$f" "${f// /_}"; done If I have a directory ...
6
votes
5answers
2k views

Transform a directory into file or a file into directory

I wanted to create a file named test. Accidentally I run mkdir test instead of touch test. Is it possible to convert test directory in a file named test? What about converting a file named test into ...
5
votes
1answer
39 views

Why is mtime and ctime changing for a directory when a file is modified?

I am learning about atime, ctime, mtime with regards to files and directories. It seems to me that if I modify a file within a directory, I haven't changed the "directory file" itself in its idode or ...
4
votes
2answers
67 views

Preventing the creation of a specific directory

I'd like to cover the basis on a vulnerability which tries to download itself and save the result in a newly created directory inside the /tmp/ directory. To be on the safe side, I wish to make it ...
1
vote
1answer
22 views

List folders greater than 10G and mail to respective owners about the usage

In our environment, we have an NFS mount which contains all users home directories. I want to find the users who's home directories sizes are greater than 10G and need to send a notification to them. ...
15
votes
3answers
783 views

Can I make a public directory under a private directory?

I have a personal folder /a/b on the server with permission 700. I don't want others to list the contents in /a/b. The owner of /a is root. Now I need to open the full authorities of directory /a/b/c ...
1
vote
1answer
55 views

directory permissions [closed]

I'm currently working on a PHP server explorer, and I have to determine if a directory is empty or not readable because of insufficient permission. My web application is running under the user ...
1
vote
0answers
16 views

Using rsync with the verbose option and filtering the information displayed

I am using rsync with the -a -r and -v options to copy files and directories from one server to another. This all works fine. But when I make a change, for example, to a single file on the source ...
31
votes
7answers
23k views

Merging folders with mv?

If I move a folder with mv called "folder" to a directory that already contains "folder" will they merge or will it be replaced?
2
votes
1answer
25 views

Directory traversal cache eviction despite having plenty of memory?

I have a huge Mercurial repository (take a guess how many directories it has -- it's gonna be more than you guessed). The time taken to do basic repository operations is heavily dependent on whether ...
2
votes
1answer
268 views

How to do ls with a wildcard and see the directory name

I have a directory called selenium_IDE if I do ls sel* I get to see directories that are in it, e.g. $ ls sel* HAPPY HAPPY_PLUS_OPTIONS SAD SAD_PLUS_OPTIONS but ...
1
vote
1answer
1k views

Trouble installing lxml with custom install location for libxml2/libxslt

I am attempting to install a python module called lxml to my account on a supercomputer running RHEL. I do NOT have root access or super user status. lxml requires the dev/devel versions of libxml2 ...
46
votes
6answers
12k views

The result of ls * , ls ** and ls ***

I know using the command ls will list all the directories. But what does the ls * command do ? I used it and it just lists the directories. Is the star in front of ls means how deep it can list the ...
10
votes
4answers
3k 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 ...
0
votes
0answers
12 views

What permissions apply if specific user's permission on file or directory differ from user's group to which this user belong to in Linux? [duplicate]

Case 1: User has "rwx" permissions to certain file or directory. But has no permissions "---" in group it belongs to. Question: who wins - Does user have "rwx" or "---", effectively (not what's ...
0
votes
5answers
93 views

List only the count of all files/directories for the directory tree of present directory

I want to list the number of directories under each subdirectory tree of the present directory. As there are too many directories, I can't go into individual directory and check. Something like the ...
1
vote
2answers
27 views

Find and move directory to a new directory based on name [duplicate]

I would like to move all the folders contained in the folder "/example" named e.g. "*_jony" to a new directory call "/jony". I have try several way without success! It would be great to have some ...
2
votes
1answer
39 views

Output file generated by tar

tar can be used to gather a whole directory into a single file. I tried with the sample directory sampledir containing just some text files, with no subdirectories. Originally the directory occupies ...
-1
votes
1answer
11k views

enable apache mod rewrites to load clean-urls [closed]

In CentOS, a2enmod rewrite results in “command not found” but httpd -M lists rewrite module as listed and shared. I'm trying to enable it so can then have these rewrite rule apply so I can switch back ...
43
votes
10answers
66k views

How do I loop through only directories in bash?

I have a folder with some directories and some files (some are hidden, beginning with dot). for d in *; do echo $d done will loop through all files, but I want to loop only through directories. ...
1
vote
1answer
21 views

What happens to my files if I scp-ed to non existing directory

Here's what I did: copied some files from server to my local computer scp root@remotemachine:/var/log/nginx/* /home/me/logs deleted the files on the server The next moment I realized, that I ...
0
votes
1answer
57 views

usr/bin appears empty

I'm trying to make a program (Thunderbird) run at startup, but when I go to usr/bin it seems empty. However, if I run $ which Thunderbird in terminal, it tells me /usr/bin/thunderbird. The usr/bin ...
4
votes
2answers
47 views

Can I store and work with a directory in compressed form?

I have to work with many large sized directories which are shipped around in the form of tarballs. However, in order to really do any operations these tarballs have to be untarred into directories and ...
32
votes
8answers
11k views

How to delete this undeletable directory?

I untarred a corrupt tar file, and managed to end up with some directory that I can not delete, If I try to delete it, it seems like it can not be found, but ls shows it's present, both with bash and ...
1
vote
3answers
55 views

script for copying directories with particular increment

I have directories which are named as 0.1, 0.15,0.2, 0.25, 0.3,0.35 and so on. Now I want to copy directories at particular increments say of 0.1 together to a separate directory. Say directories ...
16
votes
3answers
999 views

Simple way to see the content of directories in Linux/UNIX file systems

In the past, I learned that in Linux/UNIX file systems, directories are just files, which contain the filenames and inode numbers of the files inside the directory. Is there a simple way to see the ...
0
votes
2answers
31 views

update-alternatives returns error about Java directory not available

I've been trying this tutorial: How To Manually Install Oracle Java on a Debian to install Java on Debian 8, but I'm getting the following error : update-alternatives: error: alternative path ...
0
votes
4answers
62 views

Copying Only Directories With Files

I am trying to copy files and the directory it is in to another location. I can find the path like this: find ~/dim_import/* -type f ! -name xdir | cut -d '/' -f 5-10 which outputs ...
1
vote
1answer
69 views

Listing directories and understanding ls

On ls man page, I saw this -d, --directory list directory entries instead of contents, and do not dereference symbolic links on my current folder: drwxr-xr-x 2 oracle oinstall 4.0K Jul ...
0
votes
4answers
86 views

given a file, find where within a subdirectory it was copied to

Given a file that I know has been copied into a given directory, I want to find the exact path where the file copy now resides. It is guaranteed the file has not been edited and will look exactly like ...
2
votes
1answer
48 views

What is a non-contiguous directory?

When I run fsck, I can see the following line: 182 non-contiguous directories (0.1%) What kind of directories are the non-contiguous ones? Is there a way to make them to be contiguous somehow. How ...
2
votes
0answers
29 views

How do I vmtouch a directory (not the files it contains)?

The vmtouch(8) tool allows locking a file or files in memory. It has recursive mode, but the directories are used just for discovering files and are not locked themselves. How do I lock a directory ...
0
votes
0answers
17 views

New files in a mounted directory are being created with a different user and removing write permission for other users

I am running a python script that outputs files into a mounted directory on a different computer. The script can be run multiple times in a way that overwrites the contents of created files. However, ...
4
votes
2answers
94 views

sudo rm -rf returns “cannot remove directory” on empty directory owned by root

I have a directory on my Debian system. The directory is: root@debian:/3/20150626# stat 00 File: `00' Size: 6 Blocks: 0 IO Block: 4096 directory Device: fe00h/65024d Inode: ...
43
votes
5answers
26k views

Difference between /bin and /usr/bin

I read this up on this website and it doesn't make sense. http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/basic/node32.html When UNIX was first written, /bin and /usr/bin physically resided ...
0
votes
1answer
30 views

Command to delete directories whose contents are less than a given size

I'm working in a directory ~/foo which has subdirectories ~/foo/alpha ~/foo/beta ~/foo/epsilon ~/foo/gamma I would like to issue a command that checks the total size under each "level 1" ...
4
votes
1answer
155 views

Making the current directory as if it were where an absolute path starts

I'm wondering if there is an application that makes it so that commands after it operate in an environment that treats the working directory as if it were the top-most one, and there is absolutely no ...