Manjaro Difference between revisions of "CheatSheet"

Difference between revisions of "CheatSheet"

From Manjaro
(Rest)
(Lookover)
Line 18: Line 18:


=== Maintenance ===
=== Maintenance ===
Generate cache list {{UserCmd|command=du -sh ~/.cache/*}}
Generate cache list {{UserCmd|command=du -sh ~/.cache/*}}
Purge files not accessed in 100 days {{UserCmd|command=find ~/.cache/ -type f -atime +100 -delete}}
Purge files not accessed in 100 days {{UserCmd|command=find ~/.cache/ -type f -atime +100 -delete}}
Line 27: Line 28:


=== AUR ===
=== AUR ===
Search for packages {{UserCmd|command=pamac search -a [PackageName]}}
Search for packages {{UserCmd|command=pamac search -a [PackageName]}}
Build the package{{UserCmd|command=pamac build [PackageName]}}
Build the package{{UserCmd|command=pamac build [PackageName]}}


=== Access rights ===
=== Access rights ===
Executes command as root {{UserCmd|command=sudo [command]}}
 
Empties password cache {{UserCmd|command=sudo -k}}
Execute command as root {{UserCmd|command=sudo [command]}}
Edits /etc/sudoers {{UserCmd|command=sudo visudo}}
Emptie password cache {{UserCmd|command=sudo -k}}
Changes user password {{UserCmd|command=passwd}}
Edit /etc/sudoers {{UserCmd|command=sudo visudo}}
Changes owner and group of file {{UserCmd|command=chown [owner]:[group] -c [file]}}
Change user password {{UserCmd|command=passwd}}
Changes the file permissions {{UserCmd|command=chmod [permissions] -c [file]}}
Change owner and group of file {{UserCmd|command=chown [owner]:[group] -c [file]}}
Change file permissions {{UserCmd|command=chmod [permissions] -c [file]}}
Set permissions in octal mode: 4(read) 2(write) 1(execute)
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
Example: 755 read-write-execute for owner and read-execute for group and others


Displays files and permissions [of directory]{{UserCmd|command=ls -lh [dir]}}
Display files and permissions [of directory]{{UserCmd|command=ls -lh [dir]}}


=== Files and Directories ===
=== Files and Directories ===
changes the working directory {{UserCmd|command=cd [dir]}}
 
changes to the parent directory {{UserCmd|command=cd ..}}
Change the working directory {{UserCmd|command=cd [dir]}}
lists directory contents {{UserCmd|command=ls -l}}
change to parent directory {{UserCmd|command=cd ..}}
also lists the hidden files {{UserCmd|command=ls -la}}
List directory contents {{UserCmd|command=ls -l}}
copies the file {{UserCmd|command=cp [file] [target]}}
List also hidden files {{UserCmd|command=ls -la}}
copies the directory {{UserCmd|command=cp -r [directory] [target]}}
Copie file {{UserCmd|command=cp [file] [target]}}
move/rename target source {{UserCmd|command=mv [source] [target]}}
Copie directory '''recursively''' {{UserCmd|command=cp -r [directory] [target]}}
removes directory '''recursively''' {{UserCmd|command=rm -r [dir]}}
Move or rename file/directory {{UserCmd|command=mv [source] [target]}}
create symbolic link {{UserCmd|command=ln -s [target] [link]}}
Remove directory '''recursively''' {{UserCmd|command=rm -r [dir]}}
mounts file system {{UserCmd|command=mount -t [type] [/dev/sdx9] [mountpoint]}}
Create symbolic link {{UserCmd|command=ln -s [target] [link]}}
mounts iso image {{UserCmd|command=mount -o loop [iso] [mountpoint]}}
Mount filesystem {{UserCmd|command=mount -t [type] [/dev/sdx9] [mountpoint]}}
home directory of user {{UserCmd|command=cd /home/$USER}} {{UserCmd|command=cd ~}}
Mount ISO image {{UserCmd|command=mount -o loop [iso] [mountpoint]}}
directory with global configurations {{UserCmd|command=cd /etc}}
Home directory of user {{UserCmd|command=cd /home/$USER}} {{UserCmd|command=cd ~}}
Directory with global configurations {{UserCmd|command=cd /etc}}


=== Network ===
=== Network ===
displays network information {{UserCmd|command=nmcli}}
 
lists wireless access points {{UserCmd|command=nmcli c}}
Display network information {{UserCmd|command=nmcli}}
enables the firewall [package Community: ufw]  {{UserCmd|command=ufw enable}}
List wireless access points {{UserCmd|command=nmcli c}}
allows/denies all incoming traffic {{UserCmd|command=ufw default [allow/deny]}}
Enable firewall [package Community: ufw]  {{UserCmd|command=ufw enable}}
displays firewall status and rules {{UserCmd|command=ufw status}}
Allow/deny all incoming traffic {{UserCmd|command=ufw default [allow/deny]}}
allows/denies incoming traffic on the specified port {{UserCmd|command=ufw [allow/deny] [port]}}
Displays firewall status and rules {{UserCmd|command=ufw status}}
allows/denies incoming traffic from specified IP address {{UserCmd|command=ufw [allow/deny] from [ip]}}
Allows/deny incoming traffic on the specified port {{UserCmd|command=ufw [allow/deny] [port]}}
Allows/deny incoming traffic from specified IP address {{UserCmd|command=ufw [allow/deny] from [ip]}}


=== System and Screen ===
=== System and Screen ===
Display kernel version {{UserCmd|command=uname -r}}
Display kernel version {{UserCmd|command=uname -r}}
Display long kernel version {{UserCmd|command=uname -a}}
Display long kernel version {{UserCmd|command=uname -a}}
Line 84: Line 90:
Shut down the system {{UserCmd|command=shutdown -h now}}
Shut down the system {{UserCmd|command=shutdown -h now}}
Restart the system {{UserCmd|command=shutdown -r now}}
Restart the system {{UserCmd|command=shutdown -r now}}
=== Your sub title ===
=== Your sub title ===
=== Your sub title ===
=== Your sub title ===
==== Your sub title 2 ====


<!-- More Detail for formatter: https://www.mediawiki.org/wiki/Help:Formatting -->
<!-- More Detail for formatter: https://www.mediawiki.org/wiki/Help:Formatting -->
<!-- If you use command, it should be inside of usercmd. You can see below example -->
{{UserCmd|command=example command should be here}}
<!-- If you use code, it should be like below example(a space before that) -->
Example codes should be here.


<!-- Don't forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template -->
<!-- Don't forget to look more templates: https://wiki.manjaro.org/index.php/Help:Template -->

Revision as of 18:49, 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

Execute command as root

user $ sudo [command] COPY TO CLIPBOARD


Emptie password cache

user $ sudo -k COPY TO CLIPBOARD


Edit /etc/sudoers

user $ sudo visudo COPY TO CLIPBOARD


Change user password

user $ passwd COPY TO CLIPBOARD


Change owner and group of file

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


Change 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

Display files and permissions [of directory]

user $ ls -lh [dir] COPY TO CLIPBOARD


Files and Directories

Change the working directory

user $ cd [dir] COPY TO CLIPBOARD


change to parent directory

user $ cd .. COPY TO CLIPBOARD


List directory contents

user $ ls -l COPY TO CLIPBOARD


List also hidden files

user $ ls -la COPY TO CLIPBOARD


Copie file

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


Copie directory recursively

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


Move or rename file/directory

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


Remove directory recursively

user $ rm -r [dir] COPY TO CLIPBOARD


Create symbolic link

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


Mount filesystem

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


Mount 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

Display network information

user $ nmcli COPY TO CLIPBOARD


List wireless access points

user $ nmcli c COPY TO CLIPBOARD


Enable firewall [package Community: ufw]

user $ ufw enable COPY TO CLIPBOARD


Allow/deny all incoming traffic

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


Displays firewall status and rules

user $ ufw status COPY TO CLIPBOARD


Allows/deny incoming traffic on the specified port

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


Allows/deny 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



See Also

Example Link Title example text

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