A file system structure in which to store computer files.

learn more… | top users | synonyms

1
vote
1answer
41 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
136 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?
14
votes
3answers
385 views
+100

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 ...
-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
47 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 ...
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, ...
2
votes
2answers
68 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 ...
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 ...
0
votes
3answers
68 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 ...
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 ...
3
votes
1answer
31 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 ...
1
vote
0answers
83 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 ...
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.
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 ...
0
votes
0answers
33 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 ...
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 ...
3
votes
1answer
72 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 ...
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 ...
2
votes
2answers
48 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
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
672 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
33 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 ...
0
votes
1answer
100 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 ...
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 ...
1
vote
1answer
150 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 ...
0
votes
1answer
49 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
44 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 ...
2
votes
2answers
107 views

Folder alias / Symbolic link to return to back folder

I need to create a folder "2015" which re-routes to ./ but I don't know what the command is. Not sure if the term is called in this case an alias (or symbolic link). So I need to make the same ...
5
votes
1answer
68 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 ...
-4
votes
1answer
27 views

Arrange for files created in a directory to belong to the directory's group

How do I set permissions so that whoever creates any files or directories in /directory, the group owner should automatically be the same group owner of /directory? This is on RHEL.
2
votes
1answer
49 views

When is a symlink treated as the thing it links to, and as a symlink?

When is a symlink treated as the thing it links to, and as a symlink? A symlink can links to a file of different types. For example, let mylk be a symlink which links to a dir. The following two ...
3
votes
1answer
39 views

Check for missing files in two directories and their respective subdirectories

Folder alpha has one subfolder, and files in both root and in subfolder. Folder beta has 25 subfolders with files in them. How would I compare the file contents of alpha and beta, checking for ...
1
vote
0answers
19 views

What means a number of links > 1 for directories? [duplicate]

Both programs stat and ls -l tell about the number of (hard) links to file(s). Going under the assumption that one usually cannot create hardlinks for directories in Linux it confuses me to see ...
0
votes
0answers
58 views

How to create a hardlink to a directory in Solaris?

I started to study the Solaris in my university. Teacher told me to do a hardlink to a directory. And he said that I can not to use mount command. For example: # mount -F lofs /dir1/dir2 ...
2
votes
2answers
46 views

Unzip into directory, independent if directory is contained in ZIP

Let's assume I've a ZIP file whichs content may look like # file: with_out_dir.zip file1.txt file2.cpp file3.js some_sub_dir/ - file_in_subdir.txt file4.xml but it may also look like this # file: ...
1
vote
1answer
45 views

How do I execute a command in each subdirectory? [duplicate]

I'm using Puppet and I need to create symlinks between two folders. I have around 10 folders with the same structure and I always want to execute my link command in xx/yy/zz. Something like this: ln ...
3
votes
1answer
295 views

mv and cp directory hierarchy? [duplicate]

Can I also move or copy directory hierarchy of a file when I mv or cp the file? For example, if I mv or cp dir1/dir2/file elsewhere, it will only mv or cp file. What if I want to also mv or cp ...
0
votes
0answers
29 views

Why are my directories and files created with bashscripts ending with \r? (Script Example) [duplicate]

Okay so I'm really confused but that is cause I know next to nothing about bash scripting. My problem is when I get the script to work it creates directories and files with the \r ending and that ...
0
votes
1answer
60 views

Is possible to change the value of '.' without actually change the current directory? [closed]

Can I make the value of . to be a different directory from the current directory? Background I'm learning Java. In the directory of my program, I have two sub-directories, src and bin. Every time I ...
2
votes
1answer
74 views

How to let a user create a directory although not create a sub directory

I'm trying to create a Bash shell script that allows for the transfer of files from a flash device to a archive in which the user will specify. Although I'd like to restrict this user from not being ...
2
votes
4answers
666 views

“mv: cannot move `.' to `../general/.': Device or resource busy”

$ mv . ../general/ mv: cannot move `.' to `../general/.': Device or resource busy Does it mean that the current directory is a busy device or resource, and can't be moved away? Why is it?
0
votes
2answers
70 views

ls hard link question

I run ls -la on the Volumes directory. It shows the MM dir to have 9 hard links and the Media dir to have 12. If I then cd to the MM directory and run ls -la, it shows only 7 items whereas if I cd to ...
0
votes
4answers
103 views

Is /home a subdirectory of /?

In my Ubuntu 12.04, /home and / are different partitions. But why does /home look like a subdirectory of /? Is it because it is a hard link: Are there five hard links which link to the same dir as ...