About 78,800 results
Open links in new tab
  1. makefile - Create directories using make file - Stack Overflow

    Whenever you touch the file, you also touch the directory. And since the file depends on the directory, the file consequently appears to be out of date, forcing it to be rebuilt. However, you can easily break this loop by telling make to ignore the timestamp of the directory. This is done by declaring the directory as an order-only prerequsite:

  2. How to create a link to a directory on linux - Stack Overflow

    Do note that you have to use a full path for this syntax. I wound up having to use ln "$(pwd)/relative_path" xxx in order to get an absolute link for xxx using a relative path.

  3. linux - Creating a new directory in C - Stack Overflow

    May 20, 2014 · Trying mkdir() directly instead of doing a stat() first is faster, as it saves one system call, if the directory is created. If the directory does already exit, then the successful stat() will still be slower than the unsuccessful mkdir(), as stat() has to do more work to complete. –

  4. linux - How to have the cp command create any necessary folders …

    As an aside, when you only need to create a single directory in an existing hierarchy, rsync can do it in one operation. I'm quite a fan of rsync as a much more versatile cp replacement, in fact: rsync -a myfile /foo/bar/ # works if /foo exists but /foo/bar doesn't. bar is created.

  5. One command to create a directory and file inside it linux command

    Aug 1, 2013 · Directory can be nested multiple times. Like I may want to create B/C/D and then "myfile.txt" inside that. I do not also want to repeat the directory part. Following command will create directory at any level. mkdir -p B/C/D and . mkdir -p B/C/D && touch B/C/D/myfile.txt will create the directory and the file.

  6. How to make all files under a directory world readable on linux?

    Oct 29, 2012 · I want to make all files (and directories) under a certain directory world readable without having to chmod each file on its own. it would be great if there is an option to also do this recursively (look under folders and chmod 666 all files under it)

  7. linux - How to create a directory and give permission in single …

    Apr 26, 2011 · mkdir -p -m is broken, since the mode is only applied to the last directory in the path you type. For example, mkdir -p -m 707 one/two/three. Even if all three directories are newly created, only the last one will have the requested permissions, and the others, default. install -d -m is broken the same way.

  8. How to mkdir only if a directory does not already exist?

    Sep 12, 2020 · You raise a valid point thought:: the logic is a bit contradictory, as when this command fails, it can mean two things: 1.) the directory exists or 2.) the directory could not be created. This is not true for the operation itself, therefore a simple post-check on the directory path can give the confirmation, or the next command that operates on.

  9. linux - One command to create and change directory - Stack …

    Dec 13, 2017 · PS it should be a function, not a script (if it was a script, the cd would affect only the [sub-] shell running the script, not the interactive parent shell); it is impossible to make a single command or executable (not a shell function) which would change the directory of the invoking interactive parent shell (because each process has its own ...

  10. linux - How to make an "alias" for a long path? - Stack Overflow

    Jul 31, 2013 · @bashboy, probably because you have no directory with that name. ~/some/path was an example, you should substitute the actual path you want to use. I'll change it to use your example directory so it's clearer. As to how to unassign an alias, you use the unalias command. I've also updated the answer with a transcript, including the use of that ...

Refresh