Tag Archives: shell

More useful shell tricks for bash. These are very useful tricks for any Linux user.

This sed trick will filter out the unwanted characters and leave only the letters ‘A’. homer@deusexmachina ~ $ echo “###AAA” | sed ‘s/###//gi’ AAA This is how to re-bind the annoying CAPS-Lock key to Esc. This can give that key a new use. xmodmap -e ‘clear Lock’ -e ‘keycode 0x42 = Escape’ & Here is […]

Some miscellaneous Linux commands for the desktop user.

Find all files larger than 1 megabyte in a directory. find . -maxdepth 1 -type f -size +1M -printf “%f:%s\n” | sort -t”:” -k2 Search a file for a certain string. grep “hello” my.txt Get the hostname from an IP address. Homer@bejiitas – $ ipcalc -h 74.125.237.194/24 HOSTNAME=google.com Use wildcards on the command line to […]

A useful posting explaining why Linux does not need defragmenting.

If you are interested in how the Linux filesystem works, then this is a posting you really need to read: http://geekblog.oneandoneis2.org/index.php/2006/08/17/why_doesn_t_linux_need_defragmenting. This is a posting explaining how the Linux filesystem stores file and why it does not need to defragment the filesystem as it stores files more efficiently. I have never wanted to defragment a […]

Strange but useful shell trick with the bash shell.

This is a very strange shell trick that allows you to have a set of parameters to a Linux command that are separated by single quotes. [homer@localhost ~]$ df -h’l’a’T’ Filesystem Type Size Used Avail Use% Mounted on rootfs rootfs 216G 75G 130G 37% / proc proc 0 0 0 – /proc sysfs sysfs 0 […]

Some very cool Linux shell tips and tricks for old and new users alike.

Some very useful Linux shell commands and tricks. Print numbers in sequence. [homer@localhost ~]$ seq 8 24 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Print numbers in sequence, but only multiples of 8. [homer@localhost ~]$ seq 8 8 128 8 16 24 32 40 48 […]

Linux commands to find out hardware information.

Linux hardware information commands. There are many commands available for Linux that allow the user to get information about their hardware. Here is a handful of them. The lshw command. deusexmachina description: Notebook product: eME730 (Calpella_CRB) vendor: eMachines version: V1.15 serial: LXN98020810441E9781601 width: 64 bits capabilities: smbios-2.6 dmi-2.6 vsyscall32 configuration: boot=normal chassis=notebook family=Intel_Mobile sku=Calpella_CRB uuid=40198687-F9A4-2099-05F2-88AE1D6D09BC […]

Another look at the WIFI Radar application for Linux. A good tool for a wireless site survey.

The WIFI Radar application for Linux is used to perform a wireless site survey to determine the signal strength of a wireless network that you are deploying at a particular site. This application makes a survey of wireless signal strength very easy indeed. The SSID/MAC address of the access point is shown, as well as […]

How to get the MD5 sum of a file with the Linux command line and the md5sum command.

The md5sum command on Linux is used to get a number that is the checksum of the file. This is commonly used to verify downloaded files to check that the file has not been modified. Below is an example, the md5sum command is used on a BMP file and I get the file checksum output […]

How to use the watch command to update a terminal every 2 seconds with an updating file.

I am using this command to search the Internet for open ports on port 80 with nmap. sudo nmap -sS -iR 0 -p 80 -oG nmap.grepable Then I use this command in another terminal tab to view the updating file. This will be updated every two seconds with new file content. watch cat nmap.grepable This […]

How to add the output of a command when echoing text with bash.

This is how to do this; just add the backticks and you may then echo the output of the logname command in this echo string. echo “Hello `logname`, this is a nice day is it not?” This will add the output of the command by executing it and showing the output. Here we are showing […]

My sysinfo program is now on GitHub!

I have uploaded my sysinfo program to GitHub, this makes it easier for me to manage the code and have a revision control system to control changes to the code. I have added code to print information about your Motherboard and the BIOS. I wish there was a proper programming interface to get this information […]

How to setup Ubuntu 13.10 with a better desktop environment. Better than Unity.

How to setup Ubuntu 13.10 with a proper desktop environment. I just installed Ubuntu 13.10 and I had to update the package repositories. This is essential to install software. homer@deusvult:~/Documents$ sudo apt-get update After this I could install the initial set of packages to setup my system. homer@deusvult:~/Documents$ sudo apt-get install me-tv vlc ubuntu-restricted-extras smplayer […]

Common errors and troubleshooting commands for Linux.

Some useful Linux tips and troubleshooting commands. If you are getting this error when you are attempting to run Ubuntu on your PC; it is due to the fact that your CPU does not support the 64bit operating system that you are trying to run. You would need to use an i386 copy instead. How […]

Useful bash shell shortcut keys to navigate the command line.

Useful bash shell shortcut keys to navigate the command line. ^a, ^e – Move the cursor. The Ctrl-a shortcut will move the cursor to the beginning of the line. The Ctrl-e shortcut will bring the cursor to the end of the line. ^d – End of file or EOF. This tells a console application that […]

How to use Google search in a web browser. This is a bash styled shell for Google searches.

Check this website out: http://goosh.org/. This website allows you to perform Google searches using a command line like bash. Just type a search query at the command line and the results will be displayed to STDOUT. Here is an example: [email protected]:/web> linux shell 1) Linux Shell Scripting Tutorial – A Beginner’s handbook – FreeOS.com Table […]