7
votes
5answers
4k views

How to get the actual directory size (out of du)?

How do I get the actual directory size, using UNIX/Linux standard tools? Alternative question: How do I get du to show me the actual directory size? Since people seem to have different definitions ...
0
votes
1answer
37 views

Directory links in Unix?

Is there a way to create a link in unix that actually go to where the target is? $ cd ~/foo-link $ pwd /some/other/directory/foo Or something similar. What I'm trying to solve is that there are ...
0
votes
1answer
34 views

Concurrent request to create directories

What happens if there are 2 concurrent requests to create a directory in file system (what are the differences concerning this problem between knonw FSs?)? Will one request success and another fail ...
3
votes
1answer
205 views

UNIX make directory that appears to have contents of other directories

If I have 2 directories, a and b can anyone suggest a convenient method of creating a directory that appears to have the contents of both a and b without copying the files ? At the moment what I have ...
-1
votes
2answers
51 views

How to search a tree folder

How can I do a search of all directories calles i18n under trees like src/main/resources using find or any other unix command. Everything I'm trying doesn't work I'm looking for something like: ...
0
votes
1answer
33 views

Deleting Folders with same name in unix HP_UX

I accidently created a folder which has the same name of a folder which was already existing in the same parent directory. i want to delete the newly created directory. is ther a way to identify the ...
3
votes
2answers
130 views

Accidentally blocked myself out of my private UNIX directory

I used the following command to see who had permission to my directory. fs la I then wanted to block someone out, so I used the command (and accidentally used my username instead of the person I ...
2
votes
1answer
687 views

Is it possible to remove the root directory?

I noticed in the documentation for rm as obtained by rm --help the following flag: --no-preserve-root do not treat `/' specially What does this mean? Is it actually possible to delete the root ...
2
votes
2answers
951 views

How can I remove other user's sub-directory from my directory? [duplicate]

I have a directory in my home-directory, which I share with a UNIX-group, but now want to delete. If there is a file owned by an other user in this directory, I can remove it with rm, because the ...
0
votes
1answer
99 views

What permissions does a directory need so that anyone can cd into it but nobody but root can ls in it?

I have seen this before in some directories. Where if you know the name of a file you can open it and edit it, but you cannot ls in the directory so if you don't know the name of the file you can't ...
3
votes
5answers
9k views

How to find over 1GB folders and execute another command in linux terminal?

I want to find the folders which sizes are over 1GB and then if they are over then i want to erase them. I found some commands like find /some/path -type d -size +1G -exec ls {} \; or du -h ...
2
votes
1answer
324 views

Directory of dereferenced symbolic link?

In shell script, how can I dereference a symbolic link and get the directory of the file it links to?
0
votes
1answer
243 views

Exclude all hidden directories in UNIX find

I'm doing a word search using the following command: find . -exec grep -q [some_word] '{}' \; -print -o -name .svn -prune -o -name .ssh -prune -o -name .boneyard -o -name log -prune -prune -o -name ...
1
vote
2answers
536 views

How do I copy only subdirectories but exclude other files in Linux?

Here is my directory structure: /home/folders/test (some directories) and files test.xml test1.xml test.js images (directory) /home/folders/test/images/( some directories ) and files I have to ...
1
vote
1answer
222 views

Giving directory access to only certain users?

I currently have the following directory: drwxrwsr-x 4 user1 Group1 4.0K Apr 18 18:29 foo Under Group1 there are 20 users. I want to give user2 and user3 who belong to Group1 access to directory ...
8
votes
1answer
14k views

How do I find the size of a directory on a Unix-like command-line?

I know this is a very basic question, but I searched the web and did not find a simple answer. I'm sure it's some kind of two or three letter command, right?
1
vote
1answer
470 views

What does directory permission 02777 do?

Found the following PHP code today: mkdir($directory, 02777); chmod($directory, 02777); I understand the PHP, but not first part of those numbers. The 777 part is clear, and if I have understood ...
0
votes
5answers
3k views

How to run programs from a different directory in unix

I know this is a very simple question, and that many similar (but more complicated!) questions have been asked- So i wanted to ask this in a very plane manner. Sorry if this voids the rules of conduct ...
0
votes
3answers
860 views

Can't seem to change directory - “No such file or directory” error using PuTTY

I am required to use PuTTY to submit a program but I have never used it before and am having a hard time changing my directory. I am successfully connected to a Linux computer from my own but can't ...
2
votes
1answer
350 views

When are Unix directory permissions enforced

Say I have a directory that only root can access: $ sudo -s $ mkdir ~/rootonly $ chmod 000 ~/rootonly Inside that directory is one with global-everything permissions: $ cd ~/rootonly $ mkdir ...
2
votes
3answers
460 views

Unix Directory Hierarchy Permissions

Suppose I have a directory with no access for anyone except for root. Am I guaranteed that everything in the directory is inaccessible to everyone but root? In other words, are file permissions ...
0
votes
1answer
544 views

UNIX: Find all directories that match string and copy a file there

I was wondering how to file all directories that match a string and then if found, copy a file from root to that directory.
10
votes
4answers
9k views

.tar files without directory structure

I'm .taring some files with the path example/super_user/Output.*. The resulting .tar looks like this: + example + super_user - Output.zip - Output.xml - Output.txt ...
8
votes
2answers
2k views

Unix: Slash after directory names or not

What is the difference between the following commands? mv foo bar mv foo/ bar/ mv foo/ bar mv foo bar/ Or is there no difference? Or does it depend on the command being used? Think for example I ...
5
votes
3answers
4k views

List all unique extensions for files contained in a directory

I would like to see all the unique extension of files contained in a certain directory. What is the command to do that in bash? One could use find . -type f to get all the files in the current ...
7
votes
3answers
62k views

How to change file permissions for a directory in one command

How can I change all the file permissions of a directory in one command in Unix?
0
votes
1answer
434 views

When attempting to open any file with WinSCP, it attempts to list it as a directory

We had a security breach and some things were messed up on our Ubuntu servers. Now, when I log in to two of our servers using WinSCP and I double-click on a file to open it with my default ...
19
votes
2answers
30k views

How do I gunzip to a different destination directory?

How do I gunzip to a destination directory other than the current one? This did not work: gunzip *.gz /putthemhere/
4
votes
3answers
179 views

Why does this bash command take up all space on device?

I'm a little new on searching via bash, so feel free to give me suggestions on the methods to use instead of this, which I'll never use again :) I'm searching for occurances of a string, recursively ...
3
votes
8answers
370 views

Why not ~/dls instead of ~/Downloads?

Most folder names in the *nix world are lower case. It makes them easier to type in my opinion. However, everything in my home-dir is capitalized! Why is this? Is it possible to change them? The ...
3
votes
3answers
2k views

What is the intended purpose of top-level linux/unix directories and what should they contain? [duplicate]

Possible Duplicate: Linux file system As the title says, what is the intended purpose of top-level linux/unix directories and what should they contain? What is the meaning of their names? ...