4

Looking at man findmnt I see a number of suggestions that seem to do what you want when finding the mount point for a filesystem: findmnt --first-only --noheadings --output TARGET --target "$PWD" /home Or with less readability: findmnt -fno TARGET -T "$PWD" /home


4

Did it look like this? " ============================================================================ " Netrw Directory Listing (netrw v156) " /home/Goldname/myDirectory " Sorted by name " Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\ " Quick Help: <F1>:help -:go ...


2

You get those "No such file or directory" errors from find because find is trying to enter directories that it has just removed. It will by default apply its actions to all matching things in the directory that it's currently visiting before continuing into the subdirectories. Add -depth to the invocation of find to circumvent this. This would cause find ...


2

cryptsetup can be used; MOUNT_NAME=example cryptsetup luksOpen /path/to/file "$MOUNT_NAME" mount "/dev/mapper/$MOUNT_NAME" /path/to/mount encfs encrypts per file disadvantage: attackers know your file sizes, layout, modification time etc. advantage: no need to grow or shrink your container cryptsetup encrypts per mount point disadvantage: one needs to ...


2

If you just want to find it for yourself, not for later use in a variable. you won't find a shorter way than df .: $ df . Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda6 343650580 232263752 93860660 72% /home That has extra details, of course, so can't be used to just save the device name to a variable directly. However, it's ...


2

If you didn't specify a / at the beginning of a path (absolute path), it becomes a relative path. As such, it is relative to the current directory on which you are. So for instance, when downloading a file, if you specify as destination home/anon/foo/bar.txt and you are in /tmp, the file is not downloaded as /home/anon/foo/bar.txt (in you homedir) but is ...


2

Since you only want to remove files from the /CT directory itself, this could be done without any reference to sudo. Initially you need to set the group ownership and permissions as root: chgrp wheel /CT chmod g+rwx /CT Now users in the wheel group have permission to (create and) delete any files in this directory without using sudo: rm -f /CT/unwanted....


1

You can ask your system to list files that have recently been created/modified. For example, in the last 24 hours (one full day) find / -type f -mtime -1 Or in the last 60 minutes (GNU extension; not standard) find / -type f -mmin -60 More details either here on https://unix.stackexchange.com or with man find.


1

Use cut -d "/" -f1-4 ebvjr@Maintenance:~$ echo /home/test/var/opt | cut -d "/" -f1-4 /home/test/var


1

These lines should work: find "/path/to/cleantarget" -maxdepth 1 -mindepth 1 -type d | while read line; do find "${line}" -mindepth 2 -type f -exec mv -t "${line}" -i '{}' + rm -r "${line}"/*/ done This will flatten Folder A and Folder B, asking if you want to overwrite duplicates, and remove the folders afterwards. Source: https://unix....


1

You don't delete files, you remove their entry from a directory. You need directory write permission to do this. (this permission exists in your example). You may want to look at the sticky bit. Apply it to the directory i.e. chmod +t …/logs/d. This will make it so that only the owner (and user with capability CAP_DAC_OVERRIDE e.g. root) can remove a file ...


1

The ro group has full permissions to that directory which means that any of its members can delete or modify files or directories inside whether they own them or not and regardless of the file permissions. If you only want the group members to be able to read the files inside, either change the group to john or remove write permissions for the group. Do one ...


1

find . -type d -maxdepth 1 will have . in its output (the current directory), since it is a directory, and it has a depth less than 1. So you'll be running find on . again via xargs, which is how you get the extra output. You probably want -mindepth 1 as well for the first command: $ find . -maxdepth 1 -mindepth 1 -type d | xargs -I{} find {} -type d -...


1

What presumably happens is that, with the -exec ... \; construct, find does its work step by step: walk the directory tree, finding entries that match -type d, and run rmdir on such entries as soon as they are found. This means that, in your example, find will look at dir01, keep it in mind as a directory to enter later, then run rmdir on it, and then, ...


1

The files pointed to by [ CA_defaults ] are used internally by the openssl ca command. If you look inside the new_certs_dir you would see all certificates signed by the CA when using the openssl ca command, with filenames consisting of the certificate serial number with .pem appended. As you're using openssl req those files aren't used. The man page for ...


Only top voted, non community-wiki answers of a minimum length are eligible