If you have two sets of files that may share hard-linked files, it can be useful to identify which ones are hard links to same underlying inode (file). This command shows you all of those, sorted by inode#. In my example the two directory trees to compare share a common parent, so I run the command in that parent and just use
find .
to start from the current directory. If yours are in different locations, you can pass both paths to find:
find /directory1 /directory2 -type f -printf '%10i %p\n' | sort | uniq -w 11 -d -D | less
Show Sample Output
One liner is based on this article: https://www.computerhope.com/issues/ch001307.htm Show Sample Output
This way you don't need to replace first line of a bash foo.sh script #!/bin/bash with #!/bin/bash -x to obtain the same effect
dmesg -t: no timestamp -W: follow new messages -l: log-level notice gawk if the fourth word is "Attached" echo a sentence through espeak
Tails a log and replaces it line-by-line according to whatever you want to replace. Useful if the file writing to the log can't be modified, so you need to modify its output instead. Show Sample Output
Colorify colors input by converting the text to a number and then performing modulo 7 on it. This resulting number is used as the color escape code. This can be used to color the results of commands with complex outputs (like "482279054165371") so if any of the digits change, there's a good chance the color will change too. I say good chance because there's only 7 unique colors here, so assuming you were watching random numbers, there would be a 6/7 chance that the color would change when the number changed. This should really only be used to help quickly identify when things change, but should not be the only thing relied upon to positively assert that an output has not changed. Show Sample Output
This version will work if "*screenflow" returns any results with weird characters, and will actually compress the tarballs.
I use screenflow to create and edit videos. The default storage for a single video is a folder. If I want to move that someplace, it's easier to zip up the folder and send it. If I'm making a series of short videos, I might have 10 folders. This will go through and make a single bz3 file for EACH folder.
Last listed files presumably have higher precedency then files listed first, i.e. configuration files in the personal .config directory will be listed last and their config parameters will be more authoritative then default config parameters defined in /etc directory which are usually listed above them. If you replace ".conf" with ".ini" in the command, initial files will be listed instead of config files. If you do not like to list multiple access to the same config file, pipe to "uniq" or "uniq -c" to prefix lines by the number of occurrences Show Sample Output
Replace $CMDLINE_FILENAME with the name of the cmdline file you copied from /proc/pid, and $COMMAND with the command to execute with those arguments.
First, use find
to find directories exactly one level below current directory, then create a tar file using the directory as the basename.
For easy portability you can include you service account blobs directly to your rclone config. So it generate a rclone config like the following: [dst977] type = drive scope = drive service_account_credentials = {"type":"service_account","project_id":"saf-ju66hcgi8qf8zidhvfww4oxwe7","private[.................] } Show Sample Output
2d - is a shortcut for a period back in time Show Sample Output
After install https://linux.dell.com/repo/community/openmanage/ (Complete, all), install these packages or you will get segfaults on update and it will fail.
Useful for containers and environments where you need to know if a port is currently in listen mode but you have not easy way or privileges to install net-tools like netstat or ss. "0A" is the code for listen state. The IP hex is reverse order and all in hex format. Show Sample Output
Parse an m3u file with seconds for each item and output the length of the entire playlist Show Sample Output
For each *.jpg or *.JPG file in the current directory, extract the date the photo was taken from its EXIF metadata. Then replace the date stamp, which is assumed to exist in the filename, by the date the photo was taken. A trick from https://unix.stackexchange.com/a/9256 is used to split the date into its components. Show Sample Output
Generates a TV noise alike output in the terminal. Can be combined with https://www.commandlinefu.com/commands/view/9728/make-some-powerful-pink-noise
Check if port is open, if you don't have ncat on your machine. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: