Manjaro Difference between revisions of "CheatSheet"

Difference between revisions of "CheatSheet"

From Manjaro
(Network)
(Rest)
Line 67: Line 67:
allows/denies incoming traffic from specified IP address {{UserCmd|command=ufw [allow/deny] from [ip]}}
allows/denies incoming traffic from specified IP address {{UserCmd|command=ufw [allow/deny] from [ip]}}


=== Your sub title ===
=== System and Screen ===
Display kernel version {{UserCmd|command=uname -r}}
Display long kernel version {{UserCmd|command=uname -a}}
Report file system disk space usage {{UserCmd|command=df [/] [/home]}}  {{UserCmd|command=sudo btrfs filesystem usage -h [/]}}
Display system tasks  {{UserCmd|command=top}}  {{UserCmd|command=htop}}
Display system information {{UserCmd|command=inxi --admin --verbosity=7 --filter --width}}
Display a tree of processes  {{UserCmd|command=pstree}}
 
Switch to tty  {{key press|Ctrl|Alt|F[1..6]}}
 
Switch to the X session {{key press|Ctrl|Alt|F7}}
<span style="color: red; text-decoration: line-through;">starts a daemon {{UserCmd|command=rc.d start [daemon]}}
</span>
<span style="color: red; text-decoration: line-through;">stops a daemon {{UserCmd|command=rc.d stop [daemon]}}</span>
<span style="color: red; text-decoration: line-through;">restarts a daemon {{UserCmd|command=rc.d restart daemon}}</span>
Shut down the system {{UserCmd|command=shutdown -h now}}
Restart the system {{UserCmd|command=shutdown -r now}}
 
=== Your sub title ===
=== Your sub title ===
=== Your sub title ===
=== Your sub title ===

Revision as of 18:40, 4 February 2022

CheatSheet for Manjaro

The original startet with a thread at https://forum.manjaro.org/t/manjaro-cli-cheat-sheet/101305/3

Locating and Installing Packages

Update mirrorlist with the fastest mirrors

user $ sudo pacman-mirrors --fasttrack && sudo pacman -Syyu COPY TO CLIPBOARD


root # pacman-mirrors --fasttrack && pacman -Syyu COPY TO CLIPBOARD


Check if updates are available

user $ pamac checkupdates -a COPY TO CLIPBOARD


Update all installed packages

user $ pamac upgrade -a COPY TO CLIPBOARD


Search available packages

user $ pamac search [PackageName] COPY TO CLIPBOARD


Install packages

user $ pamac install [PackageName] COPY TO CLIPBOARD


Uninstall packages

user $ pamac remove [PackageName] COPY TO CLIPBOARD


Maintenance

Generate cache list

user $ du -sh ~/.cache/* COPY TO CLIPBOARD


Purge files not accessed in 100 days

user $ find ~/.cache/ -type f -atime +100 -delete COPY TO CLIPBOARD


Report journal current size

user $ journalctl --disk-usage COPY TO CLIPBOARD


Remove but recent entries by size or time

user $ journalctl --vacuum-size=50M COPY TO CLIPBOARD


user $ journalctl --vacuum-time=2weeks COPY TO CLIPBOARD


Check for orphaned packages

user $ pamac list -o COPY TO CLIPBOARD


Remove all orphans

user $ pamac remove -o COPY TO CLIPBOARD


Remove all packages except the latest 3 versions

user $ pamac clean --keep 3 COPY TO CLIPBOARD


AUR

Search for packages

user $ pamac search -a [PackageName] COPY TO CLIPBOARD


Build the package

user $ pamac build [PackageName] COPY TO CLIPBOARD


Access rights

Executes command as root

user $ sudo [command] COPY TO CLIPBOARD


Empties password cache

user $ sudo -k COPY TO CLIPBOARD


Edits /etc/sudoers

user $ sudo visudo COPY TO CLIPBOARD


Changes user password

user $ passwd COPY TO CLIPBOARD


Changes owner and group of file

user $ chown [owner]:[group] -c [file] COPY TO CLIPBOARD


Changes the file permissions

user $ chmod [permissions] -c [file] COPY TO CLIPBOARD


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

Displays files and permissions [of directory]

user $ ls -lh [dir] COPY TO CLIPBOARD


Files and Directories

changes the working directory

user $ cd [dir] COPY TO CLIPBOARD


changes to the parent directory

user $ cd .. COPY TO CLIPBOARD


lists directory contents

user $ ls -l COPY TO CLIPBOARD


also lists the hidden files

user $ ls -la COPY TO CLIPBOARD


copies the file

user $ cp [file] [target] COPY TO CLIPBOARD


copies the directory

user $ cp -r [directory] [target] COPY TO CLIPBOARD


move/rename target source

user $ mv [source] [target] COPY TO CLIPBOARD


removes directory recursively

user $ rm -r [dir] COPY TO CLIPBOARD


create symbolic link

user $ ln -s [target] [link] COPY TO CLIPBOARD


mounts file system

user $ mount -t [type] [/dev/sdx9] [mountpoint] COPY TO CLIPBOARD


mounts iso image

user $ mount -o loop [iso] [mountpoint] COPY TO CLIPBOARD


home directory of user

user $ cd /home/$USER COPY TO CLIPBOARD


user $ cd ~ COPY TO CLIPBOARD


directory with global configurations

user $ cd /etc COPY TO CLIPBOARD


Network

displays network information

user $ nmcli COPY TO CLIPBOARD


lists wireless access points

user $ nmcli c COPY TO CLIPBOARD


enables the firewall [package Community: ufw]

user $ ufw enable COPY TO CLIPBOARD


allows/denies all incoming traffic

user $ ufw default [allow/deny] COPY TO CLIPBOARD


displays firewall status and rules

user $ ufw status COPY TO CLIPBOARD


allows/denies incoming traffic on the specified port

user $ ufw [allow/deny] [port] COPY TO CLIPBOARD


allows/denies incoming traffic from specified IP address

user $ ufw [allow/deny] from [ip] COPY TO CLIPBOARD


System and Screen

Display kernel version

user $ uname -r COPY TO CLIPBOARD


Display long kernel version

user $ uname -a COPY TO CLIPBOARD


Report file system disk space usage

user $ df [/] [/home] COPY TO CLIPBOARD


user $ sudo btrfs filesystem usage -h [/] COPY TO CLIPBOARD


Display system tasks

user $ top COPY TO CLIPBOARD


user $ htop COPY TO CLIPBOARD


Display system information

user $ inxi --admin --verbosity=7 --filter --width COPY TO CLIPBOARD


Display a tree of processes

user $ pstree COPY TO CLIPBOARD


Switch to tty Ctrl+Alt+F[1..6]

Switch to the X session Ctrl+Alt+F7

starts a daemon
user $ rc.d start [daemon] COPY TO CLIPBOARD


stops a daemon
user $ rc.d stop [daemon] COPY TO CLIPBOARD


restarts a daemon
user $ rc.d restart daemon COPY TO CLIPBOARD


Shut down the system

user $ shutdown -h now COPY TO CLIPBOARD


Restart the system

user $ shutdown -r now COPY TO CLIPBOARD


Your sub title

Your sub title

Your sub title

Your sub title

Your sub title 2

user $ example command should be here COPY TO CLIPBOARD



Example codes should be here.


See Also

Example Link Title example text

Cookies help us deliver our services. By using our services, you agree to our use of cookies.