Check These Out
This command is useful if you accidentally untar or unzip an archive in a directory and you want to automatically remove the files. Just untar the files again in a subdirectory and then run the above command e.g.
$ for file in ~/Desktop/temp/*; do rm ~/Desktop/`basename $file`; done
For this hack you need following function:
$ finit() { count=$#; current=1; for i in "$@" ; do echo $current $count; echo $i; current=$((current + 1)); done; }
and alias:
$ alias fnext='read cur total && echo -n "[$cur/$total] " && read'
Inspired by CMake progress counters.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Similar to `cpulimit`, although `prlimit` can be found shipped with recent util-linux.
Example: limit CPU consumption to 10% for a math problem which ordinarily takes up 100% CPU:
Before:
$ bc -l
This says if the LHC has destroyed the world. Run it in a loop to monitor the state of Earth. Might not work reliable, if the world has actually been destroyed.
Helps when I'm editing a script and want to double check some commands without having to exit out of vi multiple times or having to use another terminal session.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.
Counts TCP states from Netstat and displays in an ordered list.
This syntax also works for ffmpeg as avconv is a fork of ffmpeg.
Uses the lm-sensors package in Linux to display fan speed. Grep RPM is used to discover lines containing the text RPM, and sed is used to edit out everything but the RPM number. The watch utility is used to update the display every 10 seconds and -d highlights any changes from the previous value. The eval function of Bash is used to execute the command enclosed in the ".." string.