New answers tagged

3

What you want is pwd -P. From man pwd on CentOS 6: -L, --logical use PWD from environment, even if it contains symlinks -P, --physical avoid all symlinks Or, from the BSD pwd man page and slightly more helpfully worded: -L Display the logical current working directory. -P Display the physical current working ...


1

From man pwd on my Ubuntu: your shell may have its own version of pwd I use bash. Simple pwd command gives me a path with respect to the symbolic link; yet /bin/pwd returns the actual path. The cd command is also a bash builtin. In other words: this is shell specific. EDIT: thrig's comment (see below) seems to be a better alternative to everything I ...


1

A solution that works for me is to downgrade the ntfs-3g version from the 2014 release to the 2012 release. This should solve your ntfs partition access problem. In the long run this is not a solution because eventually you will need to run the latest release. More info here


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 ...


0

Try this command: rm -rf $(find . -name thatcertainfile -execdir pwd \;) It should say to the rm -rf that what it had to remove is the output of your command. For example, if your command's output was /home/guest/Documents the command I showed would translate on rm -rf /home/guest/Documents.


0

Check the filesystem that hosts your sf_my_share directory. Seem like ls can't stat this directory, may be because of the the filesystem's mount options


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

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

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 ...


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

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 ...


0

If the software you're trying to build uses a decent build system, it should be possible to tell it where to find things it depends on. - That is if it doesn't find it automatically, which it should. - You'll probably need -dev/-devel versions of the packages to get the stuff your software needs to build.


0

Check the permissions of your sf_my_share directory. If you have read but not execute permissions on this directory, then you have enough rights to list the files in that directory, but you can't actually use these files or get more detailed information about them.


0

Using grep: grep -Po 'depot/\K[^/]*'


1

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


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.


1

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


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".


0

I wrote a ZSH plugin which does what you want: https://github.com/tymm/zsh-directory-history In contrast to other solutions my plugin falls back to the global history automatically. That means that you don't have to switch between directory history and global history. However the other solutions are a little more lightweight I guess.


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


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

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 ...



Top 50 recent answers are included