linux
prompts

settings
[!NOTE|label:inputrc]
PS4
[!NOTE|label:references:]
show timestamp
show process id
colors
Bash tips: Colors and formatting (ANSI/VT100 Control sequences)

bash ps1 or ps1 with conditions

bash ps1 in conditional
functions
right prompt

bash ps1 right-prompt
character
<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:
chapter 23. process substitution Command list enclosed within parentheses
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
via curl
or
or
or
example: merge lines of file
additional usage
or
/dev/fd/63is not a regular file
basic commands
du
dutop 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
you have new mailor
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
useful functions
search manual page
whatis -r <string>apropos -r <string>
Last updated
Was this helpful?