This forum is in permanent archive mode. Our new active community can be found here.

Stupid Unix Tricks

edited March 2012 in Technology
So I've been using Linux/Unix for a long time (installed Slackware Linux 3.0 on my machine back in 1995, though I dabbled a bit before then), yet even now I'm still learning new tricks/tools/etc. on how to better use it. I figured it may not hurt to start a thread where people share various tricks they've learned on how to be more productive using Linux/Unix.

To start off, here are a few of mine. The first one is a bash one-liner I use when I want to do something to a bunch of files where wildcarding won't cut it because of how the shell expands wildcards (hence why you can't do a "mv *.txt *.log"):

for file in *.whatever ; do something_to $file ; done

Another one, you can use the "less" command like the "tail -f" command by using the 'F' command once you bring up your file. To get out of tailing mode, just hit Ctrl-C.

Finally, if you want to continuously loop on a single command and watch its output (like if you do a "ps" and are waiting for a particular process to start up) you can use the "watch" command thusly:
watch program_name_and_args
Post edited by Dragonmaster Lou on

Comments

Sign In or Register to comment.