A file system structure in which to store computer files.

learn more… | top users | synonyms

1
vote
1answer
522 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 ...
1
vote
1answer
26 views

ls -lh vs du -sh * for file sizes within a directory

This might be a simple question to ask but I guess I am little confused in terms of 2 commands so I need help In a particular directory I have some files. If I want to check the size of the files, I ...
1
vote
2answers
133 views

How to change dir to the last directory?

I have very long directories list, like /dir/dir/dir/../../../../../../../../../.. ../../ ../../last dir Is it possible to change to the last dir immediately?
12
votes
3answers
321 views

Finding the correct tmp dir on multiple platforms

I have a script that needs to create temporary files for its work, and clean up after itself. My question is about finding the right base directory for the temporary files. The script needs to work ...
0
votes
2answers
336 views

Create a directory if it doesn't exist in TCL

I write expect script that login to remote machine and run there some scripts But I need also to verify the following Verify if directory /var/cti/adm/APP exists. If APP not exists under adm ...
10
votes
6answers
42k 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 ...
7
votes
5answers
20k views

Using sftp to Transfer a Directory?

When I try to use sftp to transfer a directory containing files, I get an error message: skipping non-regular file directory_name The directory contains a couple of files and two subdirectories. ...
-1
votes
2answers
30 views

Cannot access a directory with permissions drw-rw-r— [duplicate]

I am having a very strange permission issue when trying to access any of the files in a certain directory as a specific user (adventho). This has been working fine for several months and I just ...
1
vote
2answers
19 views

May cp override subdirectories with the same name?

I downloaded an Adobe flash plugin, It includes a .so file and a directory called usr. In this folder, it has sub-folders like bin, lib, lib64, share. In the readme file, it says I need to do the ...
2
votes
1answer
44 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 ...
30
votes
5answers
20k views

How to XZ a directory with TAR using maximum compression?

So I need to compress a directory with max compression. How can I do it with xz? I mean I will need tar too because I can't compress a directory with only xz. Is there a oneliner to produce e.g. ...
2
votes
2answers
55 views

I accidentally moved a directory to '..'. Where did it go?

I accidently left a trailing slash on my directory name when renaming a folder in Linux, mv /images/images/ .. Now the folder has vanished, But I know it's still there due to the space it's using, ...
6
votes
2answers
135 views

Folder with ONLY write permission is useless… right?

Having worked with Linux for years, and finding myself with some free time, I decided to revisit some basics. So I re-read the stuff about permissions (without checking source code), and its special ...
15
votes
7answers
6k 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
2answers
67 views

How to create an alias to the directories and copy one file to another?

I want to copy a file from /home/e_empid/file1 to /home/e_empid /dir1/dir2/dir3/Backupfile1. User does not want to write a long command each time. Write a command to set an alias for above action? I ...
8
votes
2answers
364 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 ...
38
votes
6answers
6k 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 ...
0
votes
1answer
7k views

enable apache mod rewrites to load clean-urls

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 ...
2
votes
1answer
40 views

find command sometimes results in non-matching files being zipped

I'm trying to make a zip file of all the files in a specific directory which were modified in the last x minutes. Here's my command: find "/path/to/dir" -mmin -30 -not -name ".*" -exec zip -r ...
1
vote
1answer
62 views

Copy directory with SCP

I'm trying to copy directory from local drive to remote server with -r parameter, however I'm getting: scp: System error: 1633648 (Failed to retrieve error string (err:317)) This is the syntax I ...
0
votes
3answers
64 views

Export file names of a directory to csv

I have a question regarding exporting folder names to a csv file. I have read already many entries in the web to such topics but on nearly all the topic was about exporting filenames and size and ...
2
votes
3answers
826 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?
1
vote
0answers
81 views

xdg user dirs: not relocating although set?

I relocated my home directories using XDG user dirs as mentioned here: how to make gnome use my home folder as Desktop folder? However, this does not work for me so far. I have set the Downloads ...
3
votes
1answer
30 views

Cache directory and file list to prevent hard drive access when browsing contents

I have 7 hard drives that are in a virtual pool (mhddfs) so they appear as one directory. I put them to sleep after 5 minutes of inactivity to save a significant chunk of power. The problem with this ...
70
votes
6answers
19k views

Why hard links not allowed to directories in UNIX/Linux

I read in text books that UNIX/Linux doesn't allows hard links to directories but soft links do. Is it because, when we have cycles and if we create hardlinks, and after some time we delete the ...
3
votes
4answers
440 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 ...
10
votes
4answers
5k views

symbolic link to a directory and relative path

I've created symlink with absolute path to the directory (Blink) and have for example following tree: $ ls -l /tmp/A total 0 lrwxrwxrwx 1 root root 6 Apr 3 12:27 Blink -> /tmp/B -rw-r--r-- 1 root ...
3
votes
1answer
86 views

The history of ../

I was wondering if there's a known reason behind the use of .. to represent the parent of the current directory in most operating systems. The reason I ask this question is because I think that the ...
1
vote
2answers
51 views

How to find number of Subdirectories under a given directory

