Usefull Linux Command: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Find == *Find every file under the directory /usr ending by "js". <pre>find /usr -name *js</pre> *Find every file under the directory /home owned by the user bob. <pre>f...") |
No edit summary |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Export Display == | |||
<pre>export DISPLAY=:0</pre> | |||
== Find == | == Find == | ||
*Find every file under the directory /usr ending by "js". | * Find every file under the directory /usr ending by "js". | ||
<pre>find /usr -name *js</pre> | <pre>find /usr -name *js</pre> | ||
*Find every file under the directory /home owned by the user bob. | * Find every file under the directory /home owned by the user bob. | ||
<pre>find /home -user bob</pre> | <pre>find /home -user bob</pre> | ||
*Find every file under the directory /var/spool that was modified more than 60 days ago. | * Find every file under the directory /var/spool that was modified more than 60 days ago. | ||
<pre>find /var/spool -mtime +60</pre> | <pre>find /var/spool -mtime +60</pre> | ||
*Find files named core in or below the directory /tmp and delete them, processing filenames in such a way that file or directory names containing single or double quotes, spaces or newlines are correctly handled. The -name test comes before the -type test in order to avoid having to call | * Find files named core in or below the directory /tmp and delete them, processing filenames in such a way that file or directory names containing single or double quotes, spaces or newlines are correctly handled. The -name test comes before the -type test in order to avoid having to call | ||
<pre>find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f</pre> | <pre>find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f</pre> | ||
*Runs `file' on every file in or below the current directory | * Runs `file' on every file in or below the current directory | ||
find . -type f -exec file '{}' \; | <pre>find . -type f -exec file '{}' \;</pre> | ||
== Tar == | |||
=== Uncompress === | |||
==== Archive-name.tar.gz==== | |||
<pre>tar xzvf Archive-name.tar.gz -C /directory</pre> | |||
=== Compress === | |||
==== Archive-name.tar.gz==== | |||
<pre>tar czvf Archive-name.tar.gz /directory</pre> | |||
== Remote Desktop Xdmcp == | |||
* Xnest -ac -query 192.168.1.1 :1 -geometry 1024x768 | |||
== TcpDump == | |||
<pre>tcpdump host 192.168.1.1 -vvvli wlan0</pre> |
Latest revision as of 02:36, 15 August 2021
Export Display
export DISPLAY=:0
Find
- Find every file under the directory /usr ending by "js".
find /usr -name *js
- Find every file under the directory /home owned by the user bob.
find /home -user bob
- Find every file under the directory /var/spool that was modified more than 60 days ago.
find /var/spool -mtime +60
- Find files named core in or below the directory /tmp and delete them, processing filenames in such a way that file or directory names containing single or double quotes, spaces or newlines are correctly handled. The -name test comes before the -type test in order to avoid having to call
find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f
- Runs `file' on every file in or below the current directory
find . -type f -exec file '{}' \;
Tar
Uncompress
Archive-name.tar.gz
tar xzvf Archive-name.tar.gz -C /directory
Compress
Archive-name.tar.gz
tar czvf Archive-name.tar.gz /directory
Remote Desktop Xdmcp
- Xnest -ac -query 192.168.1.1 :1 -geometry 1024x768
TcpDump
tcpdump host 192.168.1.1 -vvvli wlan0