How to list interfaces with Nmap. This is a very useful tip.

It is possible to list interfaces with Nmap. This is a good way to see all active network devices attached to your computer. Use the –iflist parameter as shown below to show all network interfaces on your machine. jason@jason-Lenovo-H50-55:~$ nmap –iflist Starting Nmap 7.80 ( https://nmap.org ) at 2022-03-18 10:38…

Read More

Very useful Linux tips for getting information on current logins.

There are many ways to get detailed information on known users on your Linux system. The lslogins command is therefore very useful for listing all usable login accounts. The below example will list all user accounts including the root account. This might be disabled on an Ubuntu system, but it…

Read More

How to list previously installed packages from the apt history.

This is how to get information about recently installed packages on Ubuntu. This is looking at the lowlatency package I just installed. 4.4 Thu Jun 04 jason@Yog-Sothoth 0: $ grep "lowlatency" /var/log/apt/history.log | sed "s/ /\n/gi"; Commandline: apt install linux-image-5.3.0-24-lowlatency Install: linux-image-5.3.0-24-lowlatency:amd64 (5.3.0-24.26~18.04.2), linux-modules-5.3.0-24-lowlatency:amd64 (5.3.0-24.26~18.04.2, automatic) Commandline: apt-get install –reinstall…

Read More

List all SCSI hard disks in your Linux system.

This command will list all installed hard disks in your system. This is using the -S parameter to only list SCSI devices. 𒅑 4.4 Mon Mar 23 jason@Yog-Sothoth 0: $ lsblk -n -S sda 0:0:0:0 disk Seagate Expansion Desk 0911 usb sdb 1:0:0:0 disk ATA ST3500418AS CC38 sata sdc 3:0:0:0…

Read More

A one-liner that will list only the mounted removable drives on your system.

This command will only list the mounted removable drives on your Linux system. The ones under /dev/sd*. This is very easy to use. 4.4 Mon Jan 13 jason@Yog-Sothoth 0: $ cat /etc/mtab | grep /dev/s[a-f]/* /dev/sda2 /media/jason/Seagate\040Expansion\040Drive fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0 /dev/sdb4 /media/jason/My\040Stuff fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 04.4 Mon Jan 13…

Read More

List the contents of a deb package before installation.

A Debian deb package is an archive that contains files to be installed on your system. There are ways to list the contents of a deb package before installation. Use the dpkg(1) command to achieve this easily. List all files in the deb archive. ┌─[✗]─[jason@darkstar]─[~] └──╼ $dpkg –contents brave.deb┌─[✗]─[jason@darkstar]─[~] └──╼…

Read More

Get information about users on your Linux system easily.

A Linux system can have a lot of users in the /etc/passwd file. But it is easy to keep track of your users with the command line. The lslogins command will print a listing of known users on your Linux system. An example of the usage. jason@jason-Virtual-Machine:~$ lslogins UID USER…

Read More

More very useful tricks with awk on Linux.

Printing user information such as the username and home directory for each user on your system is very easy with awk. Use this simple post to get this information. This will help you out if there are a lot of users on your system and you wish to list them all.

Read More

List all drives on your system that are actually mounted.

How to list all drives on your Linux computer that are actually mounted. The findmnt utility can do this for you. It prints a tree listing of all mounted partitions on your Linux machine. The output below is an example. 4.4 Wed Feb 13 jason@Yog-Sothoth 0: $ findmnt TARGET SOURCE…

Read More

How to list only directories with the ls command on Mac OSX.

The ls command on Mac OSX works a little differently than on a Linux machine, but listing only directories is very simple. This is one example, using only the ls command. deusexmachina:Documents jason$ ls -ld — */ drwxr-xr-x 3 jason staff 102 5 Mar 2018 POL/ drwxrwxrwx 31 jason staff…

Read More

Interesting Linux commands that might be very useful.

List only directories with the Linux command line. This lists a directory with all folders listed first, then return only the listing of folders in the directory. 4.4 Tue Oct 09 jason@Yog-Sothoth 0: $ ls –color=auto –group-directories-first -Hul | head -n `echo */ | wc -w` total 3866624 drwxrwxrwx+ 6…

Read More

Good way to list multiple logfiles on Linux.

This is a a good way to list multiple logfiles, this will list the main logfile and all of the backups. jason@Yog-Sothoth » ~ » $ ls -hula /var/log/dpkg.log{,.[0-9].gz} -rw-r–r– 1 root root 280K Jun 1 09:08 /var/log/dpkg.log -rw-r–r– 1 root root 23K Apr 2 06:48 /var/log/dpkg.log.2.gz -rw-r–r– 1 root…

Read More