Useful commands: Difference between revisions

Teeth (talk | contribs)
navigation, paths, pipes, and more
Teeth (talk | contribs)
 
Line 99: Line 99:


== funky things you can do in the shell ==
== funky things you can do in the shell ==
some of the things you can do in the shell even without commands
the shell has a lot of funky features!!


=== put stuff in a file ===
=== put stuff in a file ===
Line 112: Line 112:


<code>cat long_file.txt | tail -n 50 | grep "keyword"</code>
<code>cat long_file.txt | tail -n 50 | grep "keyword"</code>
=== run multiple commands at once ===
You can have one command run only if another one succeeds by chaining them together with <code>&&</code>. If you don't care whether the first command succeeds, you can use <code>;</code> instead.
You can run a command in the background by putting <code>&</code> after it. Just be careful cuz a command running in the background can't be stopped like normal with <code>Ctrl+C</code>. Instead, you'll need to find it's PID and use the <code>kill</code> command.


== paths ==
== paths ==