summaryrefslogtreecommitdiffhomepage
path: root/bash.html.markdown
diff options
context:
space:
mode:
authoralexandre medeiros <alexandre.medeiros@students.ic.unicamp.br>2013-09-22 11:35:04 -0300
committeralexandre medeiros <alexandre.medeiros@students.ic.unicamp.br>2013-09-22 11:35:04 -0300
commitb3288dc9cd0e1bd39e0e6d41664b120ea2f2e02a (patch)
tree4a37d82ca82094291796b0539b1c84cc7a825268 /bash.html.markdown
parent182eab60517e571931d7b928c28fb88a88fca894 (diff)
add useful commands
Diffstat (limited to 'bash.html.markdown')
-rw-r--r--bash.html.markdown12
1 files changed, 12 insertions, 0 deletions
diff --git a/bash.html.markdown b/bash.html.markdown
index ed93d58b..4d80545e 100644
--- a/bash.html.markdown
+++ b/bash.html.markdown
@@ -127,4 +127,16 @@ foo ()
# Calling your function
foo "My name is" $NAME
+
+# There are a lot of useful commands you should learn:
+tail -n 10 file.txt
+# prints last 10 lines of file.txt
+head -n 10 file.txt
+# prints first 10 lines of file.txt
+sort file.txt
+# sort file.txt's lines
+uniq -d file.txt
+# report or omit repeated lines, with -d it reports them
+cut -d ',' -f 1 file.txt
+# prints only the first column before the ',' character
```