How to list folders starting with a dot on Linux. This is very useful.

This is how to list all directories starting with a . on Linux. This is a very useful Linux trick. ┌──(john㉿DESKTOP-PF01IEE)-[~] └─$ ls -ld .*/ drwxr-xr-x 11 root root 4096 Feb 12 09:02 ../ drwxr-xr-x 21 john john 4096 Jun 15 15:58 ./ drwx—— 3 john john 4096 Feb 8 07:38 .BurpSuite/ drwx—— 7 john … Read more

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 AEDT ************************INTERFACES************************ DEV (SHORT) IP/MASK … 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 is worth listing it anyway. … Read more

A good way to list valid users in the /etc/passwd file on Linux.

This one-liner will display all users with UIDs over 999 and under 2000. This includes valid users on an Ubuntu system but may be different on other machines. ┌──[[email protected]]─[~/Documents] └──╼ ╼ $ awk -F: ‘{if($3>999 && $3<2000)print $1,$3,$6}’ /etc/passwd jason 1000 /home/jason kirk 1001 /home/kirk┌──[[email protected]]─[~/Documents] └──╼ ╼ $ awk -F: ‘{if($3>999 && $3<2000)print $1,$3,$6}’ /etc/passwd … 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 linux-image-5.3.0-24-lowlatency Reinstall: linux-image-5.3.0-24-lowlatency:amd64 (5.3.0-24.26~18.04.2) Commandline: … Read more

How to list all symbolic links in a directory easily with the shell.

List all symbolic links in a folder is very easy, this is how to find just the symlinks and not bother with any other files. This example shows how to use the find command to do this. 4.4 Tue Feb 04 jason@Yog-Sothoth 0: $ find . -type l ./boom ./chocolate-strife-setup ./LS ./heretic ./doom ./cowthink ./chocolate-doom-setup … 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 jason@Yog-Sothoth 0: $ cat /etc/mtab … 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]─[~] └──╼ $dpkg –contents brave.deb List all … 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 PROC PWD-LOCK PWD-DENY LAST-LOGIN GECOS … 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 FSTYPE OPTIONS / /dev/mapper/fedora-root ext4 … 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 jason jason 4096 Oct 9 … Read more

How to list all gnome or Firefox packages on your Debian or Ubuntu system.

This command will list all Gnome packages that are currently installed on your Debian system and can be uninstalled. 4.4 Mon Sep 10 jason@Yog-Sothoth 0: $ dpkg –get-selections | grep gnome | cut -f 14.4 Mon Sep 10 jason@Yog-Sothoth 0: $ dpkg –get-selections | grep gnome | cut -f 1 This example lists all Doom … Read more

How to list all dotfiles in your home directory with a nice on-liner.

This nice on-liner will list all dotfiles in your home directory that start with b to z. Another good way to accomplish this task. jason@Yog-Sothoth » ~ » $ ls -hula -d .[b-z]* |grep -v ^d -rw——- 1 jason jason 13K Jun 20 10:45 .bash_history -rw-r–r– 1 jason jason 220 Jun 20 10:45 .bash_logout -rw-rw-r– … 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 root 17K Mar 5 13:26 … Read more