Difference between revisions of "CheatSheet"

Lookover
(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 -->
translator
987

edits