Hot answers tagged

4

This mysql> is not a directory. It is the mysql database prompt, where you can execute mysql commands. You can exit this CLI by typing "quit".


3

awk -F / '{ print $4; }' will give you the second entry in the path. It's the fourth when parsed: the first is the empty string before the first /, the second is the empty string between the two /, and third is depot.


2

You can use bind mount to simulate hard linking directories sudo mount --bind /some/existing_real_contents /else/dummy_but_existing_directory sudo umount /else/dummy_but_existing_directory


2

You probably meant dirs_to_check="$(echo "$changed_files" | xargs dirname | sort -u)" A simple solution, unless you have thousands of directories, is simply to try to rmdir each directory and ignore the errors. find . -depth -type d -exec echo rmdir --ignore-fail-on-non-empty {} + Change . to the top of the directories concerned. If your rmdir doesnt ...


2

find "$DIR_TO_CLEAN" -type d -empty -delete -print Can remove -print to not get list of deleted directories. Edit: If you do not want to remove the "$DIR_TO_CLEAN" directory itself, add -mindepth: find "$DIR_TO_CLEAN" -mindepth 1 -type d -empty -delete -print


2

The new folder is not created until you actually provide a name, normally by typing something in what looks like a directory/folder name in the currently open directory/folder in the manager. Once you enter that name and press return the actual call to mkdir() is executed (not the mkdir commandline command). And if you directly press Enter you often get some ...


2

You can usefully add the -i option to rsync to make it show you why it wants to copy the file again. For example, you might see .f...po.... somefilename which means the remote file has different permissions and owner. One solution is to use --size-only to only compare the sizes of files, but obviously this might cause some changed files not to be sent. ...


1

Given a path to the file ./some/where/thatcertainfile, stripping off the final /thatcertainfile gives you a path to the directory. Launch a shell to be able to use string manipulation on the path. find . -name thatcertainfile -exec sh -c 'rm -r "${0%/*}"' {} \; Alternatively, use zsh. To transform a path into the name of the containing directory, use the ...


1

You can hash every file recursively and then hash the resulting text: > md5deep -r -l . | sort | md5sum d43417958e47758c6405b5098f151074 *- md5deep is required.


1

Yes, you can do the trick using Btrfs subvolumes. First you need to convert ext4 to btrfs as described here. Convert your chroot to subvilume if it is not yet: sudo mv /path/to/chroot /path/to/chroot-tmp sudo btrfs subvol create /path/to/chroot sudo mv /path/to/chroot-tmp/* /path/to/chroot sudo mv /path/to/chroot-tmp/* /path/to/chroot -r # for ...


1

If you are using gnu tar there is an extensive manual here that discusses the --anchored option, and how glob patterns for exclude and include differ. You can try: tar c dir? --anchored --exclude=dira | tar t


1

This is nothing to do with ls and everything do with the way numbers are output from awk. The man page for awk shows that the default numeric output format is .6g, which means a double length floating point number will be output with 6 digits of precision, using either the exponent format (that you see) or a decimal. You can change this to an explicit ...


1

The simple typeset -U dirstack fails, as dirstack is doubtless too special for the usual unique limitation to apply (this typeset is however handy for things like the path array). On closer inspection the Arch Wiki code suffers from incomplete uniqueness, in that only dirstack only when being written out is made unique, and not with PWD, nor when reading the ...


1

With sed assuming you have the lines in file input.txt: sed 's|.*depot/\([^/]*\)/.*|\1|' input.txt


1

I'll assume that you are talking about building/compiling C/C++ software on Ubuntu. This isn't clear from your question. On a modern Linux distribution with a package management system (which includes virtually all the major distributions), you should always use the package management system to install software whenever possible. In a Linux distribution ...



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