How to find a file with Linux using the command line.

The Linux command line offers useful tools that enable you to find files easily. The find command is one useful example. Here I am using the find command to look for all *.png files in a folder. homer@deusexmachina ~/Documents $ find /usr/share/backgrounds -name "*.png" /usr/share/backgrounds/linuxmint-petra/linux_mint_16.png /usr/share/backgrounds/linuxmint-petra/petra.png /usr/share/backgrounds/warty-final-ubuntu.pnghomer@deusexmachina ~/Documents $ find /usr/share/backgrounds -name "*.png" /usr/share/backgrounds/linuxmint-petra/linux_mint_16.png /usr/share/backgrounds/linuxmint-petra/petra.png … 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

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

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.grepablesudo 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 … Read more

How to use the hping3 command on Linux to ping websites with TCP SYN packets instead of ICMP.

This posting will explain the workings of the hping3 command. This is a command that may be run as the superuser to ping a website with TCP packets instead of the default ICMP packets used by the ping command. This is an example; I am sending some TCP SYN packets to the http://hackthissite.com to ping … Read more

My sysinfo program updated with new code. Even better than before!

https://github.com/john302/sysinfo. This is the link to my newly updated sysinfo program. This has code added using the sysinfo struct. This means that the memory and uptime information that is output is actually readable now. This is what the output of the memory and uptime section looks like now. homer@deusvult:~/Documents/sysinfo.kdevelop-1.0$ ./sysinfo 2 System information. System uptime … Read more

How to create users on a Linux system in batches with the newusers command.

The newusers command available on Linux allows you to create users in batches. This could also be automated with a shell script and quickly done on a new system that is to be shared by many users. anders:754787547:1500:1500:Anders Smith:/home/anders:/bin/bash johnc:4767577474:1501:1501:John Citizen:/home/johnc:/bin/bash akmed:4565y4gr454h:1502:1502:Akmed Islam:/home/akmed:/bin/bashanders:754787547:1500:1500:Anders Smith:/home/anders:/bin/bash johnc:4767577474:1501:1501:John Citizen:/home/johnc:/bin/bash akmed:4565y4gr454h:1502:1502:Akmed Islam:/home/akmed:/bin/bash Above is the list of new users. … Read more

Some useful Linux tips for users that want the most out of the command-line. How to work with zipfiles.

How to unzip files into a specific directory on your system. Just type the unzip command like this: unzip [zipfile.zip] -d [directoryname] homer@deep-thought ~/Downloads $ unzip gzdoom-bin-1-8-02.zip -d myfolder/ Archive: gzdoom-bin-1-8-02.zip inflating: myfolder/fmodex.dll inflating: myfolder/gzdoom.exe inflating: myfolder/brightmaps.pk3 inflating: myfolder/gzdoom.pk3 inflating: myfolder/lights.pk3 inflating: myfolder/licenses.ziphomer@deep-thought ~/Downloads $ unzip gzdoom-bin-1-8-02.zip -d myfolder/ Archive: gzdoom-bin-1-8-02.zip inflating: myfolder/fmodex.dll inflating: myfolder/gzdoom.exe … Read more

How to change your username on Linux with the command-line. This is very easy indeed.

To change the username of an already created account on a UNIX or Linux system just follow this simple guide. I am changing the username mailman to mailman2. Firstly; open the /etc/shadow file with the VIM editor. homer@deep-thought ~ % sudo vim.tiny /etc/shadowhomer@deep-thought ~ % sudo vim.tiny /etc/shadow Then find the entry you are after … Read more

How to get the weather forecast for your US postcode using the weather command.

Getting the weather forecast for your US postcode is very simple when you are running either Ubuntu or Linux Mint. The weather-util package contains the weather command that makes this possible. Use this command to install the weather-util package. sudo apt-get install weather-utilsudo apt-get install weather-util This is the output that you get when you … Read more

