Commands tagged make (7)

  • Uses inotifywait from inotify-tools ( ), that is compatible only with linux. Usefull when you work with files that have to be compiled.. latex, haml, c..

    while true; do inotifywait -r -e MODIFY dir/ && make; done;
    fain182 · 2010-06-04 17:07:03 0

  • 5
    while inotifywait -r -e MODIFY dir/; do make; done;
    prayer · 2010-06-08 23:34:00 2
  • this oneliner uses make and it's jobserver for parallel execution of your script. The '-j' flag for make defines number of subprocesses to launch, '-f' tells make use stdin instead of Makefile. Also make have neat flag '-l', which "Specifies that no new jobs (commands) should be started if there are others jobs running and the load is at least load (a floating-point number)." Also you can use plain Makefile, for better readability: targets = $(subst .png,.jpg,$(wildcard *.png)) (targets): echo convert $(subst .jpg,.png,[email protected]) [email protected] all : $(targets)

    echo -n 'targets = $(subst .png,.jpg,$(wildcard *.png))\n$(targets):\n convert $(subst .jpg,.png,[email protected]) [email protected] \nall : $(targets)' | make -j 4 -f - all
    mechmind · 2010-07-15 07:19:17 1
  • This would allow reference of $(VAR) (if defined) with the value 'foobar' within the Makefile.

    make [target] VAR=foobar
    cifr · 2009-10-12 09:42:30 0
  • Say your dependencies specified in your Makefile (or dates on your source files) is causing 'make' to skip some source-files (that it should not) or on the other other end, if it is causing make to always build some source-files regardless of dates of target, then above command is handy to find out what 'make' thinks of your date v/s target date-wise or what dependencies are in make's view-point. The egrep part removes the extra noise, that you might want to avoid. Show Sample Output

    make -d | egrep --color -i '(considering|older|newer|remake)'
    b_t · 2011-06-03 01:55:08 17
  • on a dpkg managed system this PATTERN will help you generate .deb files from source AND remove all the dev libs you had to install. i hate cluttering up my machine with rouge packages and headers. it would be pretty darn easy on rpm systems as well. i just dont have a rpm managed system to test on right now. NOTE, you sharp ones will notice that it uninstalls the deb you just made! yeah, but the deb is still there to do with it what you want, like re install it. or you can just grep -v after the diff

    dpkg-query -l > 1.lst; sudo apt-get install -y build-essential; ./configure; make; sudo checkinstall -D make install; dpkg-query --list > 2.lst; diff 1.lst 2.lst | grep '^>' | awk '{print $3}' | xargs sudo apt-get remove -y --purge
    danlangford · 2010-06-16 22:06:07 1
  • Will prepend date and time in the following format: [email protected]:mm:ss (24hours format) and redirect it to make.out file Show Sample Output

    make -j 2>&1 | while IFS= read -r line; do echo "$(date +"%d-%m-%[email protected]%T") $line"; done > make.out
    redowk · 2017-03-06 18:14:51 1

What's this? 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.

Share Your Commands

Check These Out

Eliminate dead symlinks interactively in /usr/ recursevely
Its not mine... I get from textlive migration in gentoo :

back ssh from firewalled hosts
host B (you) redirects a modem port (62220) to his local ssh. host A is a remote machine (the ones that issues the ssh cmd). once connected port 5497 is in listening mode on host B. host B just do a ssh -p 5497 -l user and reaches the remote host'ssh. This can be used also for vnc and so on.

Expedient hard disk temprature and load cycle stats
This command is a great way to check to see if acpi is doing damage to your disks by agressivly parking the read arm and wearing down it's life. As you can see, mine has lost half its life. I'm sure this could be shortened though somehow. It will use smartctl to dump the stats and then grep out just the temperature and load cycles for the disk (a load cycle is when a the read arm comes out of park and wears on the drive).

Copy input sent to a command to stderr
In the above example 'muspi merol' (the output of the first rev command) is sent to stderr and 'lorem ipsum' (the output of the second rev command) is sent to stdout. rev reverse lines of a file or files. This use of tee allows testing if a program correctly handles its input without using files that hold the data.

List recorded formular fields of Firefox
When you fill a formular with Firefox, you see things you entered in previous formulars with same field names. This command list everything Firefox has registered. Using a "delete from", you can remove anoying Google queries, for example ;-)

Search through files, ignoring .svn
By putting the "-not \( -name .svn -prune \)" in the very front of the "find" command, you eliminate the .svn directories in your find command itself. No need to grep them out. You can even create an alias for this command: $ alias svn_find="find . -not \( -name .svn -prune \)" Now you can do things like $ svn_find -mtime -3

Find the process you are looking for minus the grepped one
As an alternative to using an additional grep -v grep you can use a simple regular expression in the search pattern (first letter is something out of the single letter list ;-)) to drop the grep command itself.

Check every URL redirect (HTTP status codes 301/302) with curl

Get the Volume labels all bitlocker volumes had before being encrypted
Get information of volume labels of bitlocker volumes, even if they are encrypted and locked (no access to filesystem, no password provided). Note that the volume labels can have spaces, but only if you name then before encryption. Renaming a bitlocker partition after being encrypted does not have the same effect as doing it before.

check open ports without netstat or lsof

Stay in the loop…

Follow the Tweets.

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.


Subscribe to the feeds.

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: