How to Exclude a Folder When Performing File Operations I.E. Cp, Mv, Rm and Chown etc. in Linux

How do I exclude a folder when performing file operations i.e. cp, mv, rm and chown etc. in Linux

If you're using bash and enable extglob via shopt -s extglob then you can use !(<pattern>) to exclude the given pattern.

How to exclude files from chown recursive using wildcard in file name?

chown -R does not perform any interpretation of what you pass in. Any attempts to use things like !(...) are interpreted by the shell. If you want to support fancy logic in your recursion, use something like find:

find /home ! -name 'ssl.cert.*' -exec chown user:apache '{}' \;

Moving file to another folder after performing search and replace operation on it

You could try this:

find . -type f -exec perl -api -e 's/\b(?!00)[A-Z0-9]{6,}/dummy/g' {} \; -exec mv {} /to/this/directory \;

After the first -exec predicate completes successfully, find will run the next -exec. This answer to a related question will give you a bit more information.

MOSS 2007 SSL error when configuring Search Settings

I guess you find this exception in the index server, right?

Are you able to browse to 'https://mushni-sptwb04q:56738/Shared%20Services%20Portal/Search/SearchAdmin.asmx' from the index server?

It seems like SSL is not properly provisioned on the front-end servers. This might solve your issue:

  1. Remove the SSL certificate of the front-end servers
  2. Remove the index server from the farm
  3. Move the search and index roles to one of the front-ends
  4. Join the index server back to the farm
  5. Add the index/search roles to the index server
  6. Apply the SSL certificate (you can generate them using SelfSSL) to both front-ends

No such file or directory but it exists

This error can mean that ./arm-mingw32ce-g++ doesn't exist (but it does), or that it exists and is a dynamically linked executable recognized by the kernel but whose dynamic loader is not available. You can see what dynamic loader is required by running ldd /arm-mingw32ce-g++; anything marked not found is the dynamic loader or a library that you need to install.

If you're trying to run a 32-bit binary on an amd64 installation:

  • Up to Ubuntu 11.04, install the package ia32-libs.
  • On Ubuntu 11.10, install ia32-libs-multiarch.
  • Starting with 12.04, install ia32-libs-multiarch, or select a reasonable set of :i386 packages in addition to the :amd64 packages.

Cannot use mkdir in home directory: permission denied (Linux Lubuntu)

As @kirbyfan64sos notes in a comment, /home is NOT your home directory (a.k.a. home folder):

The fact that /home is an absolute, literal path that has no user-specific component provides a clue.

While /home happens to be the parent directory of all user-specific home directories on Linux-based systems, you shouldn't even rely on that, given that this differs across platforms: for instance, the equivalent directory on macOS is /Users.

What all Unix platforms DO have in common are the following ways to navigate to / refer to your home directory:

  • Using cd with NO argument changes to your home dir., i.e., makes your home dir. the working directory.
    • e.g.: cd # changes to home dir; e.g., '/home/jdoe'
  • Unquoted ~ by itself / unquoted ~/ at the start of a path string represents your home dir. / a path starting at your home dir.; this is referred to as tilde expansion (see man bash)
    • e.g.: echo ~ # outputs, e.g., '/home/jdoe'
  • $HOME - as part of either unquoted or preferably a double-quoted string - refers to your home dir. HOME is a predefined, user-specific environment variable:
    • e.g.: cd "$HOME/tmp" # changes to your personal folder for temp. files

Thus, to create the desired folder, you could use:

mkdir "$HOME/bin"  # same as: mkdir ~/bin

Note that most locations outside your home dir. require superuser (root user) privileges in order to create files or directories - that's why you ran into the Permission denied error.

cp: cannot create directory : No such file or directory

You are getting a permission denied error.

Change the permissions of the addon directory using

sudo chmod -R 755 /home/Workspace/Release/addons/


Related Topics



Leave a reply



Submit