What is the diffrernce between cd ./dirname vs cd dirname? [closed] - unix

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
cd ./dirname and cd dirname both seem to take me to immediate subdirectory.
Is there any underlying difference apart form the syntax?

The former will work for directories with (a certain set of) "strange" names.
cd ./-P
cd ./~

There is no practical difference.
It is simply two alternate notations of a path. And since the cd command accepts a path as a runtime argument you can use both notations. But it does not make a difference in that situation.
This does make a difference in other situations. For example when trying to execute a file the ./ prefix forces the shell to look for the executable in the current directory, not in the environment PATH.

The command cd ./dirname explicitly say you want to go to the dirname directory in the current folder

Related

Can I get emplacement of `sources.list` in cmd on a Modified UNIX? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
i would like to know how can I get the path to sources.list on a modified UNIX which have apt and other base packages on it , like gpg and sudo. Does apt can identify the path to sources.list ?
He is using it , so he should be able to locate it, right ?
I don't know if this is the best way, but apt-config dump will show all of apt's configuration variables. On my system, the Dir::Etc variable gives the directory where the file is located, and Dir::Etc::sourcelist gives its name.
You can also read in the apt-config man page about the shell option which may be more useful for processing this data in a program.

How can I search ~/Library with the command find on my mac? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I want to find all the files a piece of software has left in my system.
In the terminal I type:
$ find /Users -name software -print
And every time find tries to look into a folder within the Library directory, Terminal returns "operation not permitted".
So I tried:
$ sudo find /Users -name software -print
Same result
So I finally enabled super user, logged in with command su, entered my command: same result.
1 - I do not understand why even the super user is not allowed to search the library.
2 - what is the work around?
Thanks for your help
I have found the answer.
Terminal needs to be added in the System Preferences/Security and Privacy/ full disk access!

why I am not getting results from my uncompressing? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I am using a Dragonfly BSD system and I need to uncompress a folder for configuration purpose. I could not find results, the compressed file was still there without the uncompressed folder I should find. To test if the problem was something more specific I tried the same tar -xf but later also adding v (verbose) option with an ordinary text file but what I found was the tar showing me the uncompressed file when on the verbose, meanwhile I couldn't find it (by ls command) neither open it.
You specified tar -xvf ntest.tar /jeff/ but none of the file names starts with / — you should specify tar -xvf ntest.tar jeff/ to get the files extracted.
Incidentally, 'useful' only has one ell.

What is the difference between the Ubuntu ~ directory and / directory? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm new to Ubuntu and trying to understand the differences between these two directories. I need to know where node packages, git projects, and dotfiles can be installed to avoid future problems. Does anybody have a quick layman's answer?
I navigate to each directory in the following ways:
cd ~
or
cd /
Under which of these directories should I install my dotfiles?
Under which of these directories should I install my git projects?
I'm using Git Bash but I can't locate the directory on my machine for git checkouts.
See official documentation for the Ubuntu directory tree. It provides a basic explanation of the hierarchy and purpose of each directory.
cd / is taking you to your "top" or root level directory.
cd ~ is taking you to your current user home directory within /home/ (ex: /home/username).
Typically, you'll want to place your dotfiles in your user home directory (~/). If you look at some of the projects in the link you provided, they suggest this as well.
As for your git projects, those can go wherever you see fit. I prefer to place them within ~/ but it is really a matter of preference.

How to rsync files with --files-from with quantifier? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I want to move from one server to another and I won´t lost special logfiles (like mail.logs), so want to rsync the files with the --files-from option. But I can´t use a quantifier like * or {0..9} in the file list.
rsync -avR --files-from=/backup/filelists/filelist1.txt / $DESTSRV:"$DESTPATH"
for example I want to rsync all mail server log files
/var/log/mail.log
/var/log/mail.log.1
/var/log/mail.log.2.gz
/var/log/mail.log.3.gz
/var/log/mail.log.4.gz
But in the /backup/filelists/filelist1.txt I can´t use
/var/log/mail*
or
/var/log/mail.log.{2..10}.gz
I got the following error
rsync: link_stat "/var/log/mail*" failed: No such file or directory (2)
Anybody knows a solution for my problem?
After searching and trying I found another solution that fits to me:
cat /backup/fileslists/filelist1.txt | { while read line; do rsync -avzR $line "$DESTSRV":"$DESTPATH"/; done; }
This code reads the input file line by line and sync it with rsync. In this case I could use any quantifier :).

Resources