commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
The "proportional set size" is probably the closest representation of how much active memory a process is using in the Linux virtual memory stack. This number should also closely represent the %mem found in ps(1), htop(1), and other utilities.
This uses mutt to send the file, and doesn't require uuencode etc
This type of join is clearly documented in the bash manual. Only the first character of IFS is used for the delimiter.
-L is for following symbolic links, it can be omitted and then you can find in your whole / dir
This will create rapidly an html menu. You can paste it in you're html page with the middle button(the wheel). I didn't test it in an html with css, but it seems alright.
If the HISTTIMEFORMAT is set, the time stamp information associated with each history entry is written to the history file, marked with the history comment character.
This command is used to verify a sha256sum-formatted file hash list on IBM AIX or any other UNIX-like OS that has openssl but doesn't have sha256sum by default. Steps:
1: Save to the filesystem a script that:
A: Receives as arguments the two parts of one line of a sha256sum listing
B: Feeds a file into openssl on SHA256 standard input hash calculation mode, and saves the result
C: Compares the calculated hash against the one received as argument
D: Outputs the result in a sha256sum-like format
2: Make the script runnable
3: Feed the sha256sum listing to xargs, running the aforementioned script and passing 2 arguments at a time
This command is for producing GNU sha256sum-compatible hashes on UNIX systems that don't have sha256sum but do have OpenSSL, such as stock IBM AIX.
1.- Saves a wrapper script for UNIX find that does the following:
A.- Feeds a file to openssl on SHA256 hash calculation mode
B.- Echoes the output followed by the filename
2.- Makes the file executable
3.- Runs find on a directory, only processing files, and running on each one the wrapper script that calculates SHA256 hashes
Pending is figuring out how to verify a sha256sum file on a similar environment.
Use it to send raw data to a networked device. Used to interact with relay controller board whose documentation is lost, so use wireshark to sniff the sent data and replayed using the command.
Use dots to cd down directories instead of having to remember all of the pesky back slashes!
Better yet, works on even and odd number of dots! Now, just estimate how far down you want to traverse.
url can be like any one of followings:
If url mismatching, whole url will be returned.
Should work with sh, bash, etc.
printTextInColorRed foo bar
foo bar [in red color]
The input images are assume to have the "JPG" extension. Mogrify will overwrite any gif images with the same name! Will not work with names with spaces.
If you want avoid to be annoyed when playing your favourite video files with your video player, first run this command to stash wrong files (and test tricks to play these wrong files).
Remove the "echo" to actually archive.
Many similar commands are found on commandlinefu but I end up needing this very specific one from time to time.
To extract any of them, use the standard tar.bz2 extract command:
tar xvjf folder1.tar.bz2
This will find all the -Xmx[BIGINT] running on a system, add them up for you and give you the total.
Support several arguments.
Usage: ytmp3 "YTurl" "YTurl2" "YTurl3" "YTurlN"
Uses the shift command to let you extract the .mp3 from as many youtube urls as you like (or wherever else youtube-dl is supported)
Orginal chunk of code:
youtube-dl -q -t --extract-audio --audio-format mp3 URL