- Newest
- Most votes
- Most comments
Hello,
Please try this solution.
Step 1 Check File Permissions:
ls -l file1 file2
This command will show you the permissions of the files.
Step 2 Change Ownership and Permissions:
If the files are not owned by your user or don't have the right permissions, change them.
sudo chown yourusername:yourusername file1 file2
sudo chmod 644 file1 file2
Step 3Combine the Files Using sudo:
Use sudo correctly to ensure you have the necessary permissions.
sudo bash -c 'cat file1 file2 > combinedfile'
Two things come up to my mind. File Ownership and immutable attributes.
Even if you’re the administrator, if the files are owned by another user, you might not have the necessary permissions to manipulate them. You can check the ownership of the files using the ls -l command.
However, the files might have an immutable attribute set. When a file has the immutable attribute, it can’t be modified, deleted, renamed, or linked to, even by the root user. You can check for this attribute using the lsattr command.
