How to change the shell for a user on a Linux system easily with the usermod command.

I recently created a new user with the adduser command. [email protected]:~/Documents$ sudo adduser jimkirk Adding user `jimkirk’ … Adding new group `jimkirk’ (1002) … Adding new user `jimkirk’ (1002) with group `jimkirk’ … Creating home directory `/home/jimkirk’ … Copying files from `/etc/skel’ … Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully […]


Read more...

How to print out a list of all BBC news headlines with the command line. This is very cool.

This simple one-liner will print out all of the news headlines from the BBC news website in a simple text format. This is useful if you want to do something with a list like this. Or if you just want a listing to see if there is anything interesting happening. [email protected]:~$ curl -s http://feeds.bbci.co.uk/news/rss.xml | […]


Read more...

A useful script for gaining information about your Ethernet adapter.

This useful shell script will print information about your Ethernet or Wireless adapter. This is very useful for getting a lot of information at once. #!/bin/sh   DEV="eno16777736"   echo "Showing information for the active network interface: $DEV."   echo -e "-*- \e[1mGet timestamping information for your Ethernet device.\e[0m -*-" echo   ethtool -T $DEV […]


Read more...

Some useful Linux scripts for the desktop Linux user who likes the command line.

There are many useful Linux tips that make the life of a Linux user much easier. One is for the VI or VIM editor. To open a file at a specific line; use this command. [email protected] ~/Documents/yadex-1.7.901 $ vim src/x11.h +33 This will open the file x11.h at line 33. How to ssh into a […]


Read more...

How to copy files from one machine to another using SSH and the sftp command.

The sftp command allows a user to retrieve files on a remote machine and save them on their computer. Use this command to access the files: sftp -P 443 [email protected]:/home/homer/Downloads/*.pdf I have my SSH server running on port 443, so I need to specify that port when using this command. I am using Cygwin on […]


Read more...

Useful shell script that may be used to create a whole host of user accounts easily.

This bash shell script is useful for creating a new user and setting a password for that user. This allows you to just type a username and password and everything else is done for you. Very useful for someone who is in a hurry. #!/bin/bash   echo "Type a username for your new account: " […]


Read more...

How to use the touch command to create a file with an arbitrary filename.

The touch command ordinarily does not allow the user to create files with a filename like –rf, but if you want to really annoy someone then you may use this command to create one. [email protected]:~$ touch — ‘–rf ‘ And now you have a file named –rf. -rw-r–r– 1 homer homer 0 Jun 28 16:26 […]


Read more...

A quick look at redirection in the bash shell.

The bash shell allows the user to redirect output from one application to another or to a file. This is very useful when you are building a one liner script to perform a certain action. Here is a simple redirection. ls > ls.out This redirects the output of the ls command to a file that […]


Read more...

How to change the default plymouth theme manually on Ubuntu 14.10.

Changing the default plymouth theme on Ubuntu 14.10 is not very difficult. Just type this at the shell prompt. This will set the new theme. [email protected]:~# update-alternatives –install /lib/plymouth/themes/default.plymouth default.plymouth /lib/plymouth/themes/ubuntustudio-logo/ubuntustudio-logo.plymouth 100 Now we need to save our changes. [email protected]:~# update-alternatives –config default.plymouth There are 5 choices for the alternative default.plymouth (providing /lib/plymouth/themes/default.plymouth).   Selection […]


Read more...

Some useful Linux commands and tricks for the bash shell user.

The boxes utility for Linux allows you to render an ascii text box around text. Below is an example. [email protected] 19:14:21 ~ $ echo `echo "This is a sentence printed to the terminal."` | boxes /***********************************************/ /* This is a sentence printed to the terminal. */ /***********************************************/ This is a useful utility if you want […]


Read more...

Useful Macintosh OSX terminal commands to get information about your iMac.

The mount command shows information about your mounted partitions on your machine. iMac305:~ admin$ mount /dev/disk0s2 on / (hfs, local, journaled) devfs on /dev (devfs, local, nobrowse) map -hosts on /net (autofs, nosuid, automounted, nobrowse) map auto_home on /home (autofs, automounted, nobrowse) map -fstab on /Network/Servers (autofs, automounted, nobrowse) /dev/disk0s3 on /Volumes/Scratch (hfs, local, journaled) […]


Read more...

Using tcpdump to capture packets with a wireless connected computer.

Use this command to capture packets with the tcpdump command. This will output to STDOUT, but you may use redirection to divert it to a text file. [[email protected] homer]# tcpdump -i wlp2s0 This is the output that you get when you are capturing packets. This is on my home network, so there are not many […]


Read more...

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’. [email protected] ~ $ 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 […]


Read more...

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. [email protected] – $ ipcalc -h 74.125.237.194/24 HOSTNAME=google.com Use wildcards on the command line to […]


Read more...

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 […]


Read more...

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. [[email protected] ~]$ 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 […]


Read more...

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. [[email protected] ~]$ 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. [[email protected] ~]$ seq 8 8 128 8 16 24 32 40 48 […]


Read more...

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 […]


Read more...

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 […]


Read more...

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 […]


Read more...