Strange bash piping method that actually does work. And fixing hard disk partitions with fsck.

This is a strange bash piping method that actually does work. This pipes the output of one echo command and appends it to another. ubuntu ~ $ echo "Hello World" >| echo "Me" > out.txtubuntu ~ $ echo "Hello World" >| echo "Me" > out.txt This is the result of this strange command. ubuntu ~ … Read more

A useful bash shell script that will only run a command as the root user.

This is a shell script that will only run if the user executes it as the root user. I got this tip here: http://www.cyberciti.biz/tips/shell-root-user-check-script.html. #!/bin/bash     CMDROOT="yum update"   if [[ $EUID -ne 0 ]]; then echo echo "You must be a root user to run this command." 2>&1 exit 1 else echo echo … Read more

A better way to use grep to search files and folders. You do not need to use cat.

This is how to use grep to search a file without using cat. homer@neo:~/Documents$ grep "gcc" ../.bash_history gcc my.cpp gcc gcc hello.java gcc hello.java gcc hello.java gcc hello.java gcc mein.c -o mein gcc -c99 mein.c -o mein gcc -std=c99 mein.c -o mein gcc hello.c -o hello gcc hello.c -o hello gcc hello.c -o hello gcc … Read more

How to easily create a bash shell prompt for your personal use using a website interface.

The bash $PS1 generator here: http://www.kirsle.net/wizards/ps1.html allows you to create a cool bash shell prompt with a minimum of fuss. You can add colors to various parts of the prompt and make it look very nice indeed. Check it out now and see what you think. Here is one that I made. This uses tput … Read more

Some very useful online Linux resources.

http://www.scribd.com/doc/12918020/Linux-Starter-Pack; The Linux starter pack. This is very good as an introduction to the Linux desktop and the various utilities available. http://tille.garrels.be/training/bash/; Introduction to Linux guide for beginners. This is a good resource if you want to learn more about the Linux shell and usage in general. http://securitron.securitronlinux.com/lc/rute/; Rute User’s Tutorial and Exposition. The definitive … Read more

Some miscellaneous BASH tricks. Useful tips for all Linux users.

This command shows how to display a listing of files with ls and show line numbers at the same time. homer@deep-thought ~/Desktop/Site % ls | nl 1 back.jpg 2 bejiitas_phpb1 3 bejiitas_phpb1.sql 4 cgi-bin 5 Files.tar.lzma 6 Map07Tufb.zip 7 my2.tar.lzma 8 program.c 9 quake38.jpg 10 sysinfo 11 tekcrazy_2.zip 12 wrap.rarhomer@deep-thought ~/Desktop/Site % ls | nl … Read more

More awesome shell tricks for the Linux command line. This is using the bash shell.

This is another way to see where you are in the directory stack. homer@deep-thought ~/Documents/basenew $ echo $DIRSTACK ~/Documents/basenewhomer@deep-thought ~/Documents/basenew $ echo $DIRSTACK ~/Documents/basenew Here is another way to show the $PWD value one directory down from where you are now. homer@deep-thought ~/Documents/basenew $ echo $OLDPWD /home/homer/Documentshomer@deep-thought ~/Documents/basenew $ echo $OLDPWD /home/homer/Documents This example shows … Read more

How to filter text with the sed command. This is useful for various shell tricks.

Using wildcards on the Linux command line This is a standard listing of files with wildcards in the bash shell. homer@deep-thought ~/Documents $ ls *.wad basenew.wad cc4-tex.wad city-heat.wad dark.wad doom.wad plutonia.wad scythe2.wad SKYTEST.wad brick.wad cchest4.wad consoleCopy.wad doom2.wad hexen.wad RIII.wad scythex.wad SODfinal.wadhomer@deep-thought ~/Documents $ ls *.wad basenew.wad cc4-tex.wad city-heat.wad dark.wad doom.wad plutonia.wad scythe2.wad SKYTEST.wad brick.wad cchest4.wad … Read more

Cool bash shell in a web page. OMGUbuntu have done well this time.

http://www.omgubuntu.co.uk/bash/ This is a BASH shell in a web page. Check this cool trick out. They have created a cool April fools joke that all Linux users can enjoy. I wish there was a Powershell website that allowed you to use Powershell 3.0 in a web browser; but this is still very cool indeed. There … Read more

Using Powershell on Linux with the Pash console.

