top of page
  • Bankim Bhagat

Useful Linux Commands

Updated: May 26

These are the commands that a Systems Administrator or a DevOps Engineer needs on a daily basis


Basic Configuration Commands

  • Set TimeZone

dpkg-reconfigure tzdata
  • Set Hostname

sudo hostnamectl set-hostname exampl.com 

SCP Command

Usage

Copy a single file

scp file.txt user@remote_ip:/remote/directory

Copy a folder

scp -r /local/directory user@remote_ip:/remote/directory

Copy file between two remote servers

scp user1@remote_ip1:/files/file.txt user2@remote_ip2:/files

Copy file from a remote server

scp user@remote_ip:/remote/file.txt /local/directory

Deflate .tgz file

Usage

tar -xvzf /path/to/yourfile.tgz

where,

  • x for extract

  • v for verbose

  • z for gnuzip

  • f for file, should come at last just before file name.

Package Manager Commands

Update APT Silently

sudo apt -qqy update

Docker Commands


Disk Commands

  • Check Read Speeds

sudo dd if=/dev/zero of=/dev/nvme0n1 bs=1G count=1 oflag=direct
  • Check Write Speeds

sudo dd if=/dev/nvme0n1 of=/dev/null bs=1G count=1 iflag=direct
  • Run Long SMART Tests on SATA Drives

sudo smartctl -t long /dev/sdX
  • Check SMART Test Results

sudo smartctl -a -d ata /dev/sdX
  • Check NVMe Details

First install nvme-cli

sudo apt install nvme-cli

Run nvme smart log command

sudo nvme smart-log /dev/nvme0

Run long tests on NVMe using nvme-cli

nvme device-self-test --self-test-code 2h /dev/nvme0

More info about the NVMe can be obtained using SMART

sudo smartctl --info /dev/nvme0n1

7 views0 comments

Recent Posts

See All

Here is a comparison of the Logitech B100 Optical Mouse, HP Wired Mouse 100, and Dell MS116 Wired Optical Mouse: As you can see, the HP Wired Mouse 100 has the highest DPI of the three mice, making it

bottom of page