What is the point of "cd ." command in Linux? [closed] - linux

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 5 years ago.
Improve this question
I just began to learn to use Linux but I am just curious what would be the purpose of this command as it really doesn't do anything from what I have learned.

The point of the cd . command is to not create special cases merely because they are pointless.
The cd command is useful. Having a relative path that always means "the current directory" is useful. This means that the cd . command is possible.
At this point there are two options. Either create a special case disallowing it, or accept that freedom to cd anywhere also means the freedom to cd to where you already are, and accept it as harmless.
Unix, wisely, chose the later.

Related

IS there any way to find what commands we have run in linux apart from history [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
IS there any way to find what commands we have run in linux server apart from history command
is there any log file where i can see what are commands i have run
unfortunately my ~/.bash_history is clear
On linux distributions and installations I encountered: no, it's not possible. Even .bash_history is storing only bash history (and some administrators can (and will) use other shell(s)) and has usually set a limit so sometimes gets truncated. You would have to write and configure such utility yourself.

Where do we have to put a linux command? [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 3 years ago.
Improve this question
I just coded a script in bash on Ubuntu but I don't know where I should put it...
I read I had to put it in /usr/bin in a tutorial but maybe it's better directly in /bin ?
This is the difference between both directories:
/bin
It contains commands that can be used by both the system administrator and the users, but which are necessary when other file systems are not mounted (for example, in single user mode). It can also contain commands that scripts use indirectly
/usr/bin/
This is the main directory of executable commands in the system.
Therefore, it will work on both, but you must establish what responsibility your script has.

Typing "cd.." in Linux terminal instead of "cd .." [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 come from MS-DOS background, where it is permitted to type cd.. (without the space between cd and ..) instead of cd ... The Linux terminal, however, finds cd.. objectionable.
Is there a way to make Linux terminal understand cd.. to mean cd ..?
I'm using Ubuntu.
And I am well aware that this is a rather silly problem, but I have cd.. committed to muscle memory (since early childhood, my brain has been wired that way) and I've been making that mistake at least twenty times every day, for several years now, ever since I started using Linux on a regular basis.
You could create an alias:
alias cd..="cd .."
If you add this to some file that's loaded whenever you log in (e.g., .bashrc if you're using bash), you'd get the effect of having this alias permanently available.

How to add alternative to program that located in /usr/bin [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 6 years ago.
Improve this question
Is it possible to substitute binary with same name alternative? I have /usr/bin/qtcreator
I want to use alternative version but /usr/bin/qtcreator is binary but not alternative.
What the way I should do this?
You could place your new qtcreator at /usr/local/bin/qtcreator, that location should have preference over /usr/bin.
You can check the possible locations for binaries and the order is which they are searched with echo $PATH and you can check which binary will be called with which qtcreator
In Bash:
$ alias qtcreator="/usr/local/bin/qtcreator"
or make sure the path to desired binary is mentioned before the undesired path in $PATH (... as mentioned by others).

linux - adding a user [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 6 years ago.
Improve this question
I have this code but it is not compiling correctly. I want to create a user with a default shell of bin/sh with the group adults. Any suggestions?
Command: useradd -s /bin/sh –g adults michael
Thank you.
First of all the code given is not being compiled, but rather executed by a shell. Then your command is perfectly fine, given that the adults group already exists before you type the command into your shell.
So without error, or more context, nobody will be able to tell you more than what I'm telling you:
there's no issue with your command.

Resources