How I re-installed the fglrx ATI drivers after installing a different kernel on Linux Mint 14.

I recently installed a different kernel on Linux Mint 14 and my ATI drivers were not working. To fix this I had to install the kernel headers for the appropriate kernel that I was running. john@adeptus-mechanicus ~ $ sudo apt-get install linux-headers-3.5.0-25-lowlatencyjohn@adeptus-mechanicus ~ $ sudo apt-get install linux-headers-3.5.0-25-lowlatency Then I could navigate to the directory … Read more

How to edit user accounts on Linux Mint with the usermod command.

The usermod command offers the Linux user the ability to edit user accounts or lock out a user as well as changing the users login shell. Here I am editing the comment about the user “hoshi”. adeptus-mechanicus ~ # usermod -c "New user" hoshiadeptus-mechanicus ~ # usermod -c "New user" hoshi This command parameter changes … Read more

How to install a Debian *.deb file on Ubuntu and other useful Linux tips.

To install a Debian *.deb packages that you have downloaded, use this command. john@adeptus-mechanicus ~/Downloads $ sudo dpkg -i rxvt_2.6.4-14_i386.debjohn@adeptus-mechanicus ~/Downloads $ sudo dpkg -i rxvt_2.6.4-14_i386.deb This will install the Debian package. john@adeptus-mechanicus ~/Downloads $ sudo dpkg -i rxvt_2.6.4-14_i386.deb [sudo] password for john: Selecting previously unselected package rxvt. (Reading database … 281734 files and directories … Read more

How to get to safe mode in Windows 8 Pro final release.

This is not really applicable to Linux, but I am running Windows 8 Pro dual booted with Linux Mint 14 and I encountered a bug that stopped Windows 8 from fully starting up. I found out that if you press the F5 key just after booting Windows 8 you will see the test “Please Wait” … Read more

How to use the Linux cat command to read the contents of a folder. This is a cool trick.

This is a neat trick that allows you to use cat to view the contents of a directory. This library is loaded before the cat command is executed and modifies its behavior to allow you to use cat to list a directory. #include <unistd.h> #include <stdio.h> #include <dirent.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> #include … Read more

Very cool and interesting Linux commands.

How to search your home directory for certain files. The find command is very useful for searching your computer for various files. john@adeptus-mechanicus ~ $ find /home/$LOGNAME -name "*.avi" /home/john/Azureus Downloads/[ www.Torrenting.com ] – The.Hobbit.2012.DVDSCR.XVID-NYDIC/The.Hobbit.2012.DVDSCR.XVID-NYDIC.avi /home/john/Azureus Downloads/[ www.Torrenting.com ] – The.Hobbit.2012.DVDSCR.XVID-NYDIC/sample/sample.avijohn@adeptus-mechanicus ~ $ find /home/$LOGNAME -name "*.avi" /home/john/Azureus Downloads/[ www.Torrenting.com ] – The.Hobbit.2012.DVDSCR.XVID-NYDIC/The.Hobbit.2012.DVDSCR.XVID-NYDIC.avi /home/john/Azureus Downloads/[ … Read more

Using the iostat command to keep track of disk usage on Linux.

This example shows the iostat command printing information about disk usage on my Ubuntu system. jason@jason-desktop:~$ iostat Linux 4.6.0-rc1-jason (jason-desktop) 01/05/16 _x86_64_ (4 CPU)   avg-cpu: %user %nice %system %iowait %steal %idle 2.50 0.43 1.28 24.37 0.00 71.42   Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn sda 1.49 147.22 0.00 64455 0 sdb 0.41 14.30 0.00 … Read more

The iftop command. A good way to keep track of network usage on Linux.

The monitoring of your network interfaces just got a little easier with the iftop command. This command will return information about a certain network interface and will allow you to see who is hogging your bandwidth. Read more here: http://linux.die.net/man/8/iftop. This is one very useful Linux command. Start it like this if your network interface … Read more