Tag Info

New answers tagged

1

The $HOME environment variable is commonly set and exported by login to the pathname of a user's home directory when a user logs in. A POSIX-compatible shell will use the value of this environment variable in a context when it should perform a ~ tilde expansion to complete a path to a username's home directory but the actual expanded field is otherwise null. ...


1

In shell, user's home directory is located in /home/username, ~ is shortcut for home directory of the current user using the shell, ~usr is shortcut for home directory of user with username usr, so ~usr is the same as /home/usr. If your username is usr, then ~ and ~usr are the same. The home directory of current user is also saved in variable $HOME.


6

Whatever you're saying about ~$, home$, and /home$ doesn't make much sense.  I guess you're talking about your command line prompt; if so, it would have been useful to show what you typed and what happened (and then explained what you expected). But I can read minds, so I believe that I understand the issue: ~ and ~user239887 (assuming user239887 is your ...


2

The latest best practice is not to embed the user config file under a hidden user directory unless there will be more than one user specific file for the application. Thus, you should use only ~/.fooconfig (or ~/.foorc) for the user resource file for foo. If foo has multiple user files, then it's ~/.foo/config for the configuration file along with any ...


2

/bin is probably a symlink to /usr/bin on your system. If that were true then: /bin/../sfw/bin/zsh would actually be the same as /usr/bin/../sfw/bin/zsh which reduces to /usr/sfw/bin/zsh which is where zsh actually lives. Note that what you tried, which was /bin/sfw/bin does not correspond to any path that you actually could see on the system. ...


2

How about that: find / -type d -name "softaculous_backups" -exec du -sm {} \; | sort -n For every found directory, du -sm is executed. After that all output is sorted numerically.


0

While directory acception is unambiguous when talking about file systems, file system might mean different things depending on what you are talking about. In your examples, all the listed paths are directories but only some of them are also mount points of file systems. You can use the df command to known on what file system a given file or directory is, ...


2

The way I see it, a filesystem, in the UNIX sense, is a way of implementing a directory tree (directory structure), or more precisely, a way of implementing the UNIX filesystem API. The root file system is backed by one particular implementation, and whenever you enter a mountpoint directory, you enter a subtree that's backed by something different. The ...


1

First a correction to your assumption about a filesystem and a directory. A filesystem contains one or more directories. Using your examples, /proc, / and /bin are directories. They are not "filesystems" in and of themselves, but they might be the root of their respective filesystems. If you want to identify which directories are also the mount point (root) ...


4

At the risk of grossly oversimplifying, A filesystem is like your car's engine and other internal systems, A directory structure is like a map of the places where you drive. Since I’ve been asked for an encore, Filesystems are like the mechanics (implementation details) of audio/video signal distribution/propagation: analog RF broadcast, digital RF ...


5

People don't use "file system" too carefully. In your examples, I would say that /, /bin and /proc are file systems because an entire partition (like /dev/sdb1) is mounted on those directories. My Arch linux system doesn't have /bin as a file system so this example isn't perfect but... % ls -lid /proc /home /boot / 2 drwxr-xr-x 17 root root 4096 Feb 24 ...


1

One of the other answers came close to this: find . -type d -exec sh -c 'cd "$0" && cmd' {} \; (running the command only if the cd succeeds).  Some people recommend inserting a dummy argument, so the found directory ({}) slides over to $1: find . -type d -exec sh -c 'cd "$1" && cmd' foo {} ";" Of course, you can use any string here in place of foo.  ...


5

The find command is powerful, but that makes it a little challenging to use. I'm pretty sure it can do what you need - this command below is "almost" what you ask for: find . -type d -execdir pwd \; But - this does not run the command in the deepest directory level - it runs in the directories in which other directories are found. So it wil run in ...


6

Solution Using Parallel You could use GNU Parallel for a compact, faster solution. find . -type d -print0 | parallel -0 cd {}'&&' <command-name> This will work absolutely fine, even for directory names containing spaces and newlines. What parallel does here is that it takes the output from find, which is every directory and then feeds it to ...


0

You can use something like this find /home/test/ -type d -exec bash -c '<Command to be executed>' \; Example: The below command will display the dirname, similar to running a pwd command. find /home/test/ -type d -exec bash -c 'echo $0' \;


0

You don't need to run extra pwd command you can run the following command: find test/ -type d You can replace your directory with test/


2

To confirm I follow you, there's the following items at play: An installation script (for the various tools in the tarball) A tarball with various tools packaged inside it (as shell scripts, some of which may not work with the parent OS) I'll assume you are admin on the machine you are uploading to. I think the right thing to do would be to put the ...



Top 50 recent answers are included