no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


tech:linux:bash_commands [2015/06/24 11:55] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Advanced bash scripting ======
 +http://www.tldp.org/LDP/abs/html/index.html
 +
 +====== Bash Commands ======
 +
 +===== Finding a size of a file =====
 +<code bash>
 +file_size=$(stat -c%s "$FILENAME")
 +</code>
 +
 +===== Wait for user to strike a key =====
 +<code bash>
 +read -p "Press [Enter] key to start backup..."
 +</code>
 +
 +===== Filename from Filepath =====
 +Extracting File Name with extension and without extension given full file path
 +<code bash>
 +filewithpath=/home/name/path/subpath/etc/abc.txt
 +filename=$(basename $filewithpath)
 +filenoext=${filename%%.*}
 +</code>
 +
 +filename will have abc.txt
 +
 +filenoext will have abc
 +
 +
  

QR Code
QR Code tech:linux:bash_commands (generated for current page)