Skip to content

Latest commit

 

History

History
372 lines (245 loc) · 4.29 KB

cheat-sheet.md

File metadata and controls

372 lines (245 loc) · 4.29 KB

CheatSheet


Pacman

Install packages:

sudo pacman -Syu [PackageName]

Uninstall packages:

sudo pacman -Rns [PackageName]

Search for a package:

pacman -Ss [PackageName]

Query package info:

sudo pacman -Fy [PackageName]

Update installed packages:

sudo pacman -Syu

Check for updates:

sudo pacman -Syu 

Clean cache:

sudo pacman -Scc

Maintenance

Generates a random mirrorlist for the users and sort them by their current access time.

sudo pacman-mirrors --fasttrack

Generate cache list:

du -sh ~/.cache/*

Purge files not accessed in 100 days:

find ~/.cache/ -type f -atime +100 -delete

Report journal current size:

journalctl --disk-usage

Remove but recent entries by size or time:

journalctl --vacuum-size=50M
journalctl --vacuum-time=2weeks

Check for orphaned packages:

pamac list -o

Remove all orphans:

pamac remove -o

Remove all packages except the latest 3 versions:

pamac clean --keep 3

AUR

Search for package

pamac search -a [PackageName]

Build the package

pamac build [PackageName]

Access rights

Execute command as root

sudo [command]

Empty password cache

sudo -k

Change user password

passwd username

Change owner and group of file

chown [owner]:[group] -c [file]

Change file permissions

chmod [permissions] -c [file]

Set permissions in octal mode: 4(read) 2(write) 1(execute)

Example: 755 read-write-execute for owner and read-execute for group and others

Display files and permissions [of directory]

ls -lh [dir]

Files and Directories

Change the working directory

cd [dir]

Change to parent directory

cd ..

List directory contents

ls -l

List also hidden files

ls -la

Copy file

cp [file] [target]

Copy directory recursively

cp -r [directory] [target]

Move or rename file/directory

mv [source] [target]

Remove directory recursively

rm -r [dir]

Create symbolic link

ln -s [target] [link]

Mount filesystem

mount -t [type] [/dev/sdx9] [mountpoint]

Mount ISO image

mount -o loop [iso] [mountpoint]

Home directory of user

cd /home/$USER
cd ~

Directory with global configurations

cd /etc

Network

Display network information

nmcli

List wireless access points

nmcli c

Enable firewall [package Community: ufw]

ufw enable

Allow/deny all incoming traffic

ufw default [allow/deny]

Displays firewall status and rules

ufw status

Allows/deny incoming traffic on the specified port

ufw [allow/deny] [port]

Allows/deny incoming traffic from specified IP address

ufw [allow/deny] from [ip]

System and Screen

Display kernel version

uname -r

Display long kernel version

uname -a

Report file system disk space usage

df [/] [/home]
sudo btrfs filesystem usage -h [/]

Display system tasks

top
htop

Display system information

inxi --admin --verbosity=7 --filter --width

Display a tree of processes

pstree

Switch to tty

    Ctrl+Alt+F1
    Ctrl+Alt+F2
    Ctrl+Alt+F3
    Ctrl+Alt+F4
    Ctrl+Alt+F5
    Ctrl+Alt+F6

Switch to the X session

Ctrl+Alt+F7

Start a unit user $ systemctl start unit

Stop a unit user $ systemctl stop unit

Check status of a unit user $ systemctl status unit

Enable a unit user $ systemctl enable unit

Disable a unit user $ systemctl disable unit

Restart a unit user $ systemctl restart unit

Shut down the system user $ poweroff

Restart the system user $ reboot

Configure accents

Go to: System Settings \ Keyboard \ Key Bindings

Enable checkbox on Configure keyboard options.

Select and expand on the list: Position of Compose key: Right Alt, and click to Apply button.

For example:

  1. To type canción, canci and press Right Alt + ' and then leter o and you have ó, continue ón
  2. To type compañero, compa and press Right Alt + Shift + ~ and then letter n and you have ñ, continue ñero.