Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Costa's Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Linux
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
;Copy directories without content <pre> rsync -av -f"+ */" -f"- *" "$source" "$target" </pre> ;Find files find /path/to/dir -type f -name "*" -newermt 2013-02-07 ! -newermt 2013-02-08 find $HOME/projects -type f -name "*.py" -newermt 2013-02-07 ! -newermt 2013-02-08 -print find $HOME/projects -type f -name "*.py" -newermt 2013-02-07 ! -newermt 2013-02-08 -ls ;Delete Files older Than <pre> find /var/log -name "*.log" -type f -mtime +30 -delete find /var/log -type d -mtime +30 -exec rm -rf {} \; </pre> ;How to print a file, excluding comments and blank lines, using grep <pre>grep -v '^$\|^#\|^\s*\#' filename | grep -v "^[[:space:]]*$" | more grep -v "^[[:space:]]*$\|^ *#" filename </pre> ;bash operations with file with spaces in name IFS=$(echo -en "\n\b"); for i in $(ls -d */ | cut -f1 -d'/'); do echo $i; done IFS=$(echo -en "\n\b"); for i in $(ls -d */ | cut -f1 -d'/'); do echo "$i;"| tr -d '\r\n'; find $i -type f | wc -l; done ;ssh automation ssh -i /usr/local/sbin/id_rsa -oStrictHostKeyChecking=no ansible@10.0.0.26 'upsc qnapups' -i RSA key, -o add to known host automatically ; ls with full path ls -dl $PWD/* ;Set date of directories by latest file inside IFS=$(echo -en "\n\b"); for d in */ ; do T=`ls -alt --time-style="+%Y%m%d0101.10" $d | tail -1 | awk '{print $6}'`; touch -t $T $d; done ;Частотный анализ букв в именах файлов ls | awk '{for (i=1 ; i<=NF ; i++) array[$i]++ } END{ for (char in array) print char,array[char]}' FS="" | sort -k2 -n ;Find and replace characters in file name for file in `IFS=$(echo -en "\n\b"); find . -name "*[+]*" `; do mv -v $file $(echo $file | sed -e 's/+//g'); done ;Rename bulk of files by template for file in *_AV1.mkv; do mv "$file" "${file%_AV1.mkv}.av1"; done ;[[Audiofile operations]] ;[[Photo file operations]] ;[[LVM operations]] ;[[SSL Certificate with SAN]] ;[[SSL Certificate signed by your own CA]] ;[[SD card partition recovery]] ;[[How to recreate a wiped /boot filesystem in Ubuntu]]
Summary:
Please note that all contributions to Costa's Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Linux
Add topic