Past

CLI Backups

 

Backup Documents with cpio

find Documents/ -depth -type f -print | cpio -ocv > /run/media/terry/3aaa1179-976c-4cac-b74c-5d41b713ffa6/Backups/Laptop/Documents.cpio

To view contents of backup file:

cpio -vt /run/media/terry/3aaa1179-976c-4cac-b74c-5d41b713ffa6/Backups/Laptop/Documents.cpio

 

Backup Pictures/ directory with cpio

find Pictures/ -depth -type f -print | cpio -ocv > /run/media/terry/3aaa1179-976c-4cac-b74c-5d41b713ffa6/Backups/Laptop/Pictures.cpio

cpio -vt /run/media/terry/3aaa1179-976c-4cac-b74c-5d41b713ffa6/Backups/Laptop/Pictures.cpio

 

 

 

Backups with tar:

We can create a simple script for backups with tar:

cd bin/

vi tar_backup.sh

#!/bin/bash

BACKUPTIME=`date +%b-%d-%y` #get the current date

DESTINATION=/run/media/terry/3aaa1179-976c-4cac-b74c-5d41b713ffa6/Backups/Laptop/Documents-$BACKUPTIME.tar.gz

SOURCEFOLDER=/home/terry/Documents

tar -cpzf $DESTINATION $SOURCEFOLDER #create the backup

chmod +x tar_backup.sh

sh ~/bin/tar_backup.sh

tar -tf /path/to/Documents-01-2020.tar.gz

 

 

 

 

Hardware Identification

 

Hardware & Software Information

 

ls /proc

cd /proc

less cpuinfo

less meminfo

less devices

less modules

less version

less uptime

uptime

 

less interrupts

less iomem

less ioports

less scsi/scsi

 

cd bus

less devices

cd /sys (hardware info a “tree” structure)

 

cd bus/

ls

cd pci/

ls

 

 

lsusb    #Show usb devices

hwinfo    #Lots of hardware information

lspci      #Show pci devices and more

lspci -k | less

 

sudo dmidecode   #Lots of hardware information

 

AUR

 

Dec 8, 2018

Search for available Arch User Repositories packages:

https://aur.archlinux.org/

or just do a google search <package-name> archlinux and you will find the package for Archlinux whether it’s AUR or in the regular repositories.

To install AUR packages, download snapshot, unpack it, cd to resulting directory,
makepkg -sri

 

less PKGBUILD  look over the PKGBUILD file to see what it’s going to do

pacman -sri     will install AUR package along with dependencies as long is
                           dependencies are on Archlinux official repositories.

-s        Install missing dependencies using pacman. When build-time or
           run-time dependencies are not found, pacman will try to resolve
           them. If successful, the missing packages will be downloaded and
           installed.

-r        Upon successful build, remove any dependencies installed by makepkg
           during dependency auto-resolution and installation when using -s.

-i         Install or upgrade the package after a successful build using
           pacman(8).

For more detailed information see:

https://wiki.archlinux.org/index.php/Arch_User_Repository

https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages


 

pacman

Dec 7, 2018

 

pacman --help show available switches ( basic)

 

sudo pacman -Syu upgrade the entire system

-S - synchronize packages

-y - refresh

-u - upgrades all packages that are out-of-date

 

sudo pacman -S <package-name> install a package

 

sudo pacman -R <package-name> remove package

sudo pacman -Rs <package-name> remove package and package’s dependencies (it

will not remove dependencies that are needed by other applications)

 

pacman -Ss <package-name> search for packages by name on remote repositories

pacman -Qs <package-name> search the local machine for installed package

 

pactree <package-name>  view the dependant tree of a package, pass the reverse
                                                   flag -r to pactree, or use whoneeds from pkgtoolsAUR. 

pacman -Qdt    list all packages no longer required as dependencies (orphans)


Removing unused packages (orphans)

For recursively removing orphans and their configuration files:

sudo pacman -Rns $(pacman -Qtdq)

If no orphans were found pacman outputs error: no targets specified. This is expected as no arguments were passed to pacman -Rns.

Note: The arguments -Qt list only true orphans. To include packages which are optionally required by another package, pass the -t flag twice (i.e., -Qtt).

 

 

pacman tips and tricks: https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks

 

Archlinux pacman wikipedia: https://wiki.archlinux.org/index.php/pacman

 

 

April 14, 2018 Meeting

 
<< Start < Prev 1 2 3 4 5 Next > End >>

Page 1 of 5