How to use rsync to copy files from one computer to another.

This is an example where I am using the rsync command to copy files from one computer to another. homer@deusexmachina ~ $ rsync -avz -e "ssh -p 443" [email protected]:/home/homer/Desktop/ /home/homer/Videos The authenticity of host ‘[192.168.100.4]:443 ([192.168.100.4]:443)’ can’t be established. ECDSA key fingerprint is ############################################. Are you sure you want to continue connecting (yes/no)? yes Warning: … 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. homer@deusexmachina ~/Documents/yadex-1.7.901 $ vim src/x11.h +33homer@deusexmachina ~/Documents/yadex-1.7.901 $ vim src/x11.h +33 This will open the file x11.h at line 33. … 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. homer@debian:~$ touch — ‘–rf ‘homer@debian:~$ touch — ‘–rf ‘ And now you have a file named –rf. -rw-r–r– 1 homer homer … Read more

How to update the grub menu manually on Kali Linux.

The update-grub command will update the grub menu on Kali Linux. root@kali:~# update-grub Generating grub.cfg … Found background image: /usr/share/images/desktop-base/desktop-grub.png Found linux image: /boot/vmlinuz-3.12-kali1-amd64 Found initrd image: /boot/initrd.img-3.12-kali1-amd64 Found memtest86+ image: /boot/memtest86+.bin Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin No volume groups found doneroot@kali:~# update-grub Generating grub.cfg … Found background image: /usr/share/images/desktop-base/desktop-grub.png Found linux image: /boot/vmlinuz-3.12-kali1-amd64 Found … Read more

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

Change the default Plymouth theme on Ubuntu 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. root@homer-eME730:~# update-alternatives –install /lib/plymouth/themes/default.plymouth default.plymouth /lib/plymouth/themes/ubuntustudio-logo/ubuntustudio-logo.plymouth 100root@homer-eME730:~# 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. root@homer-eME730:~# update-alternatives –config … 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)iMac305:~ … Read more

My useful system information script for any Linux user who wants quick system information.

This is a system information script I am working on. This shows some useful information about your Linux system. #!/bin/bash   echo " My System information script." echo " " echo " "   echo "The computer has: $(awk < /proc/meminfo ‘{ if ($1 == "MemTotal:") { print $2 }}’) Kilobytes of RAM." echo "The … Read more

How to use the ping command in a script to get an IP address automatically and ping it.

This command will get the IP address from the interface supplied and then ping it. ping $(ifconfig enp6s1 | awk ‘/inet / { print $2 } ‘ | sed -e s/addr://)ping $(ifconfig enp6s1 | awk ‘/inet / { print $2 } ‘ | sed -e s/addr://) Here is an example. This shows how well this … Read more

How to list all iptables rules that are set on your Linux system. This is very easy.

The iptables -L or iptables –list commands will list all of the iptables rules that are set on your Linux machine. Below is the abbreviated output of this command on my Fedora Linux system. [root@localhost homer]# iptables –list Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all — anywhere anywhere ctstate RELATED,ESTABLISHED ACCEPT … Read more

Using the tar command on Linux to uncompress tar.gz files with the command line.

The tar command on Linux is very useful for uncompressing files on your Linux machine. The most used command on a Linux system is uncompressing files that you have downloaded from an Internet source. The tar -xvf command will uncompress a tar.gz file. ~$ tar -xvf myfile.tar.gz~$ tar -xvf myfile.tar.gz To uncompress a tar.bz2 file … Read more

Another way to print your IP address in Linux. This is a very useful one liner.

This simple one liner will print out your IP address and then IPv6 equivalent if you have it set. [homer@localhost ~]$ ifconfig enp6s1 | awk ‘/inet/ { print $2 } ‘ | sed -e s/addr:// 192.168.1.2 fe80::213:46ff:fe3a:283[homer@localhost ~]$ ifconfig enp6s1 | awk ‘/inet/ { print $2 } ‘ | sed -e s/addr:// 192.168.1.2 fe80::213:46ff:fe3a:283 Here … 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 is very useful for getting information about your installed hardware. ubuntu ~ $ sudo lshw -short H/W path Device Class Description ============================================================================================================================================== system HVM domU … 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

How to search and replace text in a file with sed. Not using cat.

The sed command is very useful for searching and replacing text in a file. This is how to search for and replace a text string in a file. Homer@bejiitas ~ $ sed -i ‘s/<main>/<mein>/gi;’ my.cHomer@bejiitas ~ $ sed -i ‘s/<main>/<mein>/gi;’ my.c This is how to search and replace text in a file and leave a … Read more

Looking at the Macintosh OSX desktop and the Darwin UNIX operating system.

I am having a quick look at the Macintosh OSX desktop on an Apple Macintosh computer and the interface is very annoying indeed. The Finder does find files; but most of the results are not what you were looking for. And to take a screenshot you have to use quite a complex combination of keys … Read more

How to add a user to the sudoers file to allow them to use the sudo command.

How to add a user to the sudoers file to allow them to use the sudo command. The /etc/sudoers file contains definitions of all the users that are allowed to use superuser privileges on Linux to perform various tasks as an administrator. This is how to add a user to this file to allow them … Read more

How to use the interactive features of the Linux rm command.

In this example; I am using the -i parameter to the rm command to ask for permission before erasing a file. This is very useful if you want to be sure that you are wiping the correct file. homer@deep-thought ~/Documents $ rm -i thoughts.txt rm: remove regular file ‘thoughts.txt’? yhomer@deep-thought ~/Documents $ rm -i thoughts.txt … Read more