Pages tagged bash:

10 Tips for Writing Efficient Bash Scripts | HACKTUX
http://hacktux.com/bash/script/efficient

Ten great tips for being efficient in bash.
A Unix Utility You Should Know About: Pipe Viewer - good coders code, great reuse
http://www.catonmat.net/blog/unix-utilities-pipe-viewer/
create progress bars for common unix commands.
via hackernews
Pipe Viewer als Fortschrittsanzeige für CLI.
Command-line Fu < The best UNIX commands on the web
http://www.commandlinefu.com/commands/browse
Command-Line-Fu is the place to record those command-line gems that you return to again and again.
Command-line Fu < The best UNIX commands on the web
http://www.commandlinefu.com/commands/browse/sort-by-votes
A repository for the most elegant and useful UNIX commands. Great commands can be shared, discussed and voted on to provide a comprehensive resource for working from the command-line
save
Command-Line-Fu is the place to record those command-line gems that you return to again and again
linux commands
Home - j - GitHub
http://wiki.github.com/rupa/j
j keeps track of where you’ve been, and how much time you spend there. Source it into your .bashrc, and then you can say j foo to jump to the most used directory that has the substring (actually regex) foo in i
j is a "learning cd", a shell/awk script that captures your directory changes and remembers the most frequently visited directories, allowing you to hop to them with a simple 'j dirname', no matter where you are in the filesystem.
Tool to jump around directories
j is replacement for cd that learns the directories you use most often
Linux tips every geek should know | TuxRadar
http://www.tuxradar.com/content/linux-tips-every-geek-should-know
Very useful bash and commands tips.
Linux tips every geek should know
Command-line Fu < The best UNIX commands on the web
http://www.commandlinefu.com/
Huge searchable archive of unix commands for the command line. This is on the distant to do list.
More Linux tips every geek should know | TuxRadar
http://www.tuxradar.com/content/more-linux-tips-every-geek-should-know
If you've already read and memorised our "Linux tips every geek should know" and "20 all-new tips for KDE 4.2" features, we've picked out 50 more Linux desktop tips for you to enjoy.
Mommy, I found it! — 15 Practical Linux Find Command Examples
http://www.thegeekstuff.com/2009/03/15-practical-linux-find-command-examples/
find / -name passwd
Usi del comando find
using FIND
findを極める! - IDEA*IDEA ~ 百式管理人のライフハックブログ ~
http://www.ideaxidea.com/archives/2009/05/find.html
findコマンドの一通りの扱いについて解説
find . -empty
定期的に上がるねfindネタ
micha's resty at master - GitHub
http://github.com/micha/resty/tree/master
curl GET/POST/PUT/DELETE
rest from the command line (bash+curl)
Very, very cool. Fire up a local REST host pointing to any service, and then GET /blogs.json etc from the command line.
Little command line REST interface that you can use in pipelines. [Sublime :-) ]
resty is a RESTful HTTP friendly wrapper around curl
blog dds: 2009.03.04 - Parallelizing Jobs with xargs
http://www.spinellis.gr/blog/20090304/
With multi-core processors sitting idle most of the time and workloads always increasing, it's important to have easy ways to make the CPUs earn their money's worth. My colleague Georgios Gousios told me today how the Unix xargs command can help in this regard. The GNU xargs command that comes with Linux and the one distributed with FreeBSD support a -P option through which one can specify the number of jobs to run in parallel. Using this flag (perhaps in conjunction with -n to limit the number of arguments passed to the executing program), makes it easy to fire commands in parallel in a controlled fashion.
The xargs -P flag can also be useful for parellelizing commands that depend on a large number of high-latency systems. Only a week ago I spent hours to write a script that would resolve IP addresses into host names in parallel. (Yes, I know the logresolve.pl that comes with the Apache web server distribution, and the speedup it provides leaves a lot to be desired.) Had I known the -P xargs option, I would have finished my task in minutes.
Multicore-Systeme mit xargs sauber auslasten.
emson… » 18 Useful bash scripts for web developers
http://blog.emson.co.uk/2009/06/18-useful-bash-scripts-for-web-developers/
a few scripts, that I find really useful for speeding up my web development time. I’ve been building up this list as I needed to use them - so they maybe a little raw.
Using bash scripts to become a more efficient web developer
Here are a few scripts, that I find really useful for speeding up my web development time. I’ve been building up this list as I needed to use them - so they maybe a little raw. For example often clients send me images with filenames that don’t match my naming standard, so running the appropriate script really helps keep me focussed on the job in hand and not waste too much time reformatting filenames etc.
Bash&シェルスクリプトを極めるテクニックまとめ - SourceForge.JP Magazine
http://sourceforge.jp/magazine/09/06/11/088209
(1)Bashをカスタマイズして使いこなす, (2)シェルスクリプトを使いこなすテクニック, (3)Bash以外の高機能シェルもある
erikfrey's bashreduce at master - GitHub
http://github.com/erikfrey/bashreduce/tree/master
whoah, wtf.
Map/Reduce in a bash script... hahahahahahaha
MapReduce done in BASH! Awesome!
Some mad bash magic for distributing stuff.
interesting hack -- apply Map-Reduce idioms to UNIX command lines across multiple machines or cores (via jzawodny, who's obviously looking at a lot of command line stuff recently ;)
20 Linux System Monitoring Tools Every SysAdmin Should Know
http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html
20 Linux System Monitoring Tools Every SysAdmin Should Know
bashreduce: A Bare-Bones MapReduce | Linux Magazine
http://www.linux-mag.com/cache/7407/1.html
heh. maybe useful for learning the mapreduce paradigm?
t
15 Great Tips For Ubuntu Power Users
http://www.makeuseof.com/tag/15-great-tips-for-ubuntu-power-users/
15 Great Tips For Ubuntu Power Users
A few days back I wrote about books that beginners can download and read to teach themselves Linux. Today in the Linux section we have something for the power users. Here are a few tips you should try out if you are an avid Ubuntu user:
A few days back I wrote about books that beginners can download and read to teach themselves Linux. Today in the Linux section we have something for the power
Last.fm – the Blog · Mapreduce Bash Script
http://blog.last.fm/2009/04/06/mapreduce-bash-script
One night at the pub we discussed whether one could replace Hadoop (a massive and comprehensive implementation of Mapreduce) with a single bash script, an awk command, sort, and a sprinkling of netcat. This turned into a weekend project dubbed bashreduce.
Hardcoded version of push
Map-Reduce implemented as a bash script!
MapReduce in a Bash Script
One night at the pub we discussed whether one could replace Hadoop (a massive and comprehensive implementation of Mapreduce) with a single bash script, an awk command, sort, and a sprinkling of netcat. This turned into a weekend project dubbed bashreduce
Map Reduce implemented in bash using sort, awk, grep, join.
4 Websites to Learn Cool Linux Command Line Tricks | MakeUseOf.com
http://www.makeuseof.com/tag/4-websites-to-learn-cool-linux-command-line-tricks/
Currently Browsing: http://lngq2.tk [from http://twitter.com/ifixedit/statuses/3199324176]
http://www.pement.org/awk/awk1line.txt
http://www.pement.org/awk/awk1line.txt
Useful examples of awk usage
sub(/\r$/,"")
HANDY ONE-LINE SCRIPTS FOR AWK
How to Debug Bash Scripts | Ayman Hourieh's Blog
http://aymanh.com/how-debug-bash-scripts
On how to trace Bash script execution.
8 Useful and Interesting Bash Prompts – Make Tech Easier
http://maketecheasier.com/8-useful-and-interesting-bash-prompts/2009/09/04
1. Show Happy face upon successful execution
Linux Shell Scripting Tutorial - A Beginner's handbook
http://bash.cyberciti.biz/guide/Main_Page
Speaking UNIX: Stayin' alive with Screen
http://www.ibm.com/developerworks/aix/library/au-gnu_screen/
Screen
good explanation of how one might use the unix screen command
BashPitfalls - Greg's Wiki
http://mywiki.wooledge.org/BashPitfalls
How to Be Faster at the Linux Command Line | HACKTUX
http://hacktux.com/bash/fast/cli
Customizing the Terminal: The Prompt | LinDesk
http://lindesk.com/2009/03/customizing-the-terminal-the-prompt/
Customizing the Terminal: The Prompt
Most Linux ‘gurus’ spend a lot of time working in the terminal. If you belong to that group, this post is for you. This is a tutorial to configure the terminal prompt to the best possible value for your use. Note: This tutorial is for bash users – these instructions will not work in other shells.You must have seen the prompt if you have use the terminal – it is the first few characters in each line. Usually, it will be…Editing the prompt is very simple – you just have to edit a shell variable. To see the current prompt’s value, open a shell and type the command…
good prompt ideas
Elite Log File Scrolling with Color Syntax
http://www.askapache.com/security/elite-log-file-scrolling-with-color-syntax.html
pipe
Script lets you scroll logfiles automatically colorized making them a TON easier to read at a glance!
Bash shortcuts « Tales From a Cold Network Admin
http://talesofacoldadmin.wordpress.com/bash-shortcuts/
"The $(</path/to/a/file) #Thanks Croooow This isn’t exactly a variable, more a method of reading files, but it is optimized beyond the cat command to work with bash scripts "
Update Twitter and FriendFeed from the Linux command line
http://www.ibm.com/developerworks/linux/library/l-friendfeed/index.html
curl http://wikipedia.org
Summary: Learn how to use GNU Wget and cURL to send status updates to Twitter and FriendFeed without the use of a Twitter desktop application, and follow feeds from both Twitter and FriendFeed right from the Linux® command line. This article was updated on 31 Oct 2008 to correct a coding error in the wget command under "Adding a tweet using GNU Wget and cURL." --Ed.
Command line tricks for smart geeks | TuxRadar Linux
http://www.tuxradar.com/content/command-line-tricks-smart-geeks
www.home.unix-ag.org/ simon/woof.html
Lazy Linux: 10 важных практических приёмов для администраторов
http://www.ibm.com/developerworks/ru/library/l-10sysadtips/index.html?S_TACT=105AGX99&S_CMP=GR01
Освойте эти 10 практических приемов и станьте самым лучшим администратором Linux-систем во Вселенной. Узнайте о туннелях SSH, VNC, восстановлении паролей и консольном шпионаже и воспроизводите затем эти приёмы на своих машинах.
Can You Top This? 15 Practical Linux Top Command Examples
http://www.thegeekstuff.com/2010/01/15-practical-unix-linux-top-command-examples
teractive top c
INX Is Not X : A command line and console Linux "Live CD" based on a minimal Ubuntu, without the X window system graphical interface. INX has some surprising capabilities...
http://inx.maincontent.net/
Apprendre la console bash
Linux à vocation pédagogique, uniquement en ligne de commande.
Lifehacker - Use a Different Color for the Root Shell Prompt - Terminal
http://lifehacker.com/5195951/use-a-different-color-for-the-root-shell-prompt
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
UNIX tips: Learn 10 good UNIX usage habits
http://www.ibm.com/developerworks/aix/library/au-badunixhabits.html?ca=lnxw01GoodUnixHabits
Avoid piping a grep to wc -l in order to count the number of lines of output. The -c option to grep gives a count of lines that match the specified pattern and is generally faster than a pipe to wc, as in the following example:
Top Ten One-Liners from CommandLineFu Explained - good coders code, great reuse
http://www.catonmat.net/blog/top-ten-one-liners-from-commandlinefu-explained/
Useful Bash shell one liners with explanations
The A-Z of Programming Languages: Bourne shell, or sh - a-z of programming languages - Computerworld
http://www.computerworld.com.au/article/279011/-z_programming_languages_bourne_shell_sh
An in-depth interview with Steve Bourne, creator of the Bourne shell, or sh
Set Operations in the Unix Shell Simplified - good coders code, great reuse
http://www.catonmat.net/blog/set-operations-in-unix-shell-simplified/
Very useful bash examples of operations with sets
10 Tools To Add Some Spice To Your UNIX Shell Scripts
http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html
A
CoolStuff
Powerhouse Programs of Linux
http://www.nixtutor.com/linux/powerhouse-programs-of-linux/
Not only is dd a court recognized bit for bit hard drive forensic imaging utility, it is also a great tool for making your own backups. Dd has proven itself time and time again. You can use it to copy CDs and other media. You can also use it to move data to another hard drive or cat out strings stored in RAM. Common Uses
Search
Linux comes packed with some pretty powerful tools. Here is a list of what I consider to be the powerhouse programs of Linux and some common usage for each.
"Here is a list of what I consider to be the powerhouse programs of Linux."
kmb-tips: Советы по Linux
http://kmb-tips.blogspot.com/2008/07/linux.html
Viewing sfbashrc
http://www.johnlawrence.net/code/?f=sfbashrc
http://www.shell-fu.org/lister.php?id=209
Some awesome aliases to add to bashrc
Ksplice » The top 10 tricks of Perl one-liners - System administration and software blog
http://blog.ksplice.com/2010/05/top-10-perl-one-liner-tricks
things I did not know ... like the '..' operator. Neato.
Terminal Tips and Tricks For Mac OS X - Super User
http://superuser.com/questions/52483/terminal-tips-and-tricks-for-mac-os-x
Cool collection of tricks, even I found new ones
Awk by example, Part 1 --
http://www.funtoo.org/en/articles/linux/awk/1/
In defense of awk In this series of articles, I'm going to turn you into a proficient awk coder. I'll admit, awk doesn't have a very pretty or particularly "hip" name, and the GNU version of awk, called gawk, sounds downright weird. Those unfamiliar with the language may hear "awk" and think of a mess of code so backwards and antiquated that it's capable of driving even the most knowledgeable UNIX guru to the brink of insanity (causing him to repeatedly yelp "kill -9!" as he runs for coffee machine).
Awk by example, Part 1 --
http://www.funtoo.org/en/articles/linux/awk/1/
In defense of awk In this series of articles, I'm going to turn you into a proficient awk coder. I'll admit, awk doesn't have a very pretty or particularly "hip" name, and the GNU version of awk, called gawk, sounds downright weird. Those unfamiliar with the language may hear "awk" and think of a mess of code so backwards and antiquated that it's capable of driving even the most knowledgeable UNIX guru to the brink of insanity (causing him to repeatedly yelp "kill -9!" as he runs for coffee machine).
Awk by example, Part 1 --
http://www.funtoo.org/en/articles/linux/awk/1/
In defense of awk In this series of articles, I'm going to turn you into a proficient awk coder. I'll admit, awk doesn't have a very pretty or particularly "hip" name, and the GNU version of awk, called gawk, sounds downright weird. Those unfamiliar with the language may hear "awk" and think of a mess of code so backwards and antiquated that it's capable of driving even the most knowledgeable UNIX guru to the brink of insanity (causing him to repeatedly yelp "kill -9!" as he runs for coffee machine).
Awk by example, Part 1 --
http://www.funtoo.org/en/articles/linux/awk/1/
In defense of awk In this series of articles, I'm going to turn you into a proficient awk coder. I'll admit, awk doesn't have a very pretty or particularly "hip" name, and the GNU version of awk, called gawk, sounds downright weird. Those unfamiliar with the language may hear "awk" and think of a mess of code so backwards and antiquated that it's capable of driving even the most knowledgeable UNIX guru to the brink of insanity (causing him to repeatedly yelp "kill -9!" as he runs for coffee machine).
3 shell scripts: Kill weasel words, avoid the passive, eliminate duplicates
http://matt.might.net/articles/shell-scripts-for-passive-voice-weasel-words-duplicates/
Even in this example, I personally have no problem with using we.
#!/bin/bash weasels="many|various|very|fairly|several|extremely\ |exceedingly|quite|remarkably|few|surprisingly\ |mostly|largely|huge|tiny|((are|is) a number)\ |excellent|interestingly|significantly\ |substantially|clearly|vast|relatively|completely" wordfile="" # Check for an alternate weasel file if [ -f $HOME/etc/words/weasels ]; then wordfile="$HOME/etc/words/weasels" fi if [ -f $WORDSDIR/weasels ]; then wordfile="$WORDSDIR/weasels" fi if [ -f words/weasels ]; then wordfile="words/weasels" fi if [ ! "$wordfile" = "" ]; then weasels="xyzabc123"; for w in `cat $wordfile`; do weasels="$weasels|$w" done fi if [ "$1" = "" ]; then echo "usage: `basename $0` <file> ..." exit fi egrep -i -n --color "\\b($weasels)\\b" $* exit $?
Kill weasel words, avoid the passive, eliminate duplicates