In windows you get a count of the number of subdirectories within a directory.Is there any equivalent on Linux ? I'd like it to count recursively & Not stop at a single level.
5
votes
3answers
57 views

Is there an easy way to change directories from within one duplicate folder structure to another?

On our server, we have several duplicate-ish folder structures for testing, staging, and production. Other than minor changes, the folder structure between all three are generally the same. When I'm ...
0
votes
0answers
30 views

inotifywait to monitor shared directory on laravel homestead

I need to watch a directory that is shared on a network for new files. I used inotifywait from inotify-tools and it is great except when the file is added from the other place. For example: I am ...
3
votes
1answer
71 views

how to make gnome use my home folder as Desktop folder?

Environment: Debian 7, gnome-shell. I dislike having a Desktop folder and a Home folder. I like all the applications to use my home folder. Specifically I am concerned about nautilus and ...
2
votes
2answers
46 views

ls doesn't give me the same as cd + ls to the same folder

$> ls ../../../../.. Doesn't give me the same result as $> cd ../../../../.. $> ls Why? Something with links? What's going on? [ johanrj@jamin ] ...
0
votes
0answers
35 views

Failed to list directory contents: process waits infinitely

I use Linux Mint 13, and sometimes (rarely) I find myself not being able to list my home directory contents. When I try to do so: $ cd $ ls then, ls just waits indefinitely. The same with any other ...
0
votes
2answers
29 views

Tool for visual directory comparison

This question is not about visual diff -- i.e. file comparison. Is there a tool which let me compare directory A and B (recursively), and as the output I would get two panes, with lists -- files in A ...
0
votes
4answers
41 views

number of folders in a directory (recursive)

I would like to find the number of folders (recursive, excluding hidden folders) in a given root directory. What command, or series of commands can I use to ascertain this information?
3
votes
1answer
47 views

How to update directory size after file removal?

This is mostly theorethical question without real practical usage. As you may know, filenames are stored in directory inode. That means the more files we have and the longer filenames are the more ...
1
vote
1answer
30 views

du -sh on a new directory gives different results in different locations

Here's what happened when I created a new directory and immediately ran du on it. There are no contents in this directory. me@mybox[~]$ mkdir /scratch/test2 me@mybox[~]$ du -sh /scratch/test2 4.0K ...
9
votes
1answer
666 views

What is the difference between 'ls' and 'ls -l' when I don't have execute permission on that directory?

I created a directory called folder and took away execute permission. $ mkdir folder $ touch folder/innerFile $ mkdir folder/innerFolder $ chmod -x folder Now if I do $ ls folder it outputs a ...
2
votes
1answer
32 views

Problem with install command to copy a whole directory

So I have a repo with some of my config files and I'm trying to create a makefile to install them in the homedir. The problem I have is that when I run the following command straight in bash install ...
0
votes
1answer
43 views

Extracting tar.gz from distance

I would like to extract a single file from a tar.gz file, but its in another folder than I am currently in. Is it possible to extract from "distance"?
1
vote
1answer
42 views

Adding files to .tar from directory

Is there a way to add files to .tar file in one directory from an another directory? And at the same time list the content of the tar to see if its added. I only found ways to add files if its in the ...
2
votes
2answers
79 views

What filesystem mount point am I currently working on?

I would like to know in what filesystem mount point I am currently on, similarly to using pwd to know what directory I am in. I know you can use df . (or df $(pwd) or many variants), but I find it ...
0
votes
1answer
96 views

Why the size of an empty directory in Linux is 4KB? [duplicate]

I'm using Ubuntu 14.04 and I made an empty directory on /tmp with the mkdir command: cd /tmp mkdir foo and then I checked it's size using ls: ls -ldh foo and the result shows that the size of ...
1
vote
1answer
34 views

Help understanding and using Symlinks

I have a bit of a situation with a virtual server running some RHEL distro. The server is hosted on a Win2008 server via VMPlayer ( I'm going to smack the guy who set this up.) When it was created ...
1
vote
1answer
145 views

How to output the directory structure to Json format [duplicate]

I have been using 'find' to output the directory structure from the root down and I don’t mind that it takes a while. My problem is that I want to cut down on the redundant info of repeating every ...
5
votes
1answer
67 views

How do folder name localizations work?

In Mac OS X, there are directories like Desktop, Users and Library. On localized systems, these would be named Skrivbord, Användare and Bibliotek (Swedish) But when I am in the terminal I can't ...
73
votes
1answer
87k views

How to set default file permissions for all folders/files in a directory?

I want to set a folder such that anything created within it (directories, files) inherit default permissions and group. Lets call the group "media". And also, the folders/files created within the ...
0
votes
1answer
48 views

Linux: Recovering a deleted dir that another terminal is still cd'ed into

I accidentally deleted the dir, /path/to/dir, and all its contents from an application. However, I still have a terminal window open, still cd-ed in /path/to/dir! Q: Is there any way to recursively ...
0
votes
1answer
43 views

Executable directory? And chmod o+w changing the terminal directory color?

What does an executable directory mean? If o+w is set the directory changes colors to a background green, what does this mean? Why doesn't it do it for ug+w, but only for o+w? Additional question ...