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 am just getting started with Linux, could someone please explain these commands? (ls), (ls -l), (whoami), (pwd), (cal 2013) and (man cal). Thanks.
The only command you have to know, is "man". Type "man ls", and you'll get an answer about what "ls" does, and so on.
man is the very first command a Unix/Linux beginner needs to know. It means manual and gives access to the reference manual (or online help) of the command specified on the same line:
man cal
displays the manual of the cal command.
From there, you can type
man intro
to get a list with a short summary of all available commands.
Sometimes, instead of the manual of the command you requested, you'll get the manual of bash, which is the program that interprets all the commands you type. This means that your requested command is not a simple command like cal but a special command directly implemented in the bash itself. In that case, the description of your requested command is buried in the huge manual of bash.
Related
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
New kali linux terminal starts with a bash error:
bash: ‘export: command not found
I think I messed up my bash environment when workin on a jsnode installation and do not know how to fix it.
I think I need to fix my environment variable, but do not know where that is in Kali. Appreciate any help.
There seems to be a typo in a command. It should be export but instead it's ‘export. The errant character is Unicode U+2018, LEFT SINGLE QUOTATION MARK.
The first place to look is your .bashrc, then depending on your OS, .profile or .bash_profile, then any number of other Bash startup scripts that might get called like .bash_functions, or higher up the chain like /etc/bash.bashrc.
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
When I added !! in the end of echo command, it gave some output but I am unable to understand the output of the command. What does !! actually do in Linux?
!! Refer to the previous command. This is a synonym for `!-1'
Assuming your example is something like this:
echo hello!!
The answer depends on what shell you are using. Assuming bash merely because this is what I usually use:
From bash man page:
!! Refer to the previous command. This is a synonym for `!-1'.
This means that the command above will print hello followed by the previous command line from shell command history.
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 just start to learn Linux command, here comes a question: how do I find information about the system call 'open', rather than the executable program while using "man" command.
System calls are on normally found in man section 2
man -s 2 open
you can specify the section of the manual where you want the manpage to come from. By default system commands (section 1) come first, before system calls (section 2) or library routines (section 3), so
man 2 open
will do the work. Normally, when you see a reference to a man page you'll see a number in parenthesis attached to it (like open(2)) That number indicates the manual section you will find that thing in.
You can even test
man man
and you'll get a very good reference to how the online manual works.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
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.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Improve this question
Have you ever used a command in the Terminal, but then later forgot what you typed, and wished there was some way that you could view the last used commands?
There are many ways to search through your command history. Here are 3:
use the up and down arrows on your keyboard when at the command prompt.
use the history command.
Simply press : Control + R when at the command prompt.
E.g : Control + R , then write php
I often use bash-builtin command "history" to search for a certain command, e.g. to get the last sudo command type:
history | grep sudo | tail -n 1
gives the last command (with number) with sudo in it. "tail -n 1" gives the last matched line. Then use
!<number>
to execute exactely this command.
!-1
executes the last command, by the way. works well in bash.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
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.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
Your system has 2 versions of the same utility installed, both which have the same filename.
How would you find out where the utility you would run by default is located?
If the utility's file name is "foo", type which foo
You'are looking for which command
which - shows the full path of (shell) commands.
Let's say you have perl installed in /usr/bin/perl and /usr/local/bin/perl and if the default path is the second one then
$ which perl
/usr/bin/local/perl
Check the $PATH.
echo $PATH
The first is started default.
or
which
Similar to which , whence gives you whence command from Korn Shell tells how a name would be interpreted by the shell: it detects commands and aliases, and searches your path.
whence {executable-you-are-looking-for}
and also in linux, just typing name & hitting tab will show list of available versions with which you can run.