Check These Out
== remove broken links ==
find -L . -type l -exec rm -rf {} \;
== how this work ==
"symbolic link; this is never true if the -L option or the -follow option is in effect, unless the symbolic link is broken. If you want to search for symbolic links when -L is in effect, use -xtype." -- manpage of find.
for one line per process:
$ ss -p | cat
for established sockets only:
$ ss -p | grep STA
for just process names:
$ ss -p | cut -f2 -sd\"
or
$ ss -p | grep STA | cut -f2 -d\"
Fool date by setting the timezone out by 24 hours and you get yesterday's date. Try TZ=XYZ-24 to get tomorrow's date. I live in TZ=GMT0BST so you might need to shift the number 24 by the hours in your timezone.
Sort ls output of all files in current directory in ascending order
Just the 20 biggest ones:
$ ls -la | sort -k 5bn | tail -n 20
A variant for the current directory tree with subdirectories and pretty columns is:
$ find . -type f -print0 | xargs -0 ls -la | sort -k 5bn | column -t
And finding the subdirectories consuming the most space with displayed block size 1k:
$ du -sk ./* | sort -k 1bn | column -t
parallel can be installed on your central node and can be used to run a command multiple times.
In this example, multiple ssh connections are used to run commands. (-j is the number of jobs to run at the same time). The result can then be piped to commands to perform the "reduce" stage. (sort then uniq in this example).
This example assumes "keyless ssh login" has been set up between the central node and all machines in the cluster.
bashreduce may also do what you want.
$ translate [output-language] [source-language]
1) "some phrase" should be in quotes
2) [output-language] - optional (default: English)
3) [source-language] - optional (default: auto)
$ translate "bonjour petit lapin"
hello little rabbit
$ translate "bonjour petit lapin" en
hello little rabbit
$ translate "bonjour petit lapin" en fr
hello little rabbit
Displays a scrolling banner which loops until you hit Ctrl-C to terminate it.
Make sure you finish your banner message with a space so it will loop nicely.