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:
- Remove the SSL certificate of the front-end servers
- Remove the index server from the farm
- Move the search and index roles to one of the front-ends
- Join the index server back to the farm
- Add the index/search roles to the index server
- 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'
- e.g.:
- 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 (seeman bash
)- e.g.:
echo ~ # outputs, e.g., '/home/jdoe'
- e.g.:
$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
- e.g.:
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
How to Make Debian Package Install Dependencies
Linux Perf Reporting Cache Misses for Unexpected Instruction
What Sort Order Does Linux Use
Linux Shell Script for Each File in a Directory Grab the Filename and Execute a Program
Gurus Say That Ld_Library_Path Is Bad - What's the Alternative
What Do the Counters in /Proc/[Pid]/Io Mean
Device Number in Stat Command Output
Linux Command "File" Shows "For Gnu/Linux 2.6.24"
Remove Log Files Using Cron Job
In Order to Write Pci Ethernet Driver. How to Implement Mmap in the Pci Ethernet Driver
What Is a Sysroot Exactly and How to Create One
How to Continue One Thread at a Time When Debugging a Multithreaded Program in Gdb
Execute Shell Commands from Program Running in Wine
How to Add Timestamp While Redirecting Stdout to File in Bash