summaryrefslogtreecommitdiff
path: root/080_blog/00015_Admin/00040_Oneliners
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2019-03-07 23:26:17 +0100
committerMiguel <m.i@gmx.at>2019-03-07 23:26:17 +0100
commit52f86ea0075c66e18e4796ad88f45541da8b4de5 (patch)
treea7dcdb140e49ca13ed2315970e3b86e0c6fb9ef3 /080_blog/00015_Admin/00040_Oneliners
parenta9e55a351753af1cfdeb75bdf50ecfd80de129c0 (diff)
some cleanup and such
Diffstat (limited to '080_blog/00015_Admin/00040_Oneliners')
-rw-r--r--080_blog/00015_Admin/00040_Oneliners/index.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/080_blog/00015_Admin/00040_Oneliners/index.md b/080_blog/00015_Admin/00040_Oneliners/index.md
new file mode 100644
index 0000000..c16a515
--- /dev/null
+++ b/080_blog/00015_Admin/00040_Oneliners/index.md
@@ -0,0 +1,41 @@
+# Oneliners
+
+A Growing Collection of Linux Command Line One-Liners
+
+Please believe me... this collection was really supposed to grow over time...
+
+inside a direcotry show disk usage of all hidden files and directories and sort by size:
+
+ $ du $(ls .* -d | tail -n +3) -hs |sort -h
+
+inside a direcotry show disk usage of all files and directories (also hidden) and sort by size.
+Exclude 'garbage' file.
+
+ $ du . -a -d 1 -h --exclude=garbage | sort -h
+
+Tar all files in current directory, excluding ./DATA and ./.cache
+
+ $ tar --exclude=.cache -cvf home_miguel_20180216.tar .
+
+Find files in ./ARCHIVE NOT belonging to a specific user: miguel
+
+ $ find ARCHIVE/ \! -user miguel
+
+set folder/ permissions to Read/Browse only for owner recursively
+
+ $ sudo chmod -R u=r,g=,o= folder/
+ $ chmod -R u=rX,g=,o= folder/
+
+find all mails from Boban when in the maildir full of mailboxes and print only short headers without bodies:
+
+ $ grepmail -H -B -Y ‘(^TO:|^From:)’ Boban *
+
+not really a one-lier but will print 256 colors in a bash:
+
+ for i in {0..255} ; do
+ printf "\x1b[48;5;%sm%3d\e[0m " "$i" "$i"
+ if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then
+ printf "\n";
+ fi
+ done
+