|
In Unix, can I run 'make' in a directory without cd'ing to that directory first?
Answer Snippets (Read the full thread at stackoverflow):
If the reason you don't want....
Here && is used instead of ; to catch error cases where the directory can not be changed.
Which first has its working directory changed (while leaving the working directory of the parent shell alone).
|
|
How can I delete all files and sub directories from current directory including current directory?
Started by Ib33X on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Rm -fr "`pwd`"
Under bash directory starts with a dash (non-bash....
Operating system? on the *NIX-based stuff, you're looking for 'rm -rf directory/'
NOTE: the '-r, otherwise it will fail since you can't remove the current directory.
|
|
I have a directory with lots of files and directories in it. In order to tidy it up, I'm going to put all those files into a directory, so I was going to do something like this:
$ ls | wc -l 123 $ mkdir new_directory $ mv * ./new_directory
However that...
Started by Rory McCann on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at serverfault):
-type f -maxdepth 1 -exec mv {} ./new_directory
This should be 100% portable....
Not directories), then
find .
Mv `ls -A | grep -v new_directory` ./new_directory
If you're just looking for the files (i.e.
A fast and dirty oneliner.
|
Ask your Facebook Friends
|
I've got a directory ( wordpress ) in a folder (the main html directory of my website) and I'd like to "unpack" it into the main html directory. That is to say, I'd like to remove the wordpress directory and have all its subdirectories be under /html/...
Started by Isaac Copper on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
$ rmdir wordpress
Do you need something more complicated?
mv /path/to/html/wordpress/* /path/to/html rmdir /path/to/html/wordpress
Should work
mv /html/wordpress/* /html rmdir wordpress .
$ cd ..
Cd /html/wordpress $ mv * ..
|
|
Is there a way, on Linux, to cause all new files created in a directory to be owned by the directory's group instead of the creating user's group?
Started by singpolyma on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at superuser):
If you 'chmod g+s directory' then all files created in that directory will be owned by that group.
|
|
I typically do:
tar -czvf my_directory.tar my_directory
What if I just want to include everything (including any hidden system files) in my_directory, but not the directory itself? I don't want:
my_directory --- my_file --- my_file --- my_file
I want:...
Started by hal10001 on
, 6 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Cd my_directory tar zcvf ../my_directory.tar.gz *
You can also create archive as usual and extract by *), you need to do
cd my_directory
tar zcvf ../my_directory.tar.gz * .??*
(I don't know what hidden files look like under windows.)
cd....
|
|
I want to be able to get the size of one of the local directories using C#. I'm trying to avoid the following (pseudo like code), although in the worst case scenario I will have to settle for this:
int GetSize(Directory) { int Size = 0; foreach ( File...
Started by ThePower on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
You could hide your() method):
public static IEnumerable<FileInfo> Walk(this DirectoryInfo directory) { foreach the sizeof all files in the current ....
Enumerator-based file/directory listing methods which save on the big arrays.
|
|
I have a FTP directory permission issue. Under the root directory of my FT directory I have 2 sub directory:
DirectoryA DirectoryB I have granted one machine with the read/write permission to DirectoryB . Does this mean that it will also have the same...
Started by Ngu Soon Hui on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at serverfault):
If Directory A and DirectoryB each stem.
They do not jump across to parallel directories.
|
|
What is the difference between
<Directory /var/www/> Options All -Indexes </Directory>
and
<Directory /var/www/*> Options All -Indexes </Directory>
?
The first does not work, the second does work, on my server. And there doesn'...
Started by mattloaf1 on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at serverfault):
Do you have any files in the directory? When you are changing directory are you using the following command?
cd /var/www
If you are typing an extra "/" at the end such as:
cd /var/www....
I just checked and the first one works for me .
Strange.
|
|
What is the most succinct way to create a directory called "Foo" underneath the current working directory of my Java application (if it does not already exist)?
Or, a slightly different angle: What is the Java equivalent of Directory.CreateDirectory("...
Started by Daniel Fortunov on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
(More specifically....
The java.io package does not have a Directory class, but you can use the mkdir() method on the File:
"If a security manager exists and its checkWrite() method does not permit the named directory to be created() will return false.
|