What's the meaning of every part of a bash prompt? [closed] - bash

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 very new to mac world, and i'm using bash doing some work.
But I'm not clear about the bash command line. It's so different from cmd.
yb_server:~ Aaron$
above is the command line when i start a terminal.
what's the meaning of yb_server?( I used to remember it's originally macintosh, why
it's changing to yb_server, how can i recover?)
what does ~ mean?
what does $ mean?

yb_server is your computer.
: is an arbitrary delimiter.
~ is your home directory (the current directory).
Aaron is you.
$ is "Speak to me, master!" But it is effectively an arbitrary delimiter.
The whole thing is your prompt. Google "bash prompt" for lots of info. Its format is totally up to you. Say echo $PS1 to find out what the format is now. The default is:
\h:\W \u\$
Learning what those symbols mean is left as an exercise for the reader!

Related

Terminal: Hashcat charset - no matches found [closed]

Closed. This question is not about programming or software development. 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 days ago.
Improve this question
I'm trying to run hashcat to crack a zip file using the brute force method and I want to specify the character set using the below code in Mac M1 terminal: (where hcat.txt contains the hash of the zip file)
hashcat -a 3 -m 17225 --force hcat.txt ?l?l?l?l?l?l
But I got the below error.
zsh: no matches found: ?l?l?l?l?l?l
Simply enclose the pattern in single quotes, such as '?l?l?l?l?l'
This is because zsh is attempting to interpret '?' as a glob expansion parameter, which means any single character such as '.' in regex.

How to add semicolon at the end of a line using pattern from that line [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 am trying to find a way to add semicolon at the end of all lines that contain the word "transient" in them using sed.
This file is an hql that contains create statements of all tables in a database.
In order to run this hql on other cluster via beeline, I need to make some edits to this HQL before running it.
Input:
'transient_lastDdltime'='123456')
Expected output:
'transient_lastDdltime'='123456');
It will be really helpful if i can get a suggestion using sed or awk (not vim) please.
$ sed '/transient/s/$/;/' file

what is ls -F (ls --classify) [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
Looking at the man pages for plain old ls I see there's a flag for -F
-F, --classify
append indicator (one of */=>#|) to entries
I've used it a few times, but all I see it adds a slash / to folders which is the same as ls -p
What does this mean for the others *=>#|?
I'm running Ubuntu 14.04 with GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Each of the symbols is for a specific type of file. If you haven't seen them, it's probably because you don't have any files of that type. The man page for ls should say what each of them means. But, in case you can't read yours for some reason, here's what mine says:
-F Display a slash (`/') immediately after each pathname that is a
directory, an asterisk (`*') after each that is executable, an at
sign (`#') after each symbolic link, a percent sign (`%') after
each whiteout, an equal sign (`=') after each socket, and a
vertical bar (`|') after each that is a FIFO.
Mine seems to use some characters yours doesn't and not use some that yours does. So, to resolve the others you need to read the man page that refers to your version.

Bash: tab completion selects by later part of file/directory name (like zsh)? [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
Suppose I have these directories:
CSCI100
CSCI200
CSCI300
CSCI400
If I do
cd C<TAB>
it completes up to
cd CSCI
and then I must type a number to proceed.
Is there a way to do
cd 200<TAB>
which then alters the full command to
cd CSCI200
?
Bash's readline command "menu-complete" enables this behavior. You can either have this replace the Tab key's usual behavior (with the command bind "Tab: menu-complete", or by putting "Tab: menu-complete" in your .inputrc file), or choose a different keyboard shortcut for this function.
EDIT: Sorry, I misunderstood the question; it's about completing a suffix rather than a prefix of a filename. You can sort of do this with the default settings in bash if you use a wildcard and there's only one match for the pattern:
cd *200<TAB>
expands to:
cd CSCI200
If there's more than one match, it'll list matches if you TAB again. Binding TAB to menu-complete will make it cycle through matches instead. I don't know of any way to do this in bash without explicitly giving a wildcard to tell it where to do the expansion.

Identifying and adapting unix-"isms" to the Windows command prompt [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
In the Python Pyramid tutorial, I encountered this phrase:
"Windows users will need to adapt the Unix-isms below to match their environment."
It appears to relate to the "Export" command, but I am not entirely sure. The question therefore, is how do others go about this process of identifying and adapting "Unix-isms"? My only method so far is to see what isn't recognized, and obviously that could be due to different reasons.
Regarding research, I may have found a paywalled explanation for export specifically, but I'm sure there are better resources for adapting these commands.
Thank you!
The $ symbol is a Unix prompt
The ; is a command separator
export sets sets an environment variable, similar to setx
PATH=/path/to/tutorial_workspace/venv/bin:$PATH is modifying the PATH environment variable, similar to PATH=/path/to/tutorial_workspace/venv/bin;%PATH%
which searches the PATH for a program and returns its location.

Resources