Tag Archives: Command Line

Linux – How to Tell Which Shell

By | 2020-09-23

The easiest way to tell which shell you are using is by looking at what the exe link points to in your shell process’s /proc directory. You can use the command ls -l /proc/$$/exe. Below is an example: $ ls -l /proc/$$/exe lrwxrwxrwx 1 tyler tyler 0 Sep 22 19:39 /proc/19867/exe -> /bin/bash The special… Read More »

Listing All Users In Linux

By | 2020-09-21

Listing all users on Linux is best done with the getent passwd command. This isn’t the only way, but it should work an practically any system. Unlike other methods, it uses your systems /etc/nsswitch.conf configuration to show users from all sources. The format is the format used in the file /etc/passwd. $ getent passwd root:x:0:0:root:/root:/bin/bash… Read More »

Listing Files In a Package With DNF

By | 2020-01-04

Listing files in a package with dnf is easy. Just follow the example below: # dnf repoquery -l crontabs Last metadata expiration check: 0:12:18 ago on Sat 04 Jan 2020 09:40:27 AM EST. /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/crontab /etc/sysconfig/run-parts /usr/bin/run-parts /usr/share/licenses/crontabs /usr/share/licenses/crontabs/COPYING /usr/share/man/man4/crontabs.4.gz /usr/share/man/man4/run-parts.4.gz Replace crontabs with the name of the package you wish to… Read More »

Listing Installed Packages With DNF

By | 2019-10-21

Listing installed packages with dnf is straightforward. Unlike rpm, dnf also shows you the repository packages were installed from. The following example demonstrates listing all packages installed on a system. # dnf list installed Installed Packages acl.x86_64 2.2.53-1.el8 @anaconda audit.x86_64 3.0-0.10.20180831git0047a6c.el8 @anaconda audit-libs.x86_64 3.0-0.10.20180831git0047a6c.el8 @anaconda The left column displays the name of the package along… Read More »

How to Zip a Folder in Linux

By | 2019-09-11

Zipping a Folder Use the zip command with the -r option to zip a folder on a Linux system. For example, to zip a folder named bigfiles, you would use the following command: $ zip -r bigfiles.zip bigfiles adding: bigfiles/ (stored 0%) adding: bigfiles/bigfile2 (deflated 98%) adding: bigfiles/bigfile3 (deflated 96%) adding: bigfiles/bigfile1 (deflated 97%) After… Read More »

How to Rename a File in Linux

By | 2019-09-10

To rename a file in Linux, you use the mv command. The mv command can also rename directories and move files into different directories. When using mv, always specify the current filename first, followed by one or more spaces, and last the new name. For example, to rename a file named my_file.pdf to your_file.pdf, use… Read More »