linux

prompts

bash prompts with change-mode and cursorshape

settings

[!NOTE|label:inputrc]

PS4

[!NOTE|label:references:]

  • show timestamp

  • show process id

colors

functions

  • right prompt

    bash ps1 right-prompt

character

Character
Where
Meaning

<RETURN>

csh, sh

Execute command

#

csh, sh, ASCII files

Start a comment

<SPACE>

csh, sh

Argument separator

`

csh, sh

Command substitution

"

csh, sh

Weak Quotes

'

csh, sh

Strong Quotes

\

csh, sh

Single Character Quote

variable

sh, csh

Variable

variable

csh, sh

Same as variable

\

csh, sh

Pipe character

^

sh

Pipe Character

&

csh, sh

Run program in background

?

csh, sh

Match one character

*

csh, sh

Match any number of characters

;

csh, sh

Command separator

;;

sh

End of Case statement

~

csh

Home Directory

~user

csh

User's Home Directory

!

csh

History of Commands

-

Programs

Start of optional argument

$#

csh, sh

Number of arguments to script

$*

csh, sh

Arguments to script

$@

sh

Original arguments to script

$-

sh

Flags passed to shell

$?

sh

Status of previous command

$$

sh

Process identification number

$!

sh

PID of last background job

&&

sh

Short-circuit AND

||

sh

Short-circuit OR

.

csh, sh

Typ. filename extension

.

sh

Source a file and execute as command

:

sh

Nothing command

:

sh

Separates Values in environment variables

:

csh

Variable modifier

Character

Where

Meaning

[ ]

csh, sh

Match range of characters

[ ]

sh

Test

%job

csh

Identifies job Number

(cmd;cmd)

csh. sh

Runs cmd;cmd as a sub-shell

{ }

csh

In-line expansions

{cmd;cmd }

sh

Like (cmd;cmd ) without a subshell

>ofile

csh, sh

Standard output

>>ofile

csh, sh

Append to standard output

<ifile

csh, sh

Standard Input

<<word

csh, sh

Read until word, substitute variables

<<\word

csh, sh

Read until word, no substitution

<<-word

sh

Read until word, ignoring TABS

>>!file

csh

Append to file, ignore error if not there

>!file

csh

Output to new file, ignore error if not there

>&file

csh

Send standard & error output to file

<&digit

sh

Switch Standard Input to file

<&-

sh

Close Standard Input

>&digit

sh

Switch Standard Output to file

>&-

sh

Close Standard Output

digit1<&digit2

sh

Connect digit2 to digit1

digit<&-

sh

Close file digit

digit2>&digit1

sh

Connect digit2 to digit1

digit>&-

sh

Close file digit

[!TIP] Process substitution is a form of redirection where the input or output of a process (some sequence of commands) appear as a temporary file. reference:

Process substitution uses /dev/fd/<n> files to send the results of the process(es) within parentheses to another process. [1]

named pipe similar

get diff in two folders

example: merge lines of file

inspired by here and here

  • additional usage

    or

  • /dev/fd/63 is not a regular file

basic commands

du

  • top biggest directories under [path]

  • display the largest files according to human-readable format

  • display the largest folders/files including the sub-directories

  • biggest file sizes

sort

others

you have new mail

crontab

[!NOTE|label:references:]

  • format

  • tips

    • every odd hours

    • every even hours

  • sample

    • delete .DS_

    • flush disk cache

    • flush DNS

  • localtion

    • macos

    • freebsd/openbsd/netbsd

    • centos/rhel/fedora/scientific/rocky/alma linux

    • debian/ubuntu/mint linux

    • p-ux unix

    • ibm aix unix

tricky

unicode

references:

Your description is vague. Either your terminal does not support Unicode, or you're editing a file that's in latin1 (= iso-8859-1). On a bash or zsh shell, with LC_CTYPE=en_US.UTF-8, run echo $'\xc3a9'. If you see é, your terminal supports UTF-8. If you see é, your terminal is showing latin1.

useful functions

search manual page

  • whatis -r <string>

  • apropos -r <string>

Last updated

Was this helpful?