Infinite Loop while true; do echo ok done or while :; do echo ok done or until false; do echo ok done Function Return function positive() { return 0 } …
Devamını Oku..Bash Script Control Structures
Parameter to [ or testDetailsFile OperatorsDetails-e “$file“Returns true if the file exists.-d “$file“ Returns true if the file exists and is a directory-f “$file“ Returns true if the file exists …
Devamını Oku..Bash Script Redirection
ParameterDetailsinternal file descriptorAn integerdirectionOne of >, < or <> Redirecting standard output redirect the standard output (aka STDOUT) of the current command into a file or another descriptor. These examples …
Devamını Oku..Jobs and Processes
Job handling Creating jobs To create an job, just append a single & after the command: $ sleep 10 & [1] 20024 You can also make a running process a …
Devamını Oku..Bash Script Aliasing
Shell aliases are a simple way to create new commands or to wrap existing commands with code of your own. Theysomewhat overlap with shell functions, which are however more versatile …
Devamını Oku..Bash Script Grep
How to search a file for a pattern To find the word foo in the file bar : grep foo ~/Desktop/bar To find all lines that do not contain foo …
Devamını Oku..Using Cat / Cat Kullanımı
Option Description-nPrint line numbers-vShow non-printing characters using ^ and M- notation except LFD and TAB-TShow TAB characters as ^I-EShow linefeed(LF) characters as $-eSame as -vE-bNumber nonempty output lines, overrides -n-Aequivalent …
Devamını Oku..Listing Files / Dosyaları Listeleme
Option Description-a, –allList all entries including ones that start with a dot-A, –almost-allList all entries excluding . and ..-cSort files by change time-d, –directoryList directory entries-h, –human-readableShow sizes in human …
Devamını Oku..Navigating directories / Dizinlerde gezinme
Absolute vs relative directories To change to an absolutely specified directory, use the entire name, starting with a backslash \, thus: cd /home/username/project/abc If you want to change to a …
Devamını Oku..Script Shebang
Env shebang To execute a script file with the bash executable found in the PATH environment variable by using the executableenv, the first line of a script file must indicate …
Devamını Oku..