The Powershell console is now available on Linux with the advent of the Pash console. This allows a Linux user to use Powershell commands on Linux just as they do in Windows. The screenshot I have included shows the usage of the Powershell Get-PsDrive cmdlet. This would be a very powerful tool for administering Windows … Read more

More useful bash shell tricks. How to use keyboard shortcuts to navigate the shell easily.

Ubuntu surely is a popular desktop Linux distribution, shown around the world in television shows and on sale in China preloaded onto computers. Advertised more than Linux Mint even though that is a good Windows and Macintosh alternative as well and performs on the desktop just as well as Ubuntu. To clear the terminal window, press … Read more

A correction I have to make regarding the Powershell and wildcards. The bash shell is still better though.

I need to correct what I said in this posting: http://www.securitronlinux.com/bejiitaswrath/bash-shell-is-better-than-powershell-and-discussion-of-the-linux-desktop-versus-windows/ and also this one. regarding the Powershell and its handling of certain constructs that I mentioned in this posting: http://www.securitronlinux.com/bejiitaswrath/windows-powershell-not-as-good-as-bash-shell-and-other-thoughts/. It turns out that the Powershell does support this after all as shown in this sample below. PS C:\Users\Homer\Documents> ls STRIFE[0-9].wad   Directory: C:\Users\Homer\Documents … Read more

How to install the Nvidia drivers in Ubuntu and Linux Mint 14 via the command line easily.

To install Nvidia drivers in Linux Mint, download the drivers and save them to your home directory, then you need to log out of your desktop back to the LightDM log in manager, then press CTRL->ALT->F2 to get to the text console and log in as your user and then type the following command. sudo … Read more

Some more excellent BASH shell tricks for Ubuntu and Linux Mint.

How to filter the output of ls to only find certain files in a folder. This example will only return files that are made up of letters and end in the *.html extension. [ [email protected] ] [ Jobs 0.PWD: ~/Documents.bash 4.2.36. ] [ 9 ] [ 11:54:15 ] [ $ ]-> ls -hula [a-z]*.html -rw-r–r– … Read more

Some very good Linux resources for learning programming and BASH scripting.

http://gentoomen.org/tutorials/resources.html. The gentoomen.org resources page. Very good list of links to various tutorials and help pages. http://tldp.org/LDP/abs/html/. The Advanced BASH scripting guide. ftp://ftp.vim.org/pub/vim/doc/book/vimbook-OPL.pdf. The VIM guideboook. http://stommel.tamu.edu/~baum/programming.html. 3000 useful guides to programming and Linux documentation and help pages. http://samizdat.mines.edu/howto/HowToBeAProgrammer.html. How to be a programmer. A short but comprehensive summary. http://www.psychocats.net/ubuntu/index. Ubuntu resources page. Everything you … Read more

Windows Powershell not as good as BASH shell and other thoughts.

It is really amazing that the new Windows Powershell is moving Windows Administrators back towards the command-line instead of using the GUI for everything. Powershell has some very good features; but the difficulty I have experienced installing extra cmdlets is very grating indeed. It is better to use the BASH shell, as it is very … Read more

Re-installing the GRUB2 bootloader using a chroot with Linux Mint 14.

The Microsoft Surface tablet due to the implementation of the UEFI Secure Boot is not being very cooperative in terms of allowing the installation of Linux. This could be a very good portable tablet for running Linux on the move but if you can not overcome the limitations of the Secure Boot system then Linux … Read more

How to use aliases with the bash shell and some other useful Linux tricks.

Are you wanting to create an alias and you want to see how they are done? Well a Linux distribution should come with some aliases that are already created for you and you can type the alias ls command to see how one is created. ubuntu@ubuntu:~$ alias ls alias ls=’ls –color=auto’ubuntu@ubuntu:~$ alias ls alias ls=’ls … Read more

How to get the weather report from the command-line in America with Linux and other cool commands.

This is how to get the weather report for any American zip code with the Linux command-line. Type sudo apt-get install weather-util to install this utility on Linux Mint 14. In this example we are checking New York City. john@adeptus-mechanicus ~ $ weather 10001 Current conditions at New York City Central Park, NY Last updated … Read more

How to put line numbers on the output of a command and other useful Linux commands.

If you want to put line numbers in the output of a command; then feed it through the nl command. This will put the required line numbers there for you. [john@deusexmachina]:~/Desktop> ls -hula | nl 1 total 452K 2 drwxr-xr-x 3 john john 4.0K Nov 14 10:46 . 3 drwxr-xr-x 46 john john 4.0K Nov … Read more