background preloader

Bash

Facebook Twitter

Bash Prompts. This web page is a child of the Bash Prompt HOWTO that I'm maintaining for the Linux Documentation Project.

Bash Prompts

The HOWTO explains a lot more than I'm going to here. My interest in Bash Prompts developed when I found "The BashPrompt Themes Project (now long deceased). Some of their prompts show up here, and a lot of what I've done shows the influence of their work. I started these pages because so many people have been mailing me cool prompts that I couldn't see putting them all in the HOWTO as examples, but I thought they ought to be available to give other people ideas. And it gives me an opportunity to show off some of mine. Stock RedHat 5.1 Prompt A point of reference. Stock Suse Prompt Another reference. Dan's Prompt A long-time tcsh user, Dan's prompt includes the history number, the tty number, and the return value of the last run process. Jobs Prompt Keeping track of suspended jobs. A Light-weight Prompt Uses colours and fairly standard information.

Heiner's SHELLdorado. How To Use awk In Bash Scripting. How do I use awk pattern scanning and processing language under bash scripts?

How To Use awk In Bash Scripting

Can you provide a few examples? Awk is an excellent tool for building UNIX/Linux shell scripts. AWK is a programming language that is designed for processing text-based data, either in files or data streams, or using shell pipes. In other words you can combine awk with shell scripts or directly use at a shell prompt. This pages shows how to use awk in your bash shell scripts. Print a Text File awk '{ print }' /etc/passwd OR awk '{ print $0 }' /etc/passwd Print Specific Field Pattern Matching You can only print line of the file if pattern matched. If no pattern is given, then the action applies to all lines. Print Lines Containing tom, jerry AND vivek Print pattern possibly on separate lines: awk '/tom|jerry|vivek/' /etc/passwd Print 1st Line From File awk "NR==1{print;exit}" /etc/resolv.conf awk "NR==$line{print;exit}" /etc/resolv.conf Simply Arithmetic.

Mmv MAN Page. Mass Move and rename - Move, copy, append or link Multiple files using wildcard patterns.

mmv MAN Page

Syntax mmv [Source_Option] [-h] [-d|p] [-g|t] [-v|n] [--] [from to] Options: -h help -d Delete -p Protect (don't delete or overwrite) -g Go -t Terminate -v verbose mode -n no-execute mode (display messages about what would have been done) Source_Options: -m Move source file to target name. Both must be on the same device. Will not move directories. If the source file is a symbolic link, moves the link without checking if the link's target from the new directory is different than the old. Download ShellEd software for free. Steve.org.uk: Free Software - GNU Bash for Windows. Stupid cat Tricks: Mike Chirico. Stupid "cat" tricks that work.

Stupid cat Tricks: Mike Chirico

The "cat" command is very powerful and fast. These may be some tips the contents of multiple files from one list. These tips are simple, fast and worth a quick look. shortened. $ cat -v mout|tail test M-v test M-w test M-x test M-y test M-z test M-{ test M-| test M-} test M-~ test M-^? In nearly all cases $ cat file | some_command and its args ...can be rewritten as: $ <file some_command and its args ... Linux System Admin Tips: There are over 200 Linux tips and tricks in this article. Linux Quota Tutorial: This tutorial walks you through implementing disk quotas for both users and groups on Linux, using a virtual filesystem, which is a filesystem created from a disk file. Breaking Firewalls with OpenSSH and PuTTY: If the system administrator deliberately filters out all traffic except port 22 (ssh), to a single server, it is very likely that you can still gain access other computers behind the firewall.

Working With Time: What?