background preloader

Bash shell

Facebook Twitter

How to: Change / Setup bash custom prompt (PS1) So how do you setup, change and pimp out Linux / UNIX shell prompt?

How to: Change / Setup bash custom prompt (PS1)

Most of us work with a shell prompt. By default most Linux distro displays hostname and current working directory. You can easily customize your prompt to display information important to you. You change look and feel by adding colors. In this small howto I will explain howto setup: a] Howto customizing a bash shell to get a good looking prompt b] Configure the appearance of the terminal. c] Apply themes using bashish d] Howto pimp out your shell prompt Prompt is control via a special shell variable.

PS1 – The value of this parameter is expanded (see PROMPTING below) and used as the primary prompt string. How do I display current prompt setting? Simply use echo command, enter: $ echo $PS1 Output: \\u@\h \\W]\\$ How do I modify or change the prompt? Modifying the prompt is easy task. Cut down on Linux command-line typing with these 10 handy bash aliases. The Linux desktop may have come a long way, but there are still times when you'll need to use the command line.

Cut down on Linux command-line typing with these 10 handy bash aliases

Luckily, you don't have to type the same commands over and over. Jack Wallen shares some of the aliases he's used over the years to reduce the need for repetitive command-line typing. The Linux desktop has come a long, long way, but there are still times when I have to use the command line. (I am a hardcore user, after all.) But even though I'm used to typing, spending hours upon hours with my fingers at the keyboard, I still grow tired of typing the same commands over and over. What is an alias? An alias is basically a shortcut for a command you place in your ~/.bashrc file. Aliases are set up near the bottom of the of the .bashrc file. Alias NICKNAME='full command here' The keyword alias must be used. Top 10 Command Line Tools. Linux IP Commands. Put Your System on a Diet: Replace Bloated Apps with Command-Line Alternatives.

Turn Your Command Line into a Fast and Simple Note-Taking Tool. The Linux "Help" System. Once you have Linux installed and running, the most important piece of information you need is how to get help.

The Linux "Help" System

There are megabytes of documentation right there on your Linux system that can answer all of your questions, if you just know how to access it! Man Pages The standard way to get help, which works on any UNIX system, is a command called man (think “manual”, as in user handbook). To get help on the grep command, for example you would type: man grep This displays a help screen describing the program and its usage. Man pages are stored in a categorized database. User CommandsSystem CallsSubroutinesDevicesFile FormatsGamesMiscellaneousSystem Administration. Compiling and installing software from source in Linux. An introduction to the Linux command line terminology. Shell Scripts - Learn Linux. LINUX CLASSES - PROGRAMMING So how do you run this little wonder of technology?

Shell Scripts - Learn Linux

In DOS, all you have to do is name a file with a .bat extension and it'll be recognized as an executable file--but not so with Linux. Since Linux attaches no meaning to file extensions, you have to mark the file as executable by using the chmod command, like this: $ chmod +x deltemp The x marks the file as executable; if you list the permissions for the deltemp file afterward, you will see the x in position four, confirming this: $ ls -l deltemp -rwx------ 1 hermie other 55 Feb 19 14:02 deltemp If you want other users to be able to run this script, give them both read and execute permission, like so: Linux command line tips. I thought it would be useful to break away from all the GUI-goodness and offer up a few command line tips and tricks.

Linux command line tips

Why? No matter how powerful, user-friendly, and modern the Linux desktop becomes, there may come a time when you want to step up your game and get down and dirty with the command line interface. When you do, you will want your command-fu to be strong. And whether you are brand new to the command line, or have any level of familiarity with this tool, there are tips and tricks out there to make your life easier. This article should at least offer one or two of those tips...no matter your level of skill. Tab completion This tip is for the novice. Type beagleHit the Tab key twice. How to Use the vi Editor. *Copyright 1991 by Simon Fraser University.

How to Use the vi Editor

Reprinted with permission. The vi editor is available on almost all Unix systems. vi can be used from any type of terminal because it does not depend on arrow keys and function keys--it uses the standard alphabetic keys for commands. vi (pronounced "vee-eye") is short for "vi"sual editor. It displays a window into the file being edited that shows 24 lines of text. vi is a text editor, not a "what you see is what you get" word processor. vi lets you add, change, and delete text, but does not provide such formatting capabilities as centering lines or indenting paragraphs.

Using Unix Computers. How to Set File Permissions Using `chmod' Files and directories in Unix may have three types of permissions: read (`r'), write (`w'), and execute (`x').

How to Set File Permissions Using `chmod'

Each permission may be `on' or `off' for each of three categories of users: the file or directory owner; other people in the same group as the owner; and all others. Files To determine the mode (or permission settings) of a particular file, use the command `ls -lg filename'. This command will produce a message similar to the following: -rwxr-x--x 1 owner group 2300 Jul 14 14:38 filename The string of 10 characters on the left shows the mode. LSST v1.05 > Chapter 1 > Linux Shell